From: Theodore Ts'o Date: Sun, 27 Apr 2008 23:38:02 +0000 (-0400) Subject: mke2fs: Make argument to the extended option lazy_itable_init optional X-Git-Tag: v1.41-WIP-0427~1^2~7 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=43781b9459f1b511e4cf94358593e097d8fdb795;p=tools%2Fe2fsprogs.git mke2fs: Make argument to the extended option lazy_itable_init optional Also remove some debugging printf's left over from a previous patch. Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in index 1e9a203..56f5471 100644 --- a/misc/mke2fs.8.in +++ b/misc/mke2fs.8.in @@ -205,14 +205,15 @@ parity in a RAID stripe if possible when the data is written. Reserve enough space so that the block group descriptor table can grow to support a filesystem that has max-online-resize blocks. .TP -.B lazy_itable_init= \fI<0 to disable, 1 to enable> +.B lazy_itable_init\fR[\fb= \fI<0 to disable, 1 to enable>\fR] If enabled and the uninit_bg feature is enabled, the inode table will not fully initialized by .BR mke2fs . This speeds up filesystem initialization noitceably, but it requires the kernel to finish initializing the filesystem in the background when the filesystem is -first mounted. +first mounted. If the option value is omitted, it defaults to 1 to +enable lazy inode table initialization. .TP .B test_fs Set a flag in the filesystem superblock indicating that it may be diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 8d25794..3812f86 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -423,14 +423,11 @@ static void write_inode_tables(ext2_filsys fs, int lazy_flag) if (lazy_flag) { ipb = fs->blocksize / EXT2_INODE_SIZE(fs->super); - printf("bg %i, num %d, ipb %d, unused %d ", - i, num, ipb, fs->group_desc[i].bg_itable_unused); num = ((((fs->super->s_inodes_per_group - fs->group_desc[i].bg_itable_unused) * EXT2_INODE_SIZE(fs->super)) + EXT2_BLOCK_SIZE(fs->super) - 1) / EXT2_BLOCK_SIZE(fs->super)); - printf("new num %d\n", num); } else { /* The kernel doesn't need to zero the itable blocks */ fs->group_desc[i].bg_flags |= EXT2_BG_INODE_ZEROED; @@ -843,12 +840,10 @@ static void parse_extended_opts(struct ext2_super_block *param, } else if (!strcmp(token, "test_fs")) { param->s_flags |= EXT2_FLAGS_TEST_FILESYS; } else if (!strcmp(token, "lazy_itable_init")) { - if (!arg) { - r_usage++; - badopt = token; - continue; - } - lazy_itable_init = strtoul(arg, &p, 0); + if (arg) + lazy_itable_init = strtoul(arg, &p, 0); + else + lazy_itable_init = 1; } else { r_usage++; badopt = token;