[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ext4
Subject:    [PATCH, E2FSPROGS] libext2fs: Micro-optimization in inode scan code
From:       "Theodore Ts'o" <tytso () MIT ! EDU>
Date:       2008-03-31 23:36:28
Message-ID: 1207006592-13980-7-git-send-email-tytso () mit ! edu
[Download RAW message or body]

From: Andreas Dilger <adilger@dilger.ca>

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic