aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-01-14 17:30:23 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-01-15 14:05:48 -0500
commit2a3b1c6ea29db5d5dfe4602d0b0adfda88068de6 (patch)
tree93bb54f0bd8288b02a27131f4e344466a799986c
parent4b20ea2691b3408340036d16e62867d5c52078e3 (diff)
downloade2fsprogs-2a3b1c6ea29db5d5dfe4602d0b0adfda88068de6.tar.gz
e2fsprogs-2a3b1c6ea29db5d5dfe4602d0b0adfda88068de6.tar.xz
e2fsprogs-2a3b1c6ea29db5d5dfe4602d0b0adfda88068de6.zip
mke2fs: the -g option will now specify the clusters per block group
If bigalloc is enabled, then -g will specify the clusters per block group. (If bigalloc is not enabled, then a cluster == a block, so the meaning of -g is not changed.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
-rw-r--r--misc/mke2fs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 98c2035f..2103f636 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1962,6 +1962,15 @@ profile_error:
}
}
+ /*
+ * If the bigalloc feature is enabled, then the -g option will
+ * specify the number of clusters per group.
+ */
+ if (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) {
+ fs_param.s_clusters_per_group = fs_param.s_blocks_per_group;
+ fs_param.s_blocks_per_group = 0;
+ }
+
if (inode_size == 0)
inode_size = get_int_from_profile(fs_types, "inode_size", 0);
if (!flex_bg_size && (fs_param.s_feature_incompat &