diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-22 18:54:24 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 16:06:59 +0100 |
commit | 2ff7e61e0d30ff166a2ae94575526bffe11fd1a8 (patch) | |
tree | a2b8aba1d10c010cc247f3e0866dcbd627e852f3 /fs/btrfs/dev-replace.c | |
parent | afdb571890615059ed4f0625209b379aff6cb08d (diff) | |
download | op-kernel-dev-2ff7e61e0d30ff166a2ae94575526bffe11fd1a8.zip op-kernel-dev-2ff7e61e0d30ff166a2ae94575526bffe11fd1a8.tar.gz |
btrfs: take an fs_info directly when the root is not used otherwise
There are loads of functions in btrfs that accept a root parameter
but only use it to obtain an fs_info pointer. Let's convert those to
just accept an fs_info pointer directly.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r-- | fs/btrfs/dev-replace.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index c6558ed..1b54588 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -304,11 +304,11 @@ void btrfs_after_dev_replace_commit(struct btrfs_fs_info *fs_info) dev_replace->cursor_left_last_write_of_item; } -int btrfs_dev_replace_start(struct btrfs_root *root, char *tgtdev_name, +int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info, char *tgtdev_name, u64 srcdevid, char *srcdev_name, int read_src) { + struct btrfs_root *root = fs_info->dev_root; struct btrfs_trans_handle *trans; - struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; int ret; struct btrfs_device *tgt_device = NULL; @@ -316,14 +316,14 @@ int btrfs_dev_replace_start(struct btrfs_root *root, char *tgtdev_name, /* the disk copy procedure reuses the scrub code */ mutex_lock(&fs_info->volume_mutex); - ret = btrfs_find_device_by_devspec(root, srcdevid, + ret = btrfs_find_device_by_devspec(fs_info, srcdevid, srcdev_name, &src_device); if (ret) { mutex_unlock(&fs_info->volume_mutex); return ret; } - ret = btrfs_init_dev_replace_tgtdev(root, tgtdev_name, + ret = btrfs_init_dev_replace_tgtdev(fs_info, tgtdev_name, src_device, &tgt_device); mutex_unlock(&fs_info->volume_mutex); if (ret) @@ -422,7 +422,7 @@ leave: return ret; } -int btrfs_dev_replace_by_ioctl(struct btrfs_root *root, +int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info, struct btrfs_ioctl_dev_replace_args *args) { int ret; @@ -439,7 +439,7 @@ int btrfs_dev_replace_by_ioctl(struct btrfs_root *root, args->start.tgtdev_name[0] == '\0') return -EINVAL; - ret = btrfs_dev_replace_start(root, args->start.tgtdev_name, + ret = btrfs_dev_replace_start(fs_info, args->start.tgtdev_name, args->start.srcdevid, args->start.srcdev_name, args->start.cont_reading_from_srcdev_mode); |