summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-02-15 16:39:55 +0100
committerDavid Sterba <dsterba@suse.com>2016-04-28 10:59:13 +0200
commit5c5c0df05deaebcdcc9bb31bdca3812a7c22230f (patch)
treed5209304e8c6bab3c21515808d69e18c6346638a /fs/btrfs/volumes.c
parent418775a22b4c67bd15915e043c3a8f29816799bd (diff)
downloadop-kernel-dev-5c5c0df05deaebcdcc9bb31bdca3812a7c22230f.zip
op-kernel-dev-5c5c0df05deaebcdcc9bb31bdca3812a7c22230f.tar.gz
btrfs: rename btrfs_find_device_by_user_input
For clarity how we are going to find the device, let's call it a device specifier, devspec for short. Also rename the arguments that are a leftover from previous function purpose. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 055fbeb..e43b01e 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1780,7 +1780,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path, u64 devid)
if (ret)
goto out;
- ret = btrfs_find_device_by_user_input(root, devid, device_path,
+ ret = btrfs_find_device_by_devspec(root, devid, device_path,
&device);
if (ret)
goto out;
@@ -2065,23 +2065,26 @@ int btrfs_find_device_missing_or_by_path(struct btrfs_root *root,
}
}
-int btrfs_find_device_by_user_input(struct btrfs_root *root, u64 srcdevid,
- char *srcdev_name,
+/*
+ * Lookup a device given by device id, or the path if the id is 0.
+ */
+int btrfs_find_device_by_devspec(struct btrfs_root *root, u64 devid,
+ char *devpath,
struct btrfs_device **device)
{
int ret;
- if (srcdevid) {
+ if (devid) {
ret = 0;
- *device = btrfs_find_device(root->fs_info, srcdevid, NULL,
+ *device = btrfs_find_device(root->fs_info, devid, NULL,
NULL);
if (!*device)
ret = -ENOENT;
} else {
- if (!srcdev_name || !srcdev_name[0])
+ if (!devpath || !devpath[0])
return -EINVAL;
- ret = btrfs_find_device_missing_or_by_path(root, srcdev_name,
+ ret = btrfs_find_device_missing_or_by_path(root, devpath,
device);
}
return ret;
OpenPOWER on IntegriCloud