mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
staging: erofs: code cleanup for erofs_show_options()
Add new helper erofs_get_fault_rate() to get fault rate instead of directly getting it from sbi, so we can remove the macro check surrounding it. Signed-off-by: Chengguang Xu <[email protected]> Reviewed-by: Chao Yu <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
01e4ae4b68
commit
2ab3dd84c0
1 file changed
+11
-3
@@ -165,6 +165,11 @@ static int erofs_build_fault_attr(struct erofs_sb_info *sbi,
|
||||
set_opt(sbi, FAULT_INJECTION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int erofs_get_fault_rate(struct erofs_sb_info *sbi)
|
||||
{
|
||||
return sbi->fault_info.inject_rate;
|
||||
}
|
||||
#else
|
||||
static int erofs_build_fault_attr(struct erofs_sb_info *sbi,
|
||||
substring_t *args)
|
||||
@@ -172,6 +177,11 @@ static int erofs_build_fault_attr(struct erofs_sb_info *sbi,
|
||||
infoln("fault_injection options not supported");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int erofs_get_fault_rate(struct erofs_sb_info *sbi)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void default_options(struct erofs_sb_info *sbi)
|
||||
@@ -631,11 +641,9 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)
|
||||
else
|
||||
seq_puts(seq, ",noacl");
|
||||
#endif
|
||||
#ifdef CONFIG_EROFS_FAULT_INJECTION
|
||||
if (test_opt(sbi, FAULT_INJECTION))
|
||||
seq_printf(seq, ",fault_injection=%u",
|
||||
sbi->fault_info.inject_rate);
|
||||
#endif
|
||||
erofs_get_fault_rate(sbi));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user