Date: Sat, 13 Sep 2014 14:30:47 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271511 - vendor/illumos/dist/lib/libzfs/common Message-ID: <201409131430.s8DEUlxV049736@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Sat Sep 13 14:30:46 2014 New Revision: 271511 URL: http://svnweb.freebsd.org/changeset/base/271511 Log: 5135 zpool_find_import_cached() can use fnvlist_* Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Max Grossman <max.grossman@delphix.com> Reviewed by: Richard Elling <richard.elling@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Matthew Ahrens <mahrens@delphix.com> illumos/illumos-gate@b18d6b0e20b5bf6e2007c550bb33dcbab6b5dddc Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Sat Sep 13 14:23:51 2014 (r271510) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Sat Sep 13 14:30:46 2014 (r271511) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ @@ -1377,21 +1377,15 @@ zpool_find_import_cached(libzfs_handle_t elem = NULL; while ((elem = nvlist_next_nvpair(raw, elem)) != NULL) { - verify(nvpair_value_nvlist(elem, &src) == 0); + src = fnvpair_value_nvlist(elem); - verify(nvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME, - &name) == 0); + name = fnvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME); if (poolname != NULL && strcmp(poolname, name) != 0) continue; - verify(nvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID, - &this_guid) == 0); - if (guid != 0) { - verify(nvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID, - &this_guid) == 0); - if (guid != this_guid) - continue; - } + this_guid = fnvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID); + if (guid != 0 && guid != this_guid) + continue; if (pool_active(hdl, name, this_guid, &active) != 0) { nvlist_free(raw);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409131430.s8DEUlxV049736>