Commit 6047de54 authored by Yangtao Li's avatar Yangtao Li Committed by Jaegeuk Kim

f2fs: add barrier mount option

This patch adds a mount option, barrier, in f2fs.
The barrier option is the opposite of nobarrier.
If this option is set, cache_flush commands are allowed to be issued.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent b5f1a218
...@@ -154,6 +154,8 @@ nobarrier This option can be used if underlying storage guarantees ...@@ -154,6 +154,8 @@ nobarrier This option can be used if underlying storage guarantees
If this option is set, no cache_flush commands are issued If this option is set, no cache_flush commands are issued
but f2fs still guarantees the write ordering of all the but f2fs still guarantees the write ordering of all the
data writes. data writes.
barrier If this option is set, cache_flush commands are allowed to be
issued.
fastboot This option is used when a system wants to reduce mount fastboot This option is used when a system wants to reduce mount
time as much as possible, even though normal performance time as much as possible, even though normal performance
can be sacrificed. can be sacrificed.
......
...@@ -111,6 +111,7 @@ enum { ...@@ -111,6 +111,7 @@ enum {
Opt_noinline_dentry, Opt_noinline_dentry,
Opt_flush_merge, Opt_flush_merge,
Opt_noflush_merge, Opt_noflush_merge,
Opt_barrier,
Opt_nobarrier, Opt_nobarrier,
Opt_fastboot, Opt_fastboot,
Opt_extent_cache, Opt_extent_cache,
...@@ -187,6 +188,7 @@ static match_table_t f2fs_tokens = { ...@@ -187,6 +188,7 @@ static match_table_t f2fs_tokens = {
{Opt_noinline_dentry, "noinline_dentry"}, {Opt_noinline_dentry, "noinline_dentry"},
{Opt_flush_merge, "flush_merge"}, {Opt_flush_merge, "flush_merge"},
{Opt_noflush_merge, "noflush_merge"}, {Opt_noflush_merge, "noflush_merge"},
{Opt_barrier, "barrier"},
{Opt_nobarrier, "nobarrier"}, {Opt_nobarrier, "nobarrier"},
{Opt_fastboot, "fastboot"}, {Opt_fastboot, "fastboot"},
{Opt_extent_cache, "extent_cache"}, {Opt_extent_cache, "extent_cache"},
...@@ -807,6 +809,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) ...@@ -807,6 +809,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
case Opt_nobarrier: case Opt_nobarrier:
set_opt(sbi, NOBARRIER); set_opt(sbi, NOBARRIER);
break; break;
case Opt_barrier:
clear_opt(sbi, NOBARRIER);
break;
case Opt_fastboot: case Opt_fastboot:
set_opt(sbi, FASTBOOT); set_opt(sbi, FASTBOOT);
break; break;
...@@ -1940,6 +1945,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) ...@@ -1940,6 +1945,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
seq_puts(seq, ",flush_merge"); seq_puts(seq, ",flush_merge");
if (test_opt(sbi, NOBARRIER)) if (test_opt(sbi, NOBARRIER))
seq_puts(seq, ",nobarrier"); seq_puts(seq, ",nobarrier");
else
seq_puts(seq, ",barrier");
if (test_opt(sbi, FASTBOOT)) if (test_opt(sbi, FASTBOOT))
seq_puts(seq, ",fastboot"); seq_puts(seq, ",fastboot");
if (test_opt(sbi, EXTENT_CACHE)) if (test_opt(sbi, EXTENT_CACHE))
......
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