From 1bb6f6c87e860f8c021f966fc36aa8768590a227 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 23 Aug 2008 20:56:07 -0600 Subject: [PATCH] e2fsck_write_bitmaps() optimization This patch changes the e2fsck_write_bitmaps() function to write out the block and inode bitmaps together, instead of writing them in two passes. Signed-off-by: Andreas Dilger Signed-off-by: Theodore Ts'o --- e2fsck/util.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/e2fsck/util.c b/e2fsck/util.c index 315a575..fc35039 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -237,28 +237,14 @@ void e2fsck_write_bitmaps(e2fsck_t ctx) errcode_t retval; const char *old_op; - if (ext2fs_test_bb_dirty(fs)) { - old_op = ehandler_operation(_("writing block bitmaps")); - retval = ext2fs_write_block_bitmap(fs); - ehandler_operation(old_op); - if (retval) { - com_err(ctx->program_name, retval, - _("while retrying to write block bitmaps for %s"), - ctx->device_name); - fatal_error(ctx, 0); - } - } - - if (ext2fs_test_ib_dirty(fs)) { - old_op = ehandler_operation(_("writing inode bitmaps")); - retval = ext2fs_write_inode_bitmap(fs); - ehandler_operation(old_op); - if (retval) { - com_err(ctx->program_name, retval, - _("while retrying to write inode bitmaps for %s"), - ctx->device_name); - fatal_error(ctx, 0); - } + old_op = ehandler_operation(_("writing block and inode bitmaps")); + retval = ext2fs_write_bitmaps(fs); + ehandler_operation(old_op); + if (retval) { + com_err(ctx->program_name, retval, + _("while rewriting block and inode bitmaps for %s"), + ctx->device_name); + fatal_error(ctx, 0); } } -- 1.8.3.1