summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/sysfs.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-04-06 21:16:29 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2023-04-17 23:49:30 +0200
commit33560f8020c2bf12bb5b598a03fa0a708cab3283 (patch)
tree89cd853de39d0ae2474cd235ed1c8ba234cbbc87 /fs/f2fs/sysfs.c
parentf2fs: support iopoll method (diff)
downloadlinux-33560f8020c2bf12bb5b598a03fa0a708cab3283.tar.xz
linux-33560f8020c2bf12bb5b598a03fa0a708cab3283.zip
f2fs: remove bulk remove_proc_entry() and unnecessary kobject_del()
Convert to use remove_proc_subtree() and kill kobject_del() directly. kobject_put() actually covers kobject removal automatically, which is single stage removal. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/sysfs.c')
-rw-r--r--fs/f2fs/sysfs.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index aa77dd7c4555..8ea05340bad9 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -1462,25 +1462,14 @@ put_sb_kobj:
void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi)
{
- if (sbi->s_proc) {
-#ifdef CONFIG_F2FS_IOSTAT
- remove_proc_entry("iostat_info", sbi->s_proc);
-#endif
- remove_proc_entry("segment_info", sbi->s_proc);
- remove_proc_entry("segment_bits", sbi->s_proc);
- remove_proc_entry("victim_bits", sbi->s_proc);
- remove_proc_entry("discard_plist_info", sbi->s_proc);
- remove_proc_entry(sbi->sb->s_id, f2fs_proc_root);
- }
+ if (sbi->s_proc)
+ remove_proc_subtree(sbi->sb->s_id, f2fs_proc_root);
- kobject_del(&sbi->s_stat_kobj);
kobject_put(&sbi->s_stat_kobj);
wait_for_completion(&sbi->s_stat_kobj_unregister);
- kobject_del(&sbi->s_feature_list_kobj);
kobject_put(&sbi->s_feature_list_kobj);
wait_for_completion(&sbi->s_feature_list_kobj_unregister);
- kobject_del(&sbi->s_kobj);
kobject_put(&sbi->s_kobj);
wait_for_completion(&sbi->s_kobj_unregister);
}