OSDN Git Service

make_ext4fs: Modify ext4 filesystem setup to speed up fsck
authorMohamad Ayyash <mkayyash@google.com>
Fri, 15 Apr 2016 02:43:31 +0000 (19:43 -0700)
committerMohamad Ayyash <mkayyash@google.com>
Sat, 16 Apr 2016 01:43:57 +0000 (18:43 -0700)
1) Set EXT4_BG_INODE_UNINIT so fsck will skip scanning unused inodes
2) Use EXT4_FEATURE_RO_COMPAT_GDT_CSUM to enable group descriptor
checksums in filesystem which reduces overhead for fsck

BUG: 24747200
BUG: 28013112
Change-Id: I118ab26935442f452962b3a7c29c61acf76ad4d9
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
ext4_utils/allocate.c
ext4_utils/make_ext4fs.c

index 0c99e91..f5fd4fa 100644 (file)
@@ -277,7 +277,7 @@ static void init_bg(struct block_group_info *bg, unsigned int i)
        bg->free_blocks = info.blocks_per_group;
        bg->free_inodes = info.inodes_per_group;
        bg->first_free_inode = 1;
-       bg->flags = 0;
+       bg->flags = EXT4_BG_INODE_UNINIT;
 
        bg->chunk_count = 0;
        bg->max_chunk_count = 1;
index 1a6c0c1..6083cea 100644 (file)
@@ -749,7 +749,8 @@ int make_ext4fs_internal(int fd, const char *_directory, const char *_target_out
 
        info.feat_ro_compat |=
                        EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER |
-                       EXT4_FEATURE_RO_COMPAT_LARGE_FILE;
+                       EXT4_FEATURE_RO_COMPAT_LARGE_FILE |
+                       EXT4_FEATURE_RO_COMPAT_GDT_CSUM;
 
        info.feat_incompat |=
                        EXT4_FEATURE_INCOMPAT_EXTENTS |