Whamcloud - gitweb
e2fsck: Don't test the resize_inode if the filesystem is clean
authorTheodore Ts'o <tytso@mit.edu>
Thu, 23 Apr 2009 04:39:06 +0000 (00:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 23 Apr 2009 04:39:06 +0000 (00:39 -0400)
Move check_resize_inode() out of check_super_block(), since we only
need to test the resize_inode for correctness only if the filesystem
requires checking.  This change avoids a lot of I/O operations which
slows down a 1 second boot.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/e2fsck.h
e2fsck/super.c
e2fsck/unix.c

index 9a95cb0..553a8c4 100644 (file)
@@ -470,6 +470,7 @@ void e2fsck_rehash_directories(e2fsck_t ctx);
 /* super.c */
 void check_super_block(e2fsck_t ctx);
 int check_backup_super_block(e2fsck_t ctx);
+void check_resize_inode(e2fsck_t ctx);
 
 /* util.c */
 extern void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned int size,
index 2d50ad5..17f66dd 100644 (file)
@@ -304,7 +304,7 @@ return_abort:
  * resize inode should be cleared) as well as the case where on-line
  * resizing is enabled.
  */
-static void check_resize_inode(e2fsck_t ctx)
+void check_resize_inode(e2fsck_t ctx)
 {
        ext2_filsys fs = ctx->fs;
        struct ext2_inode inode;
@@ -785,8 +785,6 @@ void check_super_block(e2fsck_t ctx)
                fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
        }
 
-       check_resize_inode(ctx);
-
        /*
         * Clean up any orphan inodes, if present.
         */
index e39afdd..c49df23 100644 (file)
@@ -1258,6 +1258,7 @@ print_unsupp_features:
        if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
                fatal_error(ctx, 0);
        check_if_skip(ctx);
+       check_resize_inode(ctx);
        if (bad_blocks_file)
                read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks);
        else if (cflag)