btrfs_sysfs_remove_fsid() when called with NULL argument then it shall
cleanup all kobjects belonging to btrfs. However no function is using
btrfs_sysfs_remove_fsid() with NULL argument.
This happened in the commit 2e3e1281 (Btrfs: sysfs: provide framework to
remove all fsid sysfs kobject) which is a helper commit to the proposed
patch [1], which proposed to show /sys/fs/btrfs/UUID in the unmounted but
scanned context as well, so that there is a way to know fsid and devices which
are scanned. As of now there isn't anyway that the user/script can figure
out all the scanned fsids/devices in the system, but its been long time,
probably there isn't such a need at all. For developers to debug the
struct fs_devices list there is procfs boiler-plate patch in the mailing
list which comes handy.
[1] [PATCH] btrfs: Introduce device pool sysfs attributes
Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
---
fs/btrfs/sysfs.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 2ea27c2d9ef1..34bf080ea530 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -1087,20 +1087,9 @@ static void __btrfs_sysfs_remove_fsid(struct btrfs_fs_info *fs_info)
}
}
-/* when fs_info is NULL it will remove all fs_info::fsid kobject */
void btrfs_sysfs_remove_fsid(struct btrfs_fs_info *fs_info)
{
- struct list_head *fs_uuids = btrfs_get_fs_uuids();
- struct btrfs_fs_devices *fs_devices;
-
- if (fs_info) {
- __btrfs_sysfs_remove_fsid(fs_info);
- return;
- }
-
- list_for_each_entry(fs_devices, fs_uuids, fs_list) {
- __btrfs_sysfs_remove_fsid(fs_devices->fs_info);
- }
+ __btrfs_sysfs_remove_fsid(fs_info);
}
/*
--
2.23.0