aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2016-06-21 20:16:08 -0400
committerDavid Sterba <dsterba@suse.com>2016-12-06 10:06:57 -0500
commit5112febbc772830f8b1a981570d75c8cb4b93a36 (patch)
tree06d9e9b1907835aa5eb71d0d22d020ee82952495
parent6bccf3ab1e1f0913268bfcd1c09cadb1f4f2857d (diff)
btrfs: btrfs_init_new_device should use fs_info->dev_root
btrfs_init_new_device only uses the root passed in via the ioctl to start the transaction. Nothing else that happens is related to whatever root the user used to initiate the ioctl. We can drop the root requirement and just use fs_info->dev_root instead. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/ioctl.c2
-rw-r--r--fs/btrfs/volumes.c3
-rw-r--r--fs/btrfs/volumes.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 67c37fdd00dc..5b21a9bcfe81 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2672,7 +2672,7 @@ static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg)
2672 } 2672 }
2673 2673
2674 vol_args->name[BTRFS_PATH_NAME_MAX] = '\0'; 2674 vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
2675 ret = btrfs_init_new_device(root, vol_args->name); 2675 ret = btrfs_init_new_device(root->fs_info, vol_args->name);
2676 2676
2677 if (!ret) 2677 if (!ret)
2678 btrfs_info(root->fs_info, "disk added %s",vol_args->name); 2678 btrfs_info(root->fs_info, "disk added %s",vol_args->name);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 99a81369e43d..1622dc7eab91 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2310,8 +2310,9 @@ error:
2310 return ret; 2310 return ret;
2311} 2311}
2312 2312
2313int btrfs_init_new_device(struct btrfs_root *root, char *device_path) 2313int btrfs_init_new_device(struct btrfs_fs_info *fs_info, char *device_path)
2314{ 2314{
2315 struct btrfs_root *root = fs_info->dev_root;
2315 struct request_queue *q; 2316 struct request_queue *q;
2316 struct btrfs_trans_handle *trans; 2317 struct btrfs_trans_handle *trans;
2317 struct btrfs_device *device; 2318 struct btrfs_device *device;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 471a619787e8..0c8e77bfa8f6 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -439,7 +439,7 @@ int btrfs_grow_device(struct btrfs_trans_handle *trans,
439struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, 439struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid,
440 u8 *uuid, u8 *fsid); 440 u8 *uuid, u8 *fsid);
441int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); 441int btrfs_shrink_device(struct btrfs_device *device, u64 new_size);
442int btrfs_init_new_device(struct btrfs_root *root, char *path); 442int btrfs_init_new_device(struct btrfs_fs_info *fs_info, char *path);
443int btrfs_init_dev_replace_tgtdev(struct btrfs_root *root, char *device_path, 443int btrfs_init_dev_replace_tgtdev(struct btrfs_root *root, char *device_path,
444 struct btrfs_device *srcdev, 444 struct btrfs_device *srcdev,
445 struct btrfs_device **device_out); 445 struct btrfs_device **device_out);