aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
index 4dc48fa88f91..658059cec2e5 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
@@ -20,10 +20,10 @@
*/
/*
- * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc.
*/
#include <sys/types.h>
@@ -49,8 +49,6 @@
static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
-#define DISK_ROOT "/dev/dsk"
-#define RDISK_ROOT "/dev/rdsk"
#define BACKUP_SLICE "s2"
typedef struct prop_flags {
@@ -2345,7 +2343,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *name)
"efi_use_whole_disk")) == NULL)
return (-1);
- (void) snprintf(path, sizeof (path), "%s/%s", RDISK_ROOT, name);
+ (void) snprintf(path, sizeof (path), "%s/%s", ZFS_RDISK_ROOT, name);
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
@@ -2421,7 +2419,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
}
if (wholedisk) {
- pathname += strlen(DISK_ROOT) + 1;
+ pathname += strlen(ZFS_DISK_ROOT) + 1;
(void) zpool_relabel_disk(hdl, pathname);
}
}
@@ -3411,8 +3409,8 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
}
#ifdef illumos
- if (strncmp(path, "/dev/dsk/", 9) == 0)
- path += 9;
+ if (strncmp(path, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0)
+ path += strlen(ZFS_DISK_ROOTD);
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
&value) == 0 && value) {
@@ -3846,7 +3844,7 @@ read_efi_label(nvlist_t *config, diskaddr_t *sb)
if (nvlist_lookup_string(config, ZPOOL_CONFIG_PATH, &path) != 0)
return (err);
- (void) snprintf(diskname, sizeof (diskname), "%s%s", RDISK_ROOT,
+ (void) snprintf(diskname, sizeof (diskname), "%s%s", ZFS_RDISK_ROOT,
strrchr(path, '/'));
if ((fd = open(diskname, O_RDONLY|O_NDELAY)) >= 0) {
struct dk_gpt *vtoc;
@@ -3931,7 +3929,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name)
start_block = NEW_START_BLOCK;
}
- (void) snprintf(path, sizeof (path), "%s/%s%s", RDISK_ROOT, name,
+ (void) snprintf(path, sizeof (path), "%s/%s%s", ZFS_RDISK_ROOT, name,
BACKUP_SLICE);
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {