Whamcloud - gitweb
mke2fs: Make argument to the extended option lazy_itable_init optional
authorTheodore Ts'o <tytso@mit.edu>
Sun, 27 Apr 2008 23:38:02 +0000 (19:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 27 Apr 2008 23:38:02 +0000 (19:38 -0400)
Also remove some debugging printf's left over from a previous patch.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/mke2fs.8.in
misc/mke2fs.c

index 1e9a203..56f5471 100644 (file)
@@ -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
index 8d25794..3812f86 100644 (file)
@@ -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;