]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Btrfs: sysfs btrfs_kobj_rm_device() pass fs_devices instead of fs_info
authorAnand Jain <anand.jain@oracle.com>
Mon, 9 Mar 2015 22:38:34 +0000 (06:38 +0800)
committerDavid Sterba <dsterba@suse.cz>
Wed, 27 May 2015 10:27:21 +0000 (12:27 +0200)
since btrfs_kobj_rm_device() does nothing with fs_info

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/dev-replace.c
fs/btrfs/sysfs.c
fs/btrfs/sysfs.h
fs/btrfs/volumes.c

index 72c03adb6562c197ae2190ded894e20628c3f00d..f982ef303f1c38529f72fb7c915f184de74c9379 100644 (file)
@@ -583,7 +583,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
        mutex_unlock(&uuid_mutex);
 
        /* replace the sysfs entry */
-       btrfs_kobj_rm_device(fs_info, src_device);
+       btrfs_kobj_rm_device(fs_info->fs_devices, src_device);
        btrfs_kobj_add_device(fs_info->fs_devices, tgt_device);
        btrfs_rm_dev_replace_free_srcdev(fs_info, src_device);
 
index 82e18f53295838b4031691c72f771ab32010b92a..0a5d1eebc27eaaa4f2d198bd1c81d586180456bc 100644 (file)
@@ -555,7 +555,7 @@ void btrfs_sysfs_remove_one(struct btrfs_fs_info *fs_info)
        addrm_unknown_feature_attrs(fs_info, false);
        sysfs_remove_group(&fs_info->fs_devices->super_kobj, &btrfs_feature_attr_group);
        sysfs_remove_files(&fs_info->fs_devices->super_kobj, btrfs_attrs);
-       btrfs_kobj_rm_device(fs_info, NULL);
+       btrfs_kobj_rm_device(fs_info->fs_devices, NULL);
        btrfs_sysfs_remove_fsid(fs_info->fs_devices);
 }
 
@@ -636,20 +636,20 @@ static void init_feature_attrs(void)
 
 /* when one_device is NULL, it removes all device links */
 
-int btrfs_kobj_rm_device(struct btrfs_fs_info *fs_info,
+int btrfs_kobj_rm_device(struct btrfs_fs_devices *fs_devices,
                struct btrfs_device *one_device)
 {
        struct hd_struct *disk;
        struct kobject *disk_kobj;
 
-       if (!fs_info->fs_devices->device_dir_kobj)
+       if (!fs_devices->device_dir_kobj)
                return -EINVAL;
 
        if (one_device && one_device->bdev) {
                disk = one_device->bdev->bd_part;
                disk_kobj = &part_to_dev(disk)->kobj;
 
-               sysfs_remove_link(fs_info->fs_devices->device_dir_kobj,
+               sysfs_remove_link(fs_devices->device_dir_kobj,
                                                disk_kobj->name);
        }
 
@@ -657,13 +657,13 @@ int btrfs_kobj_rm_device(struct btrfs_fs_info *fs_info,
                return 0;
 
        list_for_each_entry(one_device,
-                       &fs_info->fs_devices->devices, dev_list) {
+                       &fs_devices->devices, dev_list) {
                if (!one_device->bdev)
                        continue;
                disk = one_device->bdev->bd_part;
                disk_kobj = &part_to_dev(disk)->kobj;
 
-               sysfs_remove_link(fs_info->fs_devices->device_dir_kobj,
+               sysfs_remove_link(fs_devices->device_dir_kobj,
                                                disk_kobj->name);
        }
 
index f1d7c7604f6fdadb9e6ecfcab2507f6786c4278f..808d12ac4a5a1cc12226bda9cc3e2d35de4dad04 100644 (file)
@@ -84,6 +84,6 @@ extern struct kobj_type space_info_ktype;
 extern struct kobj_type btrfs_raid_ktype;
 int btrfs_kobj_add_device(struct btrfs_fs_devices *fs_devices,
                struct btrfs_device *one_device);
-int btrfs_kobj_rm_device(struct btrfs_fs_info *fs_info,
+int btrfs_kobj_rm_device(struct btrfs_fs_devices *fs_devices,
                 struct btrfs_device *one_device);
 #endif /* _BTRFS_SYSFS_H_ */
index d68d3944af4ba64ee566b1910d037dc047609a07..b5cc129bfa4b26f2cb433cc7829a00ca528166a1 100644 (file)
@@ -1710,7 +1710,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
        if (device->bdev) {
                device->fs_devices->open_devices--;
                /* remove sysfs entry */
-               btrfs_kobj_rm_device(root->fs_info, device);
+               btrfs_kobj_rm_device(root->fs_info->fs_devices, device);
        }
 
        call_rcu(&device->rcu, free_device);
@@ -2294,7 +2294,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
 error_trans:
        btrfs_end_transaction(trans, root);
        rcu_string_free(device->name);
-       btrfs_kobj_rm_device(root->fs_info, device);
+       btrfs_kobj_rm_device(root->fs_info->fs_devices, device);
        kfree(device);
 error:
        blkdev_put(bdev, FMODE_EXCL);