[10/15] btrfs: volume, btrfs_free_stale_devices() cleanup unreachable code
diff mbox series

Message ID 20191118084656.3089-11-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs: sysfs, cleanups
Related show

Commit Message

Anand Jain Nov. 18, 2019, 8:46 a.m. UTC
fs_devices::num_devices can be zero only in unmounted context, and we
don't have any fsid specific kobjects in the unmoutend context. So no
need to call btrfs_sysfs_remove_fsid() in btrfs_free_stale_devices().

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
We implemented this in preparation to provide the fsid/device attributes
for the devices in unmoutned context as was proposed here [1].

[1] [PATCH] btrfs: Introduce device pool sysfs attributes

 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 40d77b5846dc..fe135b5a8a03 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -585,7 +585,7 @@  static int btrfs_free_stale_devices(const char *path,
 		mutex_unlock(&fs_devices->device_list_mutex);
 
 		if (fs_devices->num_devices == 0) {
-			btrfs_sysfs_remove_fsid(fs_devices);
+			/* If its here fsid is unmounted */
 			list_del(&fs_devices->fs_list);
 			free_fs_devices(fs_devices);
 		}