diff options
author | Manish Sharma <manishrma@gmail.com> | 2013-09-04 13:01:23 -0400 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2013-09-04 19:13:37 -0400 |
commit | e0125262a2f5cefbfb3804117f8ab16e9ba13e29 (patch) | |
tree | 9c2ba3a01df9a1ab647cfc6105e80f521ff9e9f3 | |
parent | 28d7b5684ba98e163ba37779fd09de01fac5261d (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>
-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 fb50652e4e11..41d108ecc9be 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, | |||
167 | /* | 167 | /* |
168 | * Block is uncompressed. | 168 | * Block is uncompressed. |
169 | */ | 169 | */ |
170 | int i, in, pg_offset = 0; | 170 | int in, pg_offset = 0; |
171 | |||
172 | for (i = 0; i < b; i++) { | ||
173 | wait_on_buffer(bh[i]); | ||
174 | if (!buffer_uptodate(bh[i])) | ||
175 | goto block_release; | ||
176 | } | ||
177 | 171 | ||
178 | for (bytes = length; k < b; k++) { | 172 | for (bytes = length; k < b; k++) { |
179 | in = min(bytes, msblk->devblksize - offset); | 173 | in = min(bytes, msblk->devblksize - offset); |
180 | bytes -= in; | 174 | bytes -= in; |
175 | wait_on_buffer(bh[k]); | ||
176 | if (!buffer_uptodate(bh[k])) | ||
177 | goto block_release; | ||
181 | while (in) { | 178 | while (in) { |
182 | if (pg_offset == PAGE_CACHE_SIZE) { | 179 | if (pg_offset == PAGE_CACHE_SIZE) { |
183 | page++; | 180 | page++; |