From: Andreas Dilger Date: Sun, 24 Aug 2008 02:56:07 +0000 (-0600) Subject: e2fsck_write_bitmaps() optimization X-Git-Tag: v1.41.1~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1bb6f6c87e860f8c021f966fc36aa8768590a227;p=thirdparty%2Fe2fsprogs.git 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 --- diff --git a/e2fsck/util.c b/e2fsck/util.c index 315a5751b..fc3503920 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); } }