summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-07-01 21:51:30 +0000
committerdelphij <delphij@FreeBSD.org>2014-07-01 21:51:30 +0000
commit6012f0ab3a6d68d680ff3f02df97deb938177c2c (patch)
tree8c8a5566fe179eea327d11c3cafb248183f2171d /cddl/contrib/opensolaris/lib
parent979aa67bd164d8c15c440c02b53d19fd378e8493 (diff)
downloadFreeBSD-src-6012f0ab3a6d68d680ff3f02df97deb938177c2c.zip
FreeBSD-src-6012f0ab3a6d68d680ff3f02df97deb938177c2c.tar.gz
MFV r268119:
4914 zfs on-disk bookmark structure should be named *_phys_t illumos/illumos-gate@7802d7bf98dec568dadf72286893b1fe5abd8602 MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c21
1 files changed, 12 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 c344c94..f6e84f8 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
@@ -3513,7 +3513,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
static int
zbookmark_compare(const void *a, const void *b)
{
- return (memcmp(a, b, sizeof (zbookmark_t)));
+ return (memcmp(a, b, sizeof (zbookmark_phys_t)));
}
/*
@@ -3525,7 +3525,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
{
zfs_cmd_t zc = { 0 };
uint64_t count;
- zbookmark_t *zb = NULL;
+ zbookmark_phys_t *zb = NULL;
int i;
/*
@@ -3538,7 +3538,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
if (count == 0)
return (0);
if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl,
- count * sizeof (zbookmark_t))) == (uintptr_t)NULL)
+ count * sizeof (zbookmark_phys_t))) == (uintptr_t)NULL)
return (-1);
zc.zc_nvlist_dst_size = count;
(void) strcpy(zc.zc_name, zhp->zpool_name);
@@ -3547,11 +3547,14 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
&zc) != 0) {
free((void *)(uintptr_t)zc.zc_nvlist_dst);
if (errno == ENOMEM) {
+ void *dst;
+
count = zc.zc_nvlist_dst_size;
- if ((zc.zc_nvlist_dst = (uintptr_t)
- zfs_alloc(zhp->zpool_hdl, count *
- sizeof (zbookmark_t))) == (uintptr_t)NULL)
+ dst = zfs_alloc(zhp->zpool_hdl, count *
+ sizeof (zbookmark_phys_t));
+ if (dst == NULL)
return (-1);
+ zc.zc_nvlist_dst = (uintptr_t)dst;
} else {
return (-1);
}
@@ -3567,11 +3570,11 @@ zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
* _not_ copied as part of the process. So we point the start of our
* array appropriate and decrement the total number of elements.
*/
- zb = ((zbookmark_t *)(uintptr_t)zc.zc_nvlist_dst) +
+ zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) +
zc.zc_nvlist_dst_size;
count -= zc.zc_nvlist_dst_size;
- qsort(zb, count, sizeof (zbookmark_t), zbookmark_compare);
+ qsort(zb, count, sizeof (zbookmark_phys_t), zbookmark_compare);
verify(nvlist_alloc(nverrlistp, 0, KM_SLEEP) == 0);
OpenPOWER on IntegriCloud