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>
This commit is contained in:

committed by
David Sterba

parent
6c05040702
commit
a27a94c2b0
@@ -409,10 +409,10 @@ int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
|
||||
struct btrfs_device *tgt_device = NULL;
|
||||
struct btrfs_device *src_device = NULL;
|
||||
|
||||
ret = btrfs_find_device_by_devspec(fs_info, srcdevid,
|
||||
srcdev_name, &src_device);
|
||||
if (ret)
|
||||
return ret;
|
||||
src_device = btrfs_find_device_by_devspec(fs_info, srcdevid,
|
||||
srcdev_name);
|
||||
if (IS_ERR(src_device))
|
||||
return PTR_ERR(src_device);
|
||||
|
||||
ret = btrfs_init_dev_replace_tgtdev(fs_info, tgtdev_name,
|
||||
src_device, &tgt_device);
|
||||
|
Reference in New Issue
Block a user