فهرست منبع

f2fs: add noextent_cache mount option

This patch adds noextent_cache mount option.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim 10 سال پیش
والد
کامیت
7daaea256d
2فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 3 1
      Documentation/filesystems/f2fs.txt
  2. 7 0
      fs/f2fs/super.c

+ 3 - 1
Documentation/filesystems/f2fs.txt

@@ -143,7 +143,9 @@ fastboot               This option is used when a system wants to reduce mount
 extent_cache           Enable an extent cache based on rb-tree, it can cache
 extent_cache           Enable an extent cache based on rb-tree, it can cache
                        as many as extent which map between contiguous logical
                        as many as extent which map between contiguous logical
                        address and physical address per inode, resulting in
                        address and physical address per inode, resulting in
-                       increasing the cache hit ratio.
+                       increasing the cache hit ratio. Set by default.
+noextent_cache         Diable an extent cache based on rb-tree explicitly, see
+                       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.
 
 

+ 7 - 0
fs/f2fs/super.c

@@ -65,6 +65,7 @@ enum {
 	Opt_nobarrier,
 	Opt_nobarrier,
 	Opt_fastboot,
 	Opt_fastboot,
 	Opt_extent_cache,
 	Opt_extent_cache,
+	Opt_noextent_cache,
 	Opt_noinline_data,
 	Opt_noinline_data,
 	Opt_err,
 	Opt_err,
 };
 };
@@ -88,6 +89,7 @@ static match_table_t f2fs_tokens = {
 	{Opt_nobarrier, "nobarrier"},
 	{Opt_nobarrier, "nobarrier"},
 	{Opt_fastboot, "fastboot"},
 	{Opt_fastboot, "fastboot"},
 	{Opt_extent_cache, "extent_cache"},
 	{Opt_extent_cache, "extent_cache"},
+	{Opt_noextent_cache, "noextent_cache"},
 	{Opt_noinline_data, "noinline_data"},
 	{Opt_noinline_data, "noinline_data"},
 	{Opt_err, NULL},
 	{Opt_err, NULL},
 };
 };
@@ -389,6 +391,9 @@ static int parse_options(struct super_block *sb, char *options)
 		case Opt_extent_cache:
 		case Opt_extent_cache:
 			set_opt(sbi, EXTENT_CACHE);
 			set_opt(sbi, EXTENT_CACHE);
 			break;
 			break;
+		case Opt_noextent_cache:
+			clear_opt(sbi, EXTENT_CACHE);
+			break;
 		case Opt_noinline_data:
 		case Opt_noinline_data:
 			clear_opt(sbi, INLINE_DATA);
 			clear_opt(sbi, INLINE_DATA);
 			break;
 			break;
@@ -662,6 +667,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 		seq_puts(seq, ",fastboot");
 		seq_puts(seq, ",fastboot");
 	if (test_opt(sbi, EXTENT_CACHE))
 	if (test_opt(sbi, EXTENT_CACHE))
 		seq_puts(seq, ",extent_cache");
 		seq_puts(seq, ",extent_cache");
+	else
+		seq_puts(seq, ",noextent_cache");
 	seq_printf(seq, ",active_logs=%u", sbi->active_logs);
 	seq_printf(seq, ",active_logs=%u", sbi->active_logs);
 
 
 	return 0;
 	return 0;