mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
5a6ac4cffc
commit
035ebb3653
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user