* [PATCH] f2fs: add default mount options to remount
@ 2015-05-07 9:20 Yunlei He
2015-05-07 9:32 ` He YunLei
0 siblings, 1 reply; 4+ messages in thread
From: Yunlei He @ 2015-05-07 9:20 UTC (permalink / raw)
To: linux-f2fs-devel, jaegeuk, cm224.lee
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>
---
fs/f2fs/super.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 138fa93..1f9f18a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -658,6 +658,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);
@@ -675,8 +691,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
org_mount_opt = sbi->mount_opt;
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);
@@ -1018,18 +1033,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) {
--
1.9.1
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: add default mount options to remount
2015-05-07 9:20 [PATCH] f2fs: add default mount options to remount Yunlei He
@ 2015-05-07 9:32 ` He YunLei
0 siblings, 0 replies; 4+ messages in thread
From: He YunLei @ 2015-05-07 9:32 UTC (permalink / raw)
To: Yunlei He; +Cc: jaegeuk, linux-f2fs-devel
On 2015/5/7 17:20, Yunlei He wrote:
> 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>
> ---
> fs/f2fs/super.c | 32 ++++++++++++++++++--------------
> 1 file changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 138fa93..1f9f18a 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -658,6 +658,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);
> @@ -675,8 +691,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
> org_mount_opt = sbi->mount_opt;
> active_logs = sbi->active_logs;
>
> - sbi->mount_opt.opt = 0;
I am very sorry that this line is deleted by mistake, I'll send a version.
> - sbi->active_logs = NR_CURSEG_TYPE;
> + default_options(sbi);
>
> /* parse mount options */
> err = parse_options(sb, data);
> @@ -1018,18 +1033,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) {
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] f2fs: add default mount options to remount
@ 2015-05-07 10:11 Yunlei He
2015-05-12 9:52 ` Chao Yu
0 siblings, 1 reply; 4+ messages in thread
From: Yunlei He @ 2015-05-07 10:11 UTC (permalink / raw)
To: linux-f2fs-devel, jaegeuk, cm224.lee
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>
---
fs/f2fs/super.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 138fa93..6d4b4ec 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -658,6 +658,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);
@@ -676,7 +692,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);
@@ -1018,18 +1034,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) {
--
1.9.1
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: add default mount options to remount
2015-05-07 10:11 Yunlei He
@ 2015-05-12 9:52 ` Chao Yu
0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2015-05-12 9:52 UTC (permalink / raw)
To: 'Yunlei He', linux-f2fs-devel, jaegeuk, cm224.lee
Hi Yunlei,
> -----Original Message-----
> From: Yunlei He [mailto:heyunlei@huawei.com]
> Sent: Thursday, May 07, 2015 6:12 PM
> To: linux-f2fs-devel@lists.sourceforge.net; jaegeuk@kernel.org; cm224.lee@samsung.com
> Cc: chao2.yu@samsung.com; Yunlei He
> Subject: [PATCH] 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.
Looks good to me.
>
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-12 9:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-07 9:20 [PATCH] f2fs: add default mount options to remount Yunlei He
2015-05-07 9:32 ` He YunLei
-- strict thread matches above, loose matches on Subject: below --
2015-05-07 10:11 Yunlei He
2015-05-12 9:52 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).