Commit 343f40f0 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: introduce new option for controlling data flush

Add a new option 'data_flush' to enable data flush functionality.
Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent c227f912
...@@ -149,6 +149,8 @@ noextent_cache Disable an extent cache based on rb-tree explicitly, see ...@@ -149,6 +149,8 @@ noextent_cache Disable an extent cache based on rb-tree explicitly, see
the above extent_cache mount option. the above extent_cache mount option.
noinline_data Disable the inline data feature, inline data feature is noinline_data Disable the inline data feature, inline data feature is
enabled by default. enabled by default.
data_flush Enable data flushing before checkpoint in order to
persist data of regular and symlink.
================================================================================ ================================================================================
DEBUGFS ENTRIES DEBUGFS ENTRIES
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#define F2FS_MOUNT_FASTBOOT 0x00001000 #define F2FS_MOUNT_FASTBOOT 0x00001000
#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 #define F2FS_MOUNT_EXTENT_CACHE 0x00002000
#define F2FS_MOUNT_FORCE_FG_GC 0x00004000 #define F2FS_MOUNT_FORCE_FG_GC 0x00004000
#define F2FS_MOUNT_DATA_FLUSH 0x00008000
#define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)
#define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) #define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)
......
...@@ -67,6 +67,7 @@ enum { ...@@ -67,6 +67,7 @@ enum {
Opt_extent_cache, Opt_extent_cache,
Opt_noextent_cache, Opt_noextent_cache,
Opt_noinline_data, Opt_noinline_data,
Opt_data_flush,
Opt_err, Opt_err,
}; };
...@@ -91,6 +92,7 @@ static match_table_t f2fs_tokens = { ...@@ -91,6 +92,7 @@ static match_table_t f2fs_tokens = {
{Opt_extent_cache, "extent_cache"}, {Opt_extent_cache, "extent_cache"},
{Opt_noextent_cache, "noextent_cache"}, {Opt_noextent_cache, "noextent_cache"},
{Opt_noinline_data, "noinline_data"}, {Opt_noinline_data, "noinline_data"},
{Opt_data_flush, "data_flush"},
{Opt_err, NULL}, {Opt_err, NULL},
}; };
...@@ -406,6 +408,9 @@ static int parse_options(struct super_block *sb, char *options) ...@@ -406,6 +408,9 @@ static int parse_options(struct super_block *sb, char *options)
case Opt_noinline_data: case Opt_noinline_data:
clear_opt(sbi, INLINE_DATA); clear_opt(sbi, INLINE_DATA);
break; break;
case Opt_data_flush:
set_opt(sbi, DATA_FLUSH);
break;
default: default:
f2fs_msg(sb, KERN_ERR, f2fs_msg(sb, KERN_ERR,
"Unrecognized mount option \"%s\" or missing value", "Unrecognized mount option \"%s\" or missing value",
...@@ -687,6 +692,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) ...@@ -687,6 +692,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
seq_puts(seq, ",extent_cache"); seq_puts(seq, ",extent_cache");
else else
seq_puts(seq, ",noextent_cache"); seq_puts(seq, ",noextent_cache");
if (test_opt(sbi, DATA_FLUSH))
seq_puts(seq, ",data_flush");
seq_printf(seq, ",active_logs=%u", sbi->active_logs); seq_printf(seq, ",active_logs=%u", sbi->active_logs);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment