153089abeschrock/*
253089abeschrock * CDDL HEADER START
353089abeschrock *
453089abeschrock * The contents of this file are subject to the terms of the
553089abeschrock * Common Development and Distribution License (the "License").
653089abeschrock * You may not use this file except in compliance with the License.
753089abeschrock *
853089abeschrock * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
953089abeschrock * or http://www.opensolaris.org/os/licensing.
1053089abeschrock * See the License for the specific language governing permissions
1153089abeschrock * and limitations under the License.
1253089abeschrock *
1353089abeschrock * When distributing Covered Code, include this CDDL HEADER in each
1453089abeschrock * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1553089abeschrock * If applicable, add the following below this CDDL HEADER, with the
1653089abeschrock * fields enclosed by brackets "[]" replaced with your own identifying
1753089abeschrock * information: Portions Copyright [yyyy] [name of copyright owner]
1853089abeschrock *
1953089abeschrock * CDDL HEADER END
2053089abeschrock */
2153089abeschrock
2253089abeschrock/*
2353089abeschrock * Copyright (c) 2012 by Delphix. All rights reserved.
2453089abeschrock */
2553089abeschrock
2653089abeschrock#include <sys/nvpair.h>
2753089abeschrock#include <sys/kmem.h>
2853089abeschrock#include <sys/debug.h>
293b2aab1Matthew Ahrens#include <sys/param.h>
3053089abeschrock#ifndef _KERNEL
3153089abeschrock#include <stdlib.h>
3253089abeschrock#endif
3353089abeschrock
3453089abeschrock/*
3553089abeschrock * "Force" nvlist wrapper.
3653089abeschrock *
3753089abeschrock * These functions wrap the nvlist_* functions with assertions that assume
3853089abeschrock * the operation is successful.  This allows the caller's code to be much
3953089abeschrock * more readable, especially for the fnvlist_lookup_* and fnvpair_value_*
4053089abeschrock * functions, which can return the requested value (rather than filling in
4153089abeschrock * a pointer).
4253089abeschrock *
4353089abeschrock * These functions use NV_UNIQUE_NAME, encoding NV_ENCODE_NATIVE, and allocate
4453089abeschrock * with KM_SLEEP.
4553089abeschrock *
4653089abeschrock * More wrappers should be added as needed -- for example
4753089abeschrock * nvlist_lookup_*_array and nvpair_value_*_array.
4853089abeschrock */
4953089abeschrock
5053089abeschrocknvlist_t *
5153089abeschrockfnvlist_alloc(void)
5253089abeschrock{
5353089abeschrock	nvlist_t *nvl;
54fb09f5aMadhav Suresh	VERIFY0(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP));
5553089abeschrock	return (nvl);
5653089abeschrock}
5753089abeschrock
5853089abeschrockvoid
5953089abeschrockfnvlist_free(nvlist_t *nvl)
6053089abeschrock{
6153089abeschrock	nvlist_free(nvl);
6253089abeschrock}
6353089abeschrock
6453089abeschrocksize_t
6553089abeschrockfnvlist_size(nvlist_t *nvl)
6653089abeschrock{
6753089abeschrock	size_t size;
68fb09f5aMadhav Suresh	VERIFY0(nvlist_size(nvl, &size, NV_ENCODE_NATIVE));
6953089abeschrock	return (size);
7053089abeschrock}
7153089abeschrock
7253089abeschrock/*
7353089abeschrock * Returns allocated buffer of size *sizep.  Caller must free the buffer with
7453089abeschrock * fnvlist_pack_free().
7553089abeschrock */
7653089abeschrockchar *
7753089abeschrockfnvlist_pack(nvlist_t *nvl, size_t *sizep)
7853089abeschrock{
7953089abeschrock	char *packed = 0;
8053089abeschrock	VERIFY3U(nvlist_pack(nvl, &packed, sizep, NV_ENCODE_NATIVE,
8153089abeschrock	    KM_SLEEP), ==, 0);
8253089abeschrock	return (packed);
8353089abeschrock}
8453089abeschrock
8553089abeschrock/*ARGSUSED*/
8653089abeschrockvoid
8753089abeschrockfnvlist_pack_free(char *pack, size_t size)
8853089abeschrock{
8953089abeschrock#ifdef _KERNEL
9053089abeschrock	kmem_free(pack, size);
9153089abeschrock#else
9253089abeschrock	free(pack);
9353089abeschrock#endif
9453089abeschrock}
9553089abeschrock
9653089abeschrocknvlist_t *
9753089abeschrockfnvlist_unpack(char *buf, size_t buflen)
9853089abeschrock{
9953089abeschrock	nvlist_t *rv;
100fb09f5aMadhav Suresh	VERIFY0(nvlist_unpack(buf, buflen, &rv, KM_SLEEP));
10153089abeschrock	return (rv);
10253089abeschrock}
10353089abeschrock
10453089abeschrocknvlist_t *
10553089abeschrockfnvlist_dup(nvlist_t *nvl)
10653089abeschrock{
10753089abeschrock	nvlist_t *rv;
108fb09f5aMadhav Suresh	VERIFY0(nvlist_dup(nvl, &rv, KM_SLEEP));
10953089abeschrock	return (rv);
11053089abeschrock}
11153089abeschrock
11253089abeschrockvoid
11353089abeschrockfnvlist_merge(nvlist_t *dst, nvlist_t *src)
11453089abeschrock{
115fb09f5aMadhav Suresh	VERIFY0(nvlist_merge(dst, src, KM_SLEEP));
11653089abeschrock}
11753089abeschrock
1183b2aab1Matthew Ahrenssize_t
1193b2aab1Matthew Ahrensfnvlist_num_pairs(nvlist_t *nvl)
1203b2aab1Matthew Ahrens{
1213b2aab1Matthew Ahrens	size_t count = 0;
1223b2aab1Matthew Ahrens	nvpair_t *pair;
1233b2aab1Matthew Ahrens
1243b2aab1Matthew Ahrens	for (pair = nvlist_next_nvpair(nvl, 0); pair != NULL;
1253b2aab1Matthew Ahrens	    pair = nvlist_next_nvpair(nvl, pair))
1263b2aab1Matthew Ahrens		count++;
1273b2aab1Matthew Ahrens	return (count);
1283b2aab1Matthew Ahrens}
1293b2aab1Matthew Ahrens
13053089abeschrockvoid
13153089abeschrockfnvlist_add_boolean(nvlist_t *nvl, const char *name)
13253089abeschrock{
133fb09f5aMadhav Suresh	VERIFY0(nvlist_add_boolean(nvl, name));
13453089abeschrock}
13553089abeschrock
13653089abeschrockvoid
13753089abeschrockfnvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val)
13853089abeschrock{
139fb09f5aMadhav Suresh	VERIFY0(nvlist_add_boolean_value(nvl, name, val));
14053089abeschrock}
14153089abeschrock
14253089abeschrockvoid
14353089abeschrockfnvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val)
14453089abeschrock{
145fb09f5aMadhav Suresh	VERIFY0(nvlist_add_byte(nvl, name, val));
14653089abeschrock}
14753089abeschrock
14853089abeschrockvoid
14953089abeschrockfnvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val)
15053089abeschrock{
151fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int8(nvl, name, val));
15253089abeschrock}
15353089abeschrock
15453089abeschrockvoid
15553089abeschrockfnvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val)
15653089abeschrock{
157fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint8(nvl, name, val));
15853089abeschrock}
15953089abeschrock
16053089abeschrockvoid
16153089abeschrockfnvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val)
16253089abeschrock{
163fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int16(nvl, name, val));
16453089abeschrock}
16553089abeschrock
16653089abeschrockvoid
16753089abeschrockfnvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val)
16853089abeschrock{
169fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint16(nvl, name, val));
17053089abeschrock}
17153089abeschrock
17253089abeschrockvoid
17353089abeschrockfnvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val)
17453089abeschrock{
175fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int32(nvl, name, val));
17653089abeschrock}
17753089abeschrock
17853089abeschrockvoid
17953089abeschrockfnvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val)
18053089abeschrock{
181fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint32(nvl, name, val));
18253089abeschrock}
18353089abeschrock
18453089abeschrockvoid
18553089abeschrockfnvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val)
18653089abeschrock{
187fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int64(nvl, name, val));
18853089abeschrock}
18953089abeschrock
19053089abeschrockvoid
19153089abeschrockfnvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val)
19253089abeschrock{
193fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint64(nvl, name, val));
19453089abeschrock}
19553089abeschrock
19653089abeschrockvoid
19753089abeschrockfnvlist_add_string(nvlist_t *nvl, const char *name, const char *val)
19853089abeschrock{
199fb09f5aMadhav Suresh	VERIFY0(nvlist_add_string(nvl, name, val));
20053089abeschrock}
20153089abeschrock
20253089abeschrockvoid
20353089abeschrockfnvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val)
20453089abeschrock{
205fb09f5aMadhav Suresh	VERIFY0(nvlist_add_nvlist(nvl, name, val));
20653089abeschrock}
20753089abeschrock
20853089abeschrockvoid
20953089abeschrockfnvlist_add_nvpair(nvlist_t *nvl, nvpair_t *pair)
21053089abeschrock{
211fb09f5aMadhav Suresh	VERIFY0(nvlist_add_nvpair(nvl, pair));
21253089abeschrock}
21353089abeschrock
21453089abeschrockvoid
21553089abeschrockfnvlist_add_boolean_array(nvlist_t *nvl, const char *name,
21653089abeschrock    boolean_t *val, uint_t n)
21753089abeschrock{
218fb09f5aMadhav Suresh	VERIFY0(nvlist_add_boolean_array(nvl, name, val, n));
21953089abeschrock}
22053089abeschrock
22153089abeschrockvoid
22253089abeschrockfnvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val, uint_t n)
22353089abeschrock{
224fb09f5aMadhav Suresh	VERIFY0(nvlist_add_byte_array(nvl, name, val, n));
22553089abeschrock}
22653089abeschrock
22753089abeschrockvoid
22853089abeschrockfnvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val, uint_t n)
22953089abeschrock{
230fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int8_array(nvl, name, val, n));
23153089abeschrock}
23253089abeschrock
23353089abeschrockvoid
23453089abeschrockfnvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *val, uint_t n)
23553089abeschrock{
236fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint8_array(nvl, name, val, n));
23753089abeschrock}
23853089abeschrock
23953089abeschrockvoid
24053089abeschrockfnvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val, uint_t n)
24153089abeschrock{
242fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int16_array(nvl, name, val, n));
24353089abeschrock}
24453089abeschrock
24553089abeschrockvoid
24653089abeschrockfnvlist_add_uint16_array(nvlist_t *nvl, const char *name,
24753089abeschrock    uint16_t *val, uint_t n)
24853089abeschrock{
249fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint16_array(nvl, name, val, n));
25053089abeschrock}
25153089abeschrock
25253089abeschrockvoid
25353089abeschrockfnvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val, uint_t n)
25453089abeschrock{
255fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int32_array(nvl, name, val, n));
25653089abeschrock}
25753089abeschrock
25853089abeschrockvoid
25953089abeschrockfnvlist_add_uint32_array(nvlist_t *nvl, const char *name,
26053089abeschrock    uint32_t *val, uint_t n)
26153089abeschrock{
262fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint32_array(nvl, name, val, n));
26353089abeschrock}
26453089abeschrock
26553089abeschrockvoid
26653089abeschrockfnvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val, uint_t n)
26753089abeschrock{
268fb09f5aMadhav Suresh	VERIFY0(nvlist_add_int64_array(nvl, name, val, n));
26953089abeschrock}
27053089abeschrock
27153089abeschrockvoid
27253089abeschrockfnvlist_add_uint64_array(nvlist_t *nvl, const char *name,
27353089abeschrock    uint64_t *val, uint_t n)
27453089abeschrock{
275fb09f5aMadhav Suresh	VERIFY0(nvlist_add_uint64_array(nvl, name, val, n));
27653089abeschrock}
27753089abeschrock
27853089abeschrockvoid
27953089abeschrockfnvlist_add_string_array(nvlist_t *nvl, const char *name,
28053089abeschrock    char * const *val, uint_t n)
28153089abeschrock{
282fb09f5aMadhav Suresh	VERIFY0(nvlist_add_string_array(nvl, name, val, n));
28353089abeschrock}
28453089abeschrock
28553089abeschrockvoid
28653089abeschrockfnvlist_add_nvlist_array(nvlist_t *nvl, const char *name,
28753089abeschrock    nvlist_t **val, uint_t n)
28853089abeschrock{
289fb09f5aMadhav Suresh	VERIFY0(nvlist_add_nvlist_array(nvl, name, val, n));
29053089abeschrock}
29153089abeschrock
29253089abeschrockvoid
29353089abeschrockfnvlist_remove(nvlist_t *nvl, const char *name)
29453089abeschrock{
295fb09f5aMadhav Suresh	VERIFY0(nvlist_remove_all(nvl, name));
29653089abeschrock}
29753089abeschrock
29853089abeschrockvoid
29953089abeschrockfnvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *pair)
30053089abeschrock{
301fb09f5aMadhav Suresh	VERIFY0(nvlist_remove_nvpair(nvl, pair));
30253089abeschrock}
30353089abeschrock
30453089abeschrocknvpair_t *
30553089abeschrockfnvlist_lookup_nvpair(nvlist_t *nvl, const char *name)
30653089abeschrock{
30753089abeschrock	nvpair_t *rv;
308fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_nvpair(nvl, name, &rv));
30953089abeschrock	return (rv);
31053089abeschrock}
31153089abeschrock
31253089abeschrock/* returns B_TRUE if the entry exists */
31353089abeschrockboolean_t
31453089abeschrockfnvlist_lookup_boolean(nvlist_t *nvl, const char *name)
31553089abeschrock{
31653089abeschrock	return (nvlist_lookup_boolean(nvl, name) == 0);
31753089abeschrock}
31853089abeschrock
31953089abeschrockboolean_t
32053089abeschrockfnvlist_lookup_boolean_value(nvlist_t *nvl, const char *name)
32153089abeschrock{
32253089abeschrock	boolean_t rv;
323fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_boolean_value(nvl, name, &rv));
32453089abeschrock	return (rv);
32553089abeschrock}
32653089abeschrock
32753089abeschrockuchar_t
32853089abeschrockfnvlist_lookup_byte(nvlist_t *nvl, const char *name)
32953089abeschrock{
33053089abeschrock	uchar_t rv;
331fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_byte(nvl, name, &rv));
33253089abeschrock	return (rv);
33353089abeschrock}
33453089abeschrock
33553089abeschrockint8_t
33653089abeschrockfnvlist_lookup_int8(nvlist_t *nvl, const char *name)
33753089abeschrock{
33853089abeschrock	int8_t rv;
339fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_int8(nvl, name, &rv));
34053089abeschrock	return (rv);
34153089abeschrock}
34253089abeschrock
34353089abeschrockint16_t
34453089abeschrockfnvlist_lookup_int16(nvlist_t *nvl, const char *name)
34553089abeschrock{
34653089abeschrock	int16_t rv;
347fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_int16(nvl, name, &rv));
34853089abeschrock	return (rv);
34953089abeschrock}
35053089abeschrock
35153089abeschrockint32_t
35253089abeschrockfnvlist_lookup_int32(nvlist_t *nvl, const char *name)
35353089abeschrock{
35453089abeschrock	int32_t rv;
355fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_int32(nvl, name, &rv));
35653089abeschrock	return (rv);
35753089abeschrock}
35853089abeschrock
35953089abeschrockint64_t
36053089abeschrockfnvlist_lookup_int64(nvlist_t *nvl, const char *name)
36153089abeschrock{
36253089abeschrock	int64_t rv;
363fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_int64(nvl, name, &rv));
36453089abeschrock	return (rv);
36553089abeschrock}
36653089abeschrock
36753089abeschrockuint8_t
36853089abeschrockfnvlist_lookup_uint8_t(nvlist_t *nvl, const char *name)
36953089abeschrock{
37053089abeschrock	uint8_t rv;
371fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_uint8(nvl, name, &rv));
37253089abeschrock	return (rv);
37353089abeschrock}
37453089abeschrock
37553089abeschrockuint16_t
37653089abeschrockfnvlist_lookup_uint16(nvlist_t *nvl, const char *name)
37753089abeschrock{
37853089abeschrock	uint16_t rv;
379fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_uint16(nvl, name, &rv));
38053089abeschrock	return (rv);
38153089abeschrock}
38253089abeschrock
38353089abeschrockuint32_t
38453089abeschrockfnvlist_lookup_uint32(nvlist_t *nvl, const char *name)
38553089abeschrock{
38653089abeschrock	uint32_t rv;
387fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_uint32(nvl, name, &rv));
38853089abeschrock	return (rv);
38953089abeschrock}
39053089abeschrock
39153089abeschrockuint64_t
39253089abeschrockfnvlist_lookup_uint64(nvlist_t *nvl, const char *name)
39353089abeschrock{
39453089abeschrock	uint64_t rv;
395fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_uint64(nvl, name, &rv));
39653089abeschrock	return (rv);
39753089abeschrock}
39853089abeschrock
39953089abeschrockchar *
40053089abeschrockfnvlist_lookup_string(nvlist_t *nvl, const char *name)
40153089abeschrock{
40253089abeschrock	char *rv;
403fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_string(nvl, name, &rv));
40453089abeschrock	return (rv);
40553089abeschrock}
40653089abeschrock
40753089abeschrocknvlist_t *
40853089abeschrockfnvlist_lookup_nvlist(nvlist_t *nvl, const char *name)
40953089abeschrock{
41053089abeschrock	nvlist_t *rv;
411fb09f5aMadhav Suresh	VERIFY0(nvlist_lookup_nvlist(nvl, name, &rv));
41253089abeschrock	return (rv);
41353089abeschrock}
41453089abeschrock
41553089abeschrockboolean_t
41653089abeschrockfnvpair_value_boolean_value(nvpair_t *nvp)
41753089abeschrock{
41853089abeschrock	boolean_t rv;
419fb09f5aMadhav Suresh	VERIFY0(nvpair_value_boolean_value(nvp, &rv));
42053089abeschrock	return (rv);
42153089abeschrock}
42253089abeschrock
42353089abeschrockuchar_t
42453089abeschrockfnvpair_value_byte(nvpair_t *nvp)
42553089abeschrock{
42653089abeschrock	uchar_t rv;
427fb09f5aMadhav Suresh	VERIFY0(nvpair_value_byte(nvp, &rv));
42853089abeschrock	return (rv);
42953089abeschrock}
43053089abeschrock
43153089abeschrockint8_t
43253089abeschrockfnvpair_value_int8(nvpair_t *nvp)
43353089abeschrock{
43453089abeschrock	int8_t rv;
435fb09f5aMadhav Suresh	VERIFY0(nvpair_value_int8(nvp, &rv));
43653089abeschrock	return (rv);
43753089abeschrock}
43853089abeschrock
43953089abeschrockint16_t
44053089abeschrockfnvpair_value_int16(nvpair_t *nvp)
44153089abeschrock{
44253089abeschrock	int16_t rv;
443fb09f5aMadhav Suresh	VERIFY0(nvpair_value_int16(nvp, &rv));
44453089abeschrock	return (rv);
44553089abeschrock}
44653089abeschrock
44753089abeschrockint32_t
44853089abeschrockfnvpair_value_int32(nvpair_t *nvp)
44953089abeschrock{
45053089abeschrock	int32_t rv;
451fb09f5aMadhav Suresh	VERIFY0(nvpair_value_int32(nvp, &rv));
45253089abeschrock	return (rv);
45353089abeschrock}
45453089abeschrock
45553089abeschrockint64_t
45653089abeschrockfnvpair_value_int64(nvpair_t *nvp)
45753089abeschrock{
45853089abeschrock	int64_t rv;
459fb09f5aMadhav Suresh	VERIFY0(nvpair_value_int64(nvp, &rv));
46053089abeschrock	return (rv);
46153089abeschrock}
46253089abeschrock
46353089abeschrockuint8_t
46453089abeschrockfnvpair_value_uint8_t(nvpair_t *nvp)
46553089abeschrock{
46653089abeschrock	uint8_t rv;
467fb09f5aMadhav Suresh	VERIFY0(nvpair_value_uint8(nvp, &rv));
46853089abeschrock	return (rv);
46953089abeschrock}
47053089abeschrock
47153089abeschrockuint16_t
47253089abeschrockfnvpair_value_uint16(nvpair_t *nvp)
47353089abeschrock{
47453089abeschrock	uint16_t rv;
475fb09f5aMadhav Suresh	VERIFY0(nvpair_value_uint16(nvp, &rv));
47653089abeschrock	return (rv);
47753089abeschrock}
47853089abeschrock
47953089abeschrockuint32_t
48053089abeschrockfnvpair_value_uint32(nvpair_t *nvp)
48153089abeschrock{
48253089abeschrock	uint32_t rv;
483fb09f5aMadhav Suresh	VERIFY0(nvpair_value_uint32(nvp, &rv));
48453089abeschrock	return (rv);
48553089abeschrock}
48653089abeschrock
48753089abeschrockuint64_t
48853089abeschrockfnvpair_value_uint64(nvpair_t *nvp)
48953089abeschrock{
49053089abeschrock	uint64_t rv;
491fb09f5aMadhav Suresh	VERIFY0(nvpair_value_uint64(nvp, &rv));
49253089abeschrock	return (rv);
49353089abeschrock}
49453089abeschrock
49553089abeschrockchar *
49653089abeschrockfnvpair_value_string(nvpair_t *nvp)
49753089abeschrock{
49853089abeschrock	char *rv;
499fb09f5aMadhav Suresh	VERIFY0(nvpair_value_string(nvp, &rv));
50053089abeschrock	return (rv);
50153089abeschrock}
50253089abeschrock
50353089abeschrocknvlist_t *
50453089abeschrockfnvpair_value_nvlist(nvpair_t *nvp)
50553089abeschrock{
50653089abeschrock	nvlist_t *rv;
507fb09f5aMadhav Suresh	VERIFY0(nvpair_value_nvlist(nvp, &rv));
50853089abeschrock	return (rv);
50953089abeschrock}
510