aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dev-replace.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-09-03 05:46:14 -0400
committerDavid Sterba <dsterba@suse.com>2018-10-15 11:23:30 -0400
commita27a94c2b0c727517c17cf2ca3a9f7291caadfbc (patch)
tree4187cec66f66085176afed51436c29f71404b4b9 /fs/btrfs/dev-replace.c
parent6c05040702e7793e8ee63bb8384ac2f9235c926e (diff)
btrfs: Make btrfs_find_device_by_devspec return btrfs_device directly
Instead of returning an error value and using one of the parameters for returning the actual object we are interested in just refactor the function to directly return btrfs_device *. Also bubble up the error handling for the special BTRFS_ERROR_DEV_MISSING_NOT_FOUND value into btrfs_rm_device. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index dec01970d8c5..4e2b67d06305 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -409,10 +409,10 @@ int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
409 struct btrfs_device *tgt_device = NULL; 409 struct btrfs_device *tgt_device = NULL;
410 struct btrfs_device *src_device = NULL; 410 struct btrfs_device *src_device = NULL;
411 411
412 ret = btrfs_find_device_by_devspec(fs_info, srcdevid, 412 src_device = btrfs_find_device_by_devspec(fs_info, srcdevid,
413 srcdev_name, &src_device); 413 srcdev_name);
414 if (ret) 414 if (IS_ERR(src_device))
415 return ret; 415 return PTR_ERR(src_device);
416 416
417 ret = btrfs_init_dev_replace_tgtdev(fs_info, tgtdev_name, 417 ret = btrfs_init_dev_replace_tgtdev(fs_info, tgtdev_name,
418 src_device, &tgt_device); 418 src_device, &tgt_device);