summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorYunlei He <heyunlei@huawei.com>2015-05-07 18:11:37 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-05-28 15:41:58 -0700
commit498c5e9fcd10c89404601b222c1dbcb6e4f10a02 (patch)
tree719a1687e354574c1847cb4f5c0bd0842d3c27aa /fs/f2fs
parentd690358b2bf43f5cb12ce07d209d09b1decb79c3 (diff)
downloadlinux-498c5e9fcd10c89404601b222c1dbcb6e4f10a02.tar.gz
linux-498c5e9fcd10c89404601b222c1dbcb6e4f10a02.tar.bz2
linux-498c5e9fcd10c89404601b222c1dbcb6e4f10a02.zip
f2fs: add default mount options to remount
I use f2fs filesystem with /data partition on my Android phone by the default mount options. When I remount /data in order to adding discard option to run some benchmarks, I find the default options such as background_gc, user_xattr and acl turned off. So I introduce a function named default_options in super.c. It do some default setting, and both mount and remount operations will call this function to complete default setting. Signed-off-by: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/super.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index d61f74ab4a03..d5dfd143c394 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -661,6 +661,22 @@ static const struct file_operations f2fs_seq_segment_info_fops = {
.release = single_release,
};
+static void default_options(struct f2fs_sb_info *sbi)
+{
+ /* init some FS parameters */
+ sbi->active_logs = NR_CURSEG_TYPE;
+
+ set_opt(sbi, BG_GC);
+ set_opt(sbi, INLINE_DATA);
+
+#ifdef CONFIG_F2FS_FS_XATTR
+ set_opt(sbi, XATTR_USER);
+#endif
+#ifdef CONFIG_F2FS_FS_POSIX_ACL
+ set_opt(sbi, POSIX_ACL);
+#endif
+}
+
static int f2fs_remount(struct super_block *sb, int *flags, char *data)
{
struct f2fs_sb_info *sbi = F2FS_SB(sb);
@@ -679,7 +695,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
active_logs = sbi->active_logs;
sbi->mount_opt.opt = 0;
- sbi->active_logs = NR_CURSEG_TYPE;
+ default_options(sbi);
/* parse mount options */
err = parse_options(sb, data);
@@ -1021,18 +1037,7 @@ try_onemore:
goto free_sbi;
sb->s_fs_info = sbi;
- /* init some FS parameters */
- sbi->active_logs = NR_CURSEG_TYPE;
-
- set_opt(sbi, BG_GC);
- set_opt(sbi, INLINE_DATA);
-
-#ifdef CONFIG_F2FS_FS_XATTR
- set_opt(sbi, XATTR_USER);
-#endif
-#ifdef CONFIG_F2FS_FS_POSIX_ACL
- set_opt(sbi, POSIX_ACL);
-#endif
+ default_options(sbi);
/* parse mount options */
options = kstrdup((const char *)data, GFP_KERNEL);
if (data && !options) {