squashfs: allows users to configure the number of decompression threads
[linux-2.6-block.git] / fs / squashfs / decompressor_multi.c
index eb25432bd1494eecd3a4cfe3eb6ceb0b10b50b54..416c53eedbd1d39fc50204bf0070d56aabafdb99 100644 (file)
@@ -144,7 +144,7 @@ static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk,
                 * If there is no available decomp and already full,
                 * let's wait for releasing decomp from other users.
                 */
-               if (stream->avail_decomp >= MAX_DECOMPRESSOR)
+               if (stream->avail_decomp >= msblk->max_thread_num)
                        goto wait;
 
                /* Let's allocate new decomp */
@@ -160,7 +160,7 @@ static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk,
                }
 
                stream->avail_decomp++;
-               WARN_ON(stream->avail_decomp > MAX_DECOMPRESSOR);
+               WARN_ON(stream->avail_decomp > msblk->max_thread_num);
 
                mutex_unlock(&stream->mutex);
                break;