Whamcloud - gitweb
mke2fs: Enable lazy_itable_init if the kernel supports this feature
authorTheodore Ts'o <tytso@mit.edu>
Fri, 1 Oct 2010 14:47:38 +0000 (10:47 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 1 Oct 2010 14:47:38 +0000 (10:47 -0400)
Add check for /sys/fs/ext4/features/lazy_itable_init.  If this file
exists, it should be OK to skip initializing the inode table since the
kernel will do it at mount time.

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

index 08fab41..3c10a7a 100644 (file)
@@ -1723,8 +1723,13 @@ got_size:
 
        blocksize = EXT2_BLOCK_SIZE(&fs_param);
 
+       lazy_itable_init = 0;
+       if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
+               lazy_itable_init = 1;
+
        lazy_itable_init = get_bool_from_profile(fs_types,
-                                                "lazy_itable_init", 0);
+                                                "lazy_itable_init",
+                                                lazy_itable_init);
 
        /* Get options from profile */
        for (cpp = fs_types; *cpp; cpp++) {