aboutsummaryrefslogtreecommitdiffstats
path: root/mkfs/f2fs_format_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkfs/f2fs_format_main.c')
-rw-r--r--mkfs/f2fs_format_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index 03eb748..031244d 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -110,11 +110,16 @@ static void add_default_options(void)
/* -d1 -f -O encrypt -O quota -O verity -w 4096 -R 0:0 */
c.dbg_lv = 1;
force_overwrite = 1;
+ c.wanted_sector_size = 4096;
+ c.root_uid = c.root_gid = 0;
+
+ /* RO doesn't need any other features */
+ if (c.feature & cpu_to_le32(F2FS_FEATURE_RO))
+ return;
+
c.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT);
c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO);
c.feature |= cpu_to_le32(F2FS_FEATURE_VERITY);
- c.wanted_sector_size = 4096;
- c.root_uid = c.root_gid = 0;
break;
}
#ifdef CONF_CASEFOLD