From: Yongqiang Yang <xiaoqiangnk@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: adilger@gmail.com, Yongqiang Yang <xiaoqiangnk@gmail.com>
Subject: [PATCH 3/4] ext4: accelerate updating of backup gdb
Date: Mon, 30 Jan 2012 00:01:05 +0800 [thread overview]
Message-ID: <1327852866-4448-4-git-send-email-xiaoqiangnk@gmail.com> (raw)
In-Reply-To: <1327852866-4448-1-git-send-email-xiaoqiangnk@gmail.com>
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
next prev parent reply other threads:[~2012-03-22 13:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-29 16:01 ext4: add meta_bg and bit64 support to online resizing Yongqiang Yang
2012-01-29 16:01 ` [PATCH 1/4] ext4: do not copy gdt blocks for groups which do not have super when resizing Yongqiang Yang
2012-01-29 16:01 ` [PATCH 2/4] ext4: fix a bug in resize when first_data_block != 0 Yongqiang Yang
2012-01-29 16:01 ` Yongqiang Yang [this message]
2012-01-29 16:01 ` [PATCH 4/4] ext4: enable online-resizing support meta_bg and bit64 Yongqiang Yang
2012-03-22 16:00 ` Andreas Dilger
2012-03-23 18:02 ` ext4: add meta_bg and bit64 support to online resizing Anssi Hannula
2012-04-14 14:55 ` Anssi Hannula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327852866-4448-4-git-send-email-xiaoqiangnk@gmail.com \
--to=xiaoqiangnk@gmail.com \
--cc=adilger@gmail.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).