btrfs: Make btrfs_find_device_missing_or_by_path return directly a device
authorNikolay Borisov <nborisov@suse.com>
Mon, 3 Sep 2018 09:46:13 +0000 (12:46 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:29 +0000 (17:23 +0200)
commit6c05040702e7793e8ee63bb8384ac2f9235c926e
tree800359b874392851d3b6549b7a60739097d3ac2b
parentb444ad46b2db4f8c682c99ffb994e532a4713012
btrfs: Make btrfs_find_device_missing_or_by_path return directly a device

This function returns a numeric error value and additionally the
device found in one of its input parameters. Simplify this by making
the function directly return a pointer to btrfs_device. Additionally
adjust the caller to handle the case when we want to remove the
'missing' device and ENOENT is returned to return the expected
positive error value, parsed by progs. Finally, unexport the function
since it's not called outside of volume.c. 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/volumes.c
fs/btrfs/volumes.h