linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, rwheeler@redhat.com, sandeen@redhat.com,
	adilger@dilger.ca, lczerner@redhat.com
Subject: [PATCH 4/6] Use sb_issue_zeroout in setup_new_group_blocks
Date: Wed, 15 Sep 2010 18:36:06 +0200	[thread overview]
Message-ID: <1284568568-13637-5-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1284568568-13637-1-git-send-email-lczerner@redhat.com>

Use sn_issue_discard to zero out inode table and descriptor table
blocks instead of old approach which involves journaling.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/resize.c |   44 +++++++++++---------------------------------
 1 files changed, 11 insertions(+), 33 deletions(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 6df797e..60161bc 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -226,23 +226,12 @@ static int setup_new_group_blocks(struct super_block *sb,
 	}
 
 	/* Zero out all of the reserved backup group descriptor table blocks */
-	for (i = 0, bit = gdblocks + 1, block = start + bit;
-	     i < reserved_gdb; i++, block++, bit++) {
-		struct buffer_head *gdb;
-
-		ext4_debug("clear reserved block %#04llx (+%d)\n", block, bit);
-
-		if ((err = extend_or_restart_transaction(handle, 1, bh)))
-			goto exit_bh;
+	ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
+			block, sbi->s_itb_per_group);
+	err = sb_issue_zeroout(sb, gdblocks + start + 1, reserved_gdb);
+	if (err)
+		goto exit_journal;
 
-		if (IS_ERR(gdb = bclean(handle, sb, block))) {
-			err = PTR_ERR(gdb);
-			goto exit_bh;
-		}
-		ext4_handle_dirty_metadata(handle, NULL, gdb);
-		ext4_set_bit(bit, bh->b_data);
-		brelse(gdb);
-	}
 	ext4_debug("mark block bitmap %#04llx (+%llu)\n", input->block_bitmap,
 		   input->block_bitmap - start);
 	ext4_set_bit(input->block_bitmap - start, bh->b_data);
@@ -251,23 +240,12 @@ static int setup_new_group_blocks(struct super_block *sb,
 	ext4_set_bit(input->inode_bitmap - start, bh->b_data);
 
 	/* Zero out all of the inode table blocks */
-	for (i = 0, block = input->inode_table, bit = block - start;
-	     i < sbi->s_itb_per_group; i++, bit++, block++) {
-		struct buffer_head *it;
-
-		ext4_debug("clear inode block %#04llx (+%d)\n", block, bit);
-
-		if ((err = extend_or_restart_transaction(handle, 1, bh)))
-			goto exit_bh;

  parent reply	other threads:[~2010-09-15 16:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15 16:36 [PATCH 0/6 v3] Lazy itable initialization for Ext4 Lukas Czerner
2010-09-15 16:36 ` [PATCH 1/6] Add helper function for blkdev_issue_zeroout Lukas Czerner
2010-09-15 20:33   ` Mike Snitzer
2010-09-15 16:36 ` [PATCH 2/6] Add inititable/noinititable mount options for ext4 Lukas Czerner
2010-09-15 16:36 ` [PATCH 3/6] Add inode table initialization code for Ext4 Lukas Czerner
2010-09-15 16:46   ` Lukas Czerner
2010-09-15 16:36 ` Lukas Czerner [this message]
2010-09-15 16:36 ` [PATCH 5/6] Use sb_issue_discard in ext4_ext_zeroout Lukas Czerner
2010-09-15 20:19   ` Mike Snitzer
2010-09-15 16:36 ` [PATCH 6/6] Add interface to advertise ext4 features in sysfs Lukas Czerner
2011-01-10 23:08   ` Eric Sandeen
2011-01-11 12:55     ` Lukas Czerner
  -- strict thread matches above, loose matches on Subject: below --
2010-09-16 12:47 [PATCH 0/6 v4] Lazy itable initialization for Ext4 Lukas Czerner
2010-09-16 12:47 ` [PATCH 4/6] Use sb_issue_zeroout in setup_new_group_blocks Lukas Czerner
2010-09-29 14:12   ` Lukas Czerner
2010-09-29 14:14     ` Lukas Czerner

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=1284568568-13637-5-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=rwheeler@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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).