btrfs: get fs_info from device in btrfs_rm_dev_replace_free_srcdev
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 15:34:54 +0000 (16:34 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:48 +0000 (19:02 +0200)
We can read fs_info from the device and can drop it from the parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h

index eadf859934fe4c83eac9f59f22d333a41445bcee..55c15f31d00d80afadebe1e8008beb57f9225282 100644 (file)
@@ -696,7 +696,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
 
        /* replace the sysfs entry */
        btrfs_sysfs_rm_device_link(fs_info->fs_devices, src_device);
-       btrfs_rm_dev_replace_free_srcdev(fs_info, src_device);
+       btrfs_rm_dev_replace_free_srcdev(src_device);
 
        /* write back the superblocks */
        trans = btrfs_start_transaction(root, 0);
index c5bdd38179b6b889a52b65308f70293c794573f9..1c2a6e4b39da7205a17f8c31ae0971a8abeed821 100644 (file)
@@ -2258,9 +2258,9 @@ void btrfs_rm_dev_replace_remove_srcdev(struct btrfs_device *srcdev)
                fs_devices->open_devices--;
 }
 
-void btrfs_rm_dev_replace_free_srcdev(struct btrfs_fs_info *fs_info,
-                                     struct btrfs_device *srcdev)
+void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev)
 {
+       struct btrfs_fs_info *fs_info = srcdev->fs_info;
        struct btrfs_fs_devices *fs_devices = srcdev->fs_devices;
 
        if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &srcdev->dev_state)) {
index b3a89d767512819f4ab4998f39edcd1ff10cd059..b8a0e8d0672dc9aa6cb2c0a81e2079d6b017f0a1 100644 (file)
@@ -464,8 +464,7 @@ void btrfs_init_devices_late(struct btrfs_fs_info *fs_info);
 int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info);
 int btrfs_run_dev_stats(struct btrfs_trans_handle *trans);
 void btrfs_rm_dev_replace_remove_srcdev(struct btrfs_device *srcdev);
-void btrfs_rm_dev_replace_free_srcdev(struct btrfs_fs_info *fs_info,
-                                     struct btrfs_device *srcdev);
+void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev);
 void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev);
 void btrfs_scratch_superblocks(struct block_device *bdev, const char *device_path);
 int btrfs_is_parity_mirror(struct btrfs_fs_info *fs_info,