btrfs: get fs_info from trans in btrfs_run_dev_replace
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 15:51:44 +0000 (16:51 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:43 +0000 (19:02 +0200)
We can read fs_info from the transaction and can drop it from the
parameters.

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

index dba43ad..eadf859 100644 (file)
@@ -273,9 +273,9 @@ error:
  * called from commit_transaction. Writes changed device replace state to
  * disk.
  */
-int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
-                         struct btrfs_fs_info *fs_info)
+int btrfs_run_dev_replace(struct btrfs_trans_handle *trans)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        int ret;
        struct btrfs_root *dev_root = fs_info->dev_root;
        struct btrfs_path *path;
index 4aa40ba..78c5d8f 100644 (file)
@@ -9,8 +9,7 @@
 struct btrfs_ioctl_dev_replace_args;
 
 int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info);
-int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
-                         struct btrfs_fs_info *fs_info);
+int btrfs_run_dev_replace(struct btrfs_trans_handle *trans);
 int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info,
                            struct btrfs_ioctl_dev_replace_args *args);
 void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
index 1e3d8d9..722ebdc 100644 (file)
@@ -1097,7 +1097,7 @@ static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans)
        ret = btrfs_run_dev_stats(trans);
        if (ret)
                return ret;
-       ret = btrfs_run_dev_replace(trans, fs_info);
+       ret = btrfs_run_dev_replace(trans);
        if (ret)
                return ret;
        ret = btrfs_run_qgroups(trans);