Skip to content

Commit 97c1794

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: enable inline_dentry by default and add noinline_dentry option
Make inline_dentry as default mount option to improve space usage and IO performance in scenario of numerous small directory. It adds noinline_dentry mount option, instead. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 5d2b42e commit 97c1794

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Documentation/filesystems/f2fs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ inline_dentry Enable the inline dir feature: data in new created
131131
directory entries can be written into inode block. The
132132
space of inode block which is used to store inline
133133
dentries is limited to ~3.4k.
134+
noinline_dentry Diable the inline dentry feature.
134135
flush_merge Merge concurrent cache_flush commands as much as possible
135136
to eliminate redundant command issues. If the underlying
136137
device handles the cache_flush command relatively slowly,

fs/f2fs/super.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ enum {
8787
Opt_inline_xattr,
8888
Opt_inline_data,
8989
Opt_inline_dentry,
90+
Opt_noinline_dentry,
9091
Opt_flush_merge,
9192
Opt_noflush_merge,
9293
Opt_nobarrier,
@@ -118,6 +119,7 @@ static match_table_t f2fs_tokens = {
118119
{Opt_inline_xattr, "inline_xattr"},
119120
{Opt_inline_data, "inline_data"},
120121
{Opt_inline_dentry, "inline_dentry"},
122+
{Opt_noinline_dentry, "noinline_dentry"},
121123
{Opt_flush_merge, "flush_merge"},
122124
{Opt_noflush_merge, "noflush_merge"},
123125
{Opt_nobarrier, "nobarrier"},
@@ -488,6 +490,9 @@ static int parse_options(struct super_block *sb, char *options)
488490
case Opt_inline_dentry:
489491
set_opt(sbi, INLINE_DENTRY);
490492
break;
493+
case Opt_noinline_dentry:
494+
clear_opt(sbi, INLINE_DENTRY);
495+
break;
491496
case Opt_flush_merge:
492497
set_opt(sbi, FLUSH_MERGE);
493498
break;
@@ -878,6 +883,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
878883
seq_puts(seq, ",noinline_data");
879884
if (test_opt(sbi, INLINE_DENTRY))
880885
seq_puts(seq, ",inline_dentry");
886+
else
887+
seq_puts(seq, ",noinline_dentry");
881888
if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE))
882889
seq_puts(seq, ",flush_merge");
883890
if (test_opt(sbi, NOBARRIER))
@@ -975,6 +982,7 @@ static void default_options(struct f2fs_sb_info *sbi)
975982

976983
set_opt(sbi, BG_GC);
977984
set_opt(sbi, INLINE_DATA);
985+
set_opt(sbi, INLINE_DENTRY);
978986
set_opt(sbi, EXTENT_CACHE);
979987
sbi->sb->s_flags |= MS_LAZYTIME;
980988
set_opt(sbi, FLUSH_MERGE);

0 commit comments

Comments
 (0)