[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141025205753.532.92273.stgit@birch.djwong.org>
Date: Sat, 25 Oct 2014 13:57:53 -0700
From: "Darrick J. Wong" <darrick.wong@...cle.com>
To: tytso@....edu, darrick.wong@...cle.com
Cc: linux-ext4@...r.kernel.org
Subject: [PATCH 14/39] mke2fs: don't zero inode table blocks that are
already zeroed
At mke2fs time, if we discard the device and discard zeroes data,
don't bother zeroing the inode table blocks a second time.
Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
---
misc/mke2fs.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index a7bd35a..c6a2c2f 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -421,12 +421,14 @@ static void write_inode_tables(ext2_filsys fs, int lazy_flag, int itable_zeroed)
ext2fs_bg_flags_set(fs, i, EXT2_BG_INODE_ZEROED);
ext2fs_group_desc_csum_set(fs, i);
}
- retval = ext2fs_zero_blocks2(fs, blk, num, &blk, &num);
- if (retval) {
- fprintf(stderr, _("\nCould not write %d "
- "blocks in inode table starting at %llu: %s\n"),
- num, blk, error_message(retval));
- exit(1);
+ if (!itable_zeroed) {
+ retval = ext2fs_zero_blocks2(fs, blk, num, &blk, &num);
+ if (retval) {
+ fprintf(stderr, _("\nCould not write %d "
+ "blocks in inode table starting at %llu: %s\n"),
+ num, blk, error_message(retval));
+ exit(1);
+ }
}
if (sync_kludge) {
if (sync_kludge == 1)
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists