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

List:       linux-ext4
Subject:    [PATCH 3/4] ext4: accelerate updating of backup gdb
From:       Yongqiang Yang <xiaoqiangnk () gmail ! com>
Date:       2012-01-29 16:01:05
Message-ID: 1327852866-4448-4-git-send-email-xiaoqiangnk () gmail ! com
[Download RAW message or body]

Updating of backup group descriptor blocks shoud done in the unit of
gdb, rather than group.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
 fs/ext4/resize.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 58109fa..3999a19 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1290,15 +1290,18 @@ exit_journal:
 		err = err2;
 
 	if (!err) {
-		int i;
+		int gdb_num, gdb_num_end;
 		ext4_fsblk_t first_block;
+
 		first_block = ext4_group_first_block_no(sb, 0);
 		update_backups(sb, sbi->s_sbh->b_blocknr - first_block,
 			       (char *)es, sizeof(struct ext4_super_block));
-		for (i = 0; i < flex_gd->count; i++, group++) {
+
+		gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
+		gdb_num_end = (group + flex_gd->count - 1) /
+			      EXT4_DESC_PER_BLOCK(sb);
+		for (; gdb_num <= gdb_num_end; gdb_num++) {
 			struct buffer_head *gdb_bh;
-			int gdb_num;
-			gdb_num = group / EXT4_BLOCKS_PER_GROUP(sb);
 			gdb_bh = sbi->s_group_desc[gdb_num];
 			update_backups(sb, gdb_bh->b_blocknr - first_block,
 				       gdb_bh->b_data, gdb_bh->b_size);
-- 
1.7.5.1

--
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