[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1375728387-3595-1-git-send-email-manishrma@gmail.com>
Date: Tue, 6 Aug 2013 00:16:27 +0530
From: Manish Sharma <manishrma@...il.com>
To: Phillip Lougher <phillip@...ashfs.org.uk>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
kernelnewbies@...nelnewbies.org,
Manish Sharma <manishrma@...il.com>
Subject: [PATCH 1/1] 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@...il.com>
---
fs/squashfs/block.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
index fb50652..5012f98 100644
--- a/fs/squashfs/block.c
+++ b/fs/squashfs/block.c
@@ -169,12 +169,6 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
*/
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;
- }
-
for (bytes = length; k < b; k++) {
in = min(bytes, msblk->devblksize - offset);
bytes -= in;
@@ -185,6 +179,9 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
}
avail = min_t(int, in, PAGE_CACHE_SIZE -
pg_offset);
+ wait_on_buffer(bh[k]);
+ if (!buffer_uptodate(bh[k]))
+ goto block_release;
memcpy(buffer[page] + pg_offset,
bh[k]->b_data + offset, avail);
in -= avail;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists