summaryrefslogtreecommitdiffstats
path: root/lib/libzfs
diff options
context:
space:
mode:
authorRyan Moeller <ryan@iXsystems.com>2019-11-11 15:15:44 -0500
committerBrian Behlendorf <behlendorf1@llnl.gov>2019-11-11 12:15:44 -0800
commit035ebb365383dcca71c4c542093ea1ad2b8e1dea (patch)
tree54e0ca3b772d9be3e4fa7d5c13008c59e96b4b8e /lib/libzfs
parent5a6ac4cffcd0255ca6f730bcf356e12891fd18af (diff)
Allow platform dependent path stripping for vdevs
On Linux the full path preceding devices is stripped when formatting vdev names. On FreeBSD we only want to strip "/dev/". Hide the implementation details of path stripping behind zfs_strip_path(). Make zfs_strip_partition_path() static in Linux implementation while here, since it is never used outside of the file it is defined in. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9565
Diffstat (limited to 'lib/libzfs')
-rw-r--r--lib/libzfs/libzfs_pool.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 380229da5..1a97c1666 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -3911,8 +3911,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
*/
if ((strcmp(type, VDEV_TYPE_DISK) == 0) &&
!(name_flags & VDEV_NAME_PATH)) {
- path = strrchr(path, '/');
- path++;
+ path = zfs_strip_path(path);
}
/*