Preparing parallel decompression. In squashfs_read_data(), move wait_on_buffer() forer which is common part of the 'if (compressed) - else' blocks. Signed-off-by: J. R. Okajima <hooanon05@xxxxxxxxxxx> --- fs/squashfs/block.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index 2a79603..1017b94 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -151,6 +151,12 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index, } ll_rw_block(READ, b - 1, bh + 1); } + for (k = 0; k < b; k++) { + wait_on_buffer(bh[k]); + /* possible? */ + WARN_ON(!buffer_uptodate(bh[k])); + } + k = 0; if (compressed) { int zlib_err = 0, zlib_init = 0; @@ -169,9 +175,6 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index, if (msblk->stream.avail_in == 0 && k < b) { avail = min(bytes, msblk->devblksize - offset); bytes -= avail; - wait_on_buffer(bh[k]); - if (!buffer_uptodate(bh[k])) - goto release_mutex; if (avail == 0) { offset = 0; @@ -223,13 +226,7 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index, /* * Block is uncompressed. */ - int i, in, pg_offset = 0; - - for (i = 0; i < b; i++) { - wait_on_buffer(bh[i]); - if (!buffer_uptodate(bh[i])) - goto block_release; - } + int in, pg_offset = 0; for (bytes = length; k < b; k++) { in = min(bytes, msblk->devblksize - offset); -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html