diff mbox series

[15/15] btrfs: sysfs, unexport btrfs_sysfs_remove_mounted()

Message ID 20191118084656.3089-16-anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs: sysfs, cleanups | expand

Commit Message

Anand Jain Nov. 18, 2019, 8:46 a.m. UTC
btrfs_sysfs_remove_mounted() is always called along with
btrfs_sysfs_remove_fsid(), call btrfs_sysfs_remove_mounted() in
btrfs_sysfs_remove_fsid() as well. And unexport
btrfs_sysfs_remove_mounted().

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/disk-io.c | 2 --
 fs/btrfs/sysfs.c   | 4 +++-
 fs/btrfs/sysfs.h   | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 8f6a08bef490..28db7bbb437e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3299,7 +3299,6 @@  int __cold open_ctree(struct super_block *sb,
 	filemap_write_and_wait(fs_info->btree_inode->i_mapping);
 
 fail_sysfs:
-	btrfs_sysfs_remove_mounted(fs_info);
 	btrfs_sysfs_remove_fsid(fs_info);
 
 fail_block_groups:
@@ -3997,7 +3996,6 @@  void __cold close_ctree(struct btrfs_fs_info *fs_info)
 		btrfs_info(fs_info, "at unmount dio bytes count %lld",
 			   percpu_counter_sum(&fs_info->dio_bytes));
 
-	btrfs_sysfs_remove_mounted(fs_info);
 	btrfs_sysfs_remove_fsid(fs_info);
 
 	btrfs_free_fs_roots(fs_info);
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 74210ef59641..468a42c442cf 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -983,7 +983,7 @@  void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action)
 			&disk_to_dev(bdev->bd_disk)->kobj);
 }
 
-void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info)
+static void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info)
 {
 	btrfs_reset_fs_info_ptr(fs_info);
 
@@ -1074,6 +1074,8 @@  void btrfs_sysfs_remove_fsid(struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
 
+	btrfs_sysfs_remove_mounted(fs_info);
+
 	if (fs_devices->devices_dir_kobj) {
 		kobject_del(fs_devices->devices_dir_kobj);
 		kobject_put(fs_devices->devices_dir_kobj);
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index a977fe3bec64..2b01b3af5e50 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -28,7 +28,6 @@  void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action)
 
 int __init btrfs_init_sysfs(void);
 void __cold btrfs_exit_sysfs(void);
-void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
 void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache);
 int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
 				    struct btrfs_space_info *space_info);