OSDN Git Service

btrfs: Make btrfs_find_device_by_devspec return btrfs_device directly
authorNikolay Borisov <nborisov@suse.com>
Mon, 3 Sep 2018 09:46:14 +0000 (12:46 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:30 +0000 (17:23 +0200)
commita27a94c2b0c727517c17cf2ca3a9f7291caadfbc
tree4187cec66f66085176afed51436c29f71404b4b9
parent6c05040702e7793e8ee63bb8384ac2f9235c926e
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>
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h