Skip to content
Snippets Groups Projects
Commit a2740dd0 authored by Aaron Pace's avatar Aaron Pace Committed by Wolfgang Denk
Browse files

ext2fs: Fix optimization bug for doubly-indirect block pointers


Doubly-indirect block numbers are compared against the first-level
indirect block when checking for a cached copy.  This is causing the
doubly-indirect block to be re-read each time it is accessed.
Repairing this reduces load time for a 70M file from 72 seconds
to 38 seconds.

Signed-off-by: default avatarAaron Pace <Aaron.Pace@alcatel-lucent.com>
parent c519facc
No related branches found
No related tags found
No related merge requests found
...@@ -364,7 +364,7 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) { ...@@ -364,7 +364,7 @@ static int ext2fs_read_block (ext2fs_node_t node, int fileblock) {
indir2_size = blksz; indir2_size = blksz;
} }
if ((__le32_to_cpu (indir1_block[rblock / perblock]) << if ((__le32_to_cpu (indir1_block[rblock / perblock]) <<
log2_blksz) != indir1_blkno) { log2_blksz) != indir2_blkno) {
status = ext2fs_devread (__le32_to_cpu(indir1_block[rblock / perblock]) << log2_blksz, status = ext2fs_devread (__le32_to_cpu(indir1_block[rblock / perblock]) << log2_blksz,
0, blksz, 0, blksz,
(char *) indir2_block); (char *) indir2_block);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment