Commit fa6d2ae5 authored by Anand Jain's avatar Anand Jain Committed by David Sterba

btrfs: rename local devices for fs_devices in btrfs_free_stale_devices(

Over the years we named %fs_devices and %devices to represent the
struct btrfs_fs_devices and the struct btrfs_device. So follow the same
scheme here too. No functional changes.
Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9c6d173e
...@@ -631,43 +631,42 @@ static void pending_bios_fn(struct btrfs_work *work) ...@@ -631,43 +631,42 @@ static void pending_bios_fn(struct btrfs_work *work)
* devices. * devices.
*/ */
static void btrfs_free_stale_devices(const char *path, static void btrfs_free_stale_devices(const char *path,
struct btrfs_device *skip_dev) struct btrfs_device *skip_device)
{ {
struct btrfs_fs_devices *fs_devs, *tmp_fs_devs; struct btrfs_fs_devices *fs_devices, *tmp_fs_devices;
struct btrfs_device *dev, *tmp_dev; struct btrfs_device *device, *tmp_device;
list_for_each_entry_safe(fs_devs, tmp_fs_devs, &fs_uuids, fs_list) { list_for_each_entry_safe(fs_devices, tmp_fs_devices, &fs_uuids, fs_list) {
if (fs_devices->opened)
if (fs_devs->opened)
continue; continue;
list_for_each_entry_safe(dev, tmp_dev, list_for_each_entry_safe(device, tmp_device,
&fs_devs->devices, dev_list) { &fs_devices->devices, dev_list) {
int not_found = 0; int not_found = 0;
if (skip_dev && skip_dev == dev) if (skip_device && skip_device == device)
continue; continue;
if (path && !dev->name) if (path && !device->name)
continue; continue;
rcu_read_lock(); rcu_read_lock();
if (path) if (path)
not_found = strcmp(rcu_str_deref(dev->name), not_found = strcmp(rcu_str_deref(device->name),
path); path);
rcu_read_unlock(); rcu_read_unlock();
if (not_found) if (not_found)
continue; continue;
/* delete the stale device */ /* delete the stale device */
if (fs_devs->num_devices == 1) { if (fs_devices->num_devices == 1) {
btrfs_sysfs_remove_fsid(fs_devs); btrfs_sysfs_remove_fsid(fs_devices);
list_del(&fs_devs->fs_list); list_del(&fs_devices->fs_list);
free_fs_devices(fs_devs); free_fs_devices(fs_devices);
break; break;
} else { } else {
fs_devs->num_devices--; fs_devices->num_devices--;
list_del(&dev->dev_list); list_del(&device->dev_list);
btrfs_free_device(dev); btrfs_free_device(device);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment