Skip to content

Commit 3fa5d23

Browse files
OjaswinMtytso
authored andcommitted
ext4: reflect mb_optimize_scan value in options file
Add support to display the mb_optimize_scan value in /proc/fs/ext4/<dev>/options file. The option is only displayed when the value is non default. Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Link: https://lore.kernel.org/r/20220704054603.21462-1-ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent b24e77e commit 3fa5d23

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/ext4/super.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,6 +3011,15 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
30113011
} else if (test_opt2(sb, DAX_INODE)) {
30123012
SEQ_OPTS_PUTS("dax=inode");
30133013
}
3014+
3015+
if (sbi->s_groups_count >= MB_DEFAULT_LINEAR_SCAN_THRESHOLD &&
3016+
!test_opt2(sb, MB_OPTIMIZE_SCAN)) {
3017+
SEQ_OPTS_PUTS("mb_optimize_scan=0");
3018+
} else if (sbi->s_groups_count < MB_DEFAULT_LINEAR_SCAN_THRESHOLD &&
3019+
test_opt2(sb, MB_OPTIMIZE_SCAN)) {
3020+
SEQ_OPTS_PUTS("mb_optimize_scan=1");
3021+
}
3022+
30143023
ext4_show_quota_options(seq, sb);
30153024
return 0;
30163025
}

0 commit comments

Comments
 (0)