From 69d0edfd01ef81efd9f880231999975582ea8b60 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 23 Apr 2009 00:39:06 -0400 Subject: [PATCH] e2fsck: Don't test the resize_inode if the filesystem is clean 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" --- e2fsck/e2fsck.h | 1 + e2fsck/super.c | 4 +--- e2fsck/unix.c | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h index 9a95cb0..553a8c4 100644 --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h @@ -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, diff --git a/e2fsck/super.c b/e2fsck/super.c index 2d50ad5..17f66dd 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -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. */ diff --git a/e2fsck/unix.c b/e2fsck/unix.c index e39afdd..c49df23 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -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) -- 1.8.3.1