[PATCH 10/15] btrfs: volume, btrfs_free_stale_devices() cleanup unreachable code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
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(-)

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);
 		}
-- 
2.23.0




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux