diff options
| author | Manish Sharma <manishrma@gmail.com> | 2013-09-04 22:31:23 +0530 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 11:00:15 +0200 |
| commit | 9a0df35da1db4f1dadd2347332dd2e894b21a0b6 (patch) | |
| tree | e6a7ba285137a474490f4ff44e1a32413432611c | |
| parent | 3d2784510a184657f16f68891374be91adff0749 (diff) | |
Squashfs: Optimized uncompressed buffer loop
Merged the two for loops. We might get a little gain by overlapping
wait_on_bh and the memcpy operations.
Signed-off-by: Manish Sharma <manishrma@gmail.com>
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Change-Id: I7cf983af7e72452b313fdb910eb99bcdc8398ca9
| -rw-r--r-- | fs/squashfs/block.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index fb50652e4..41d108ecc 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -167,17 +167,14 @@ 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); bytes -= in; + wait_on_buffer(bh[k]); + if (!buffer_uptodate(bh[k])) + goto block_release; while (in) { if (pg_offset == PAGE_CACHE_SIZE) { page++; |
