[PATCH, E2FSPROGS] libext2fs: Micro-optimization in inode scan code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andreas Dilger <adilger@xxxxxxxxx>

Signed-off-by: Andreas Dilger <adilger@xxxxxxxxx>
Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
---
 lib/ext2fs/inode.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
index b4a445d..bd568b3 100644
--- a/lib/ext2fs/inode.c
+++ b/lib/ext2fs/inode.c
@@ -239,9 +239,8 @@ static errcode_t get_next_blockgroup(ext2_inode_scan scan)
 		scan->inodes_left -=
 			fs->group_desc[scan->current_group].bg_itable_unused;
 		scan->blocks_left =
-			(EXT2_INODES_PER_GROUP(fs->super) -
-			 fs->group_desc[scan->current_group].bg_itable_unused +
-			 fs->blocksize / scan->inode_size - 1) *
+			(scan->inodes_left +
+			 (fs->blocksize / scan->inode_size - 1)) *
 			scan->inode_size / fs->blocksize;
 	}
 
-- 
1.5.4.1.144.gdfee-dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux