Lines Matching refs:nvl

139 static int nvlist_add_common(nvlist_t *nvl, const char *name, data_type_t type,
190 nvlist_lookup_nv_alloc(nvlist_t *nvl) in nvlist_lookup_nv_alloc() argument
194 if (nvl == NULL || in nvlist_lookup_nv_alloc()
195 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_lookup_nv_alloc()
329 nvt_lookup_name_type(const nvlist_t *nvl, const char *name, data_type_t type) in nvt_lookup_name_type() argument
331 const nvpriv_t *priv = (const nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvt_lookup_name_type()
361 nvt_lookup_name(const nvlist_t *nvl, const char *name) in nvt_lookup_name() argument
363 return (nvt_lookup_name_type(nvl, name, DATA_TYPE_DONTCARE)); in nvt_lookup_name()
467 nvt_remove_nvpair(nvlist_t *nvl, const nvpair_t *nvp) in nvt_remove_nvpair() argument
469 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvt_remove_nvpair()
487 if (nvt_nvpair_match(&e->nvi_nvp, nvp, nvl->nvl_nvflag)) { in nvt_remove_nvpair()
505 nvt_add_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvt_add_nvpair() argument
507 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvt_add_nvpair()
520 if (nvl->nvl_nvflag != 0) { in nvt_add_nvpair()
521 int err = nvt_remove_nvpair(nvl, nvp); in nvt_add_nvpair()
553 nvlist_init(nvlist_t *nvl, uint32_t nvflag, nvpriv_t *priv) in nvlist_init() argument
555 nvl->nvl_version = NV_VERSION; in nvlist_init()
556 nvl->nvl_nvflag = nvflag & (NV_UNIQUE_NAME|NV_UNIQUE_NAME_TYPE); in nvlist_init()
557 nvl->nvl_priv = (uint64_t)(uintptr_t)priv; in nvlist_init()
558 nvl->nvl_flag = 0; in nvlist_init()
559 nvl->nvl_pad = 0; in nvlist_init()
563 nvlist_nvflag(nvlist_t *nvl) in nvlist_nvflag() argument
565 return (nvl->nvl_nvflag); in nvlist_nvflag()
621 nvp_buf_alloc(nvlist_t *nvl, size_t len) in nvp_buf_alloc() argument
623 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_alloc()
646 nvp_buf_free(nvlist_t *nvl, nvpair_t *nvp) in nvp_buf_free() argument
648 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_free()
658 nvp_buf_link(nvlist_t *nvl, nvpair_t *nvp) in nvp_buf_link() argument
660 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_link()
677 nvp_buf_unlink(nvlist_t *nvl, nvpair_t *nvp) in nvp_buf_unlink() argument
679 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_unlink()
871 nvlist_free(nvlist_t *nvl) in nvlist_free() argument
876 if (nvl == NULL || in nvlist_free()
877 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_free()
889 nvp_buf_free(nvl, nvp); in nvlist_free()
893 nv_mem_free(priv, nvl, NV_ALIGN(sizeof (nvlist_t))); in nvlist_free()
895 nvl->nvl_priv = 0; in nvlist_free()
902 nvlist_contains_nvp(const nvlist_t *nvl, const nvpair_t *nvp) in nvlist_contains_nvp() argument
904 const nvpriv_t *priv = (const nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvlist_contains_nvp()
921 nvlist_dup(const nvlist_t *nvl, nvlist_t **nvlp, int kmflag) in nvlist_dup() argument
923 return (nvlist_xdup(nvl, nvlp, nvlist_nv_alloc(kmflag))); in nvlist_dup()
927 nvlist_xdup(const nvlist_t *nvl, nvlist_t **nvlp, nv_alloc_t *nva) in nvlist_xdup() argument
932 if (nvl == NULL || nvlp == NULL) in nvlist_xdup()
935 if ((err = nvlist_xalloc(&ret, nvl->nvl_nvflag, nva)) != 0) in nvlist_xdup()
938 if ((err = nvlist_copy_pairs(nvl, ret)) != 0) in nvlist_xdup()
950 nvlist_remove_all(nvlist_t *nvl, const char *name) in nvlist_remove_all() argument
954 if (nvl == NULL || name == NULL || nvl->nvl_priv == 0) in nvlist_remove_all()
958 while ((nvp = nvt_lookup_name(nvl, name)) != NULL) { in nvlist_remove_all()
959 VERIFY0(nvlist_remove_nvpair(nvl, nvp)); in nvlist_remove_all()
970 nvlist_remove(nvlist_t *nvl, const char *name, data_type_t type) in nvlist_remove() argument
972 if (nvl == NULL || name == NULL || nvl->nvl_priv == 0) in nvlist_remove()
975 nvpair_t *nvp = nvt_lookup_name_type(nvl, name, type); in nvlist_remove()
979 return (nvlist_remove_nvpair(nvl, nvp)); in nvlist_remove()
983 nvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvlist_remove_nvpair() argument
985 if (nvl == NULL || nvp == NULL) in nvlist_remove_nvpair()
988 int err = nvt_remove_nvpair(nvl, nvp); in nvlist_remove_nvpair()
992 nvp_buf_unlink(nvl, nvp); in nvlist_remove_nvpair()
994 nvp_buf_free(nvl, nvp); in nvlist_remove_nvpair()
1123 nvlist_copy_embedded(nvlist_t *nvl, nvlist_t *onvl, nvlist_t *emb_nvl) in nvlist_copy_embedded() argument
1129 nvl->nvl_priv)) == NULL) in nvlist_copy_embedded()
1146 nvlist_add_common(nvlist_t *nvl, const char *name, in nvlist_add_common() argument
1155 if (name == NULL || nvl == NULL || nvl->nvl_priv == 0) in nvlist_add_common()
1179 if (data == nvl || data == NULL) in nvlist_add_common()
1185 if (onvlp[i] == nvl || onvlp[i] == NULL) in nvlist_add_common()
1201 if ((nvp = nvp_buf_alloc(nvl, nvp_sz)) == NULL) in nvlist_add_common()
1232 if ((err = nvlist_copy_embedded(nvl, onvl, nnvl)) != 0) { in nvlist_add_common()
1233 nvp_buf_free(nvl, nvp); in nvlist_add_common()
1245 if ((err = nvlist_copy_embedded(nvl, in nvlist_add_common()
1251 nvp_buf_free(nvl, nvp); in nvlist_add_common()
1264 if (nvl->nvl_nvflag & NV_UNIQUE_NAME) in nvlist_add_common()
1265 (void) nvlist_remove_all(nvl, name); in nvlist_add_common()
1266 else if (nvl->nvl_nvflag & NV_UNIQUE_NAME_TYPE) in nvlist_add_common()
1267 (void) nvlist_remove(nvl, name, type); in nvlist_add_common()
1269 err = nvt_add_nvpair(nvl, nvp); in nvlist_add_common()
1272 nvp_buf_free(nvl, nvp); in nvlist_add_common()
1275 nvp_buf_link(nvl, nvp); in nvlist_add_common()
1281 nvlist_add_boolean(nvlist_t *nvl, const char *name) in nvlist_add_boolean() argument
1283 return (nvlist_add_common(nvl, name, DATA_TYPE_BOOLEAN, 0, NULL)); in nvlist_add_boolean()
1287 nvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val) in nvlist_add_boolean_value() argument
1289 return (nvlist_add_common(nvl, name, DATA_TYPE_BOOLEAN_VALUE, 1, &val)); in nvlist_add_boolean_value()
1293 nvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val) in nvlist_add_byte() argument
1295 return (nvlist_add_common(nvl, name, DATA_TYPE_BYTE, 1, &val)); in nvlist_add_byte()
1299 nvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val) in nvlist_add_int8() argument
1301 return (nvlist_add_common(nvl, name, DATA_TYPE_INT8, 1, &val)); in nvlist_add_int8()
1305 nvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val) in nvlist_add_uint8() argument
1307 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT8, 1, &val)); in nvlist_add_uint8()
1311 nvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val) in nvlist_add_int16() argument
1313 return (nvlist_add_common(nvl, name, DATA_TYPE_INT16, 1, &val)); in nvlist_add_int16()
1317 nvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val) in nvlist_add_uint16() argument
1319 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT16, 1, &val)); in nvlist_add_uint16()
1323 nvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val) in nvlist_add_int32() argument
1325 return (nvlist_add_common(nvl, name, DATA_TYPE_INT32, 1, &val)); in nvlist_add_int32()
1329 nvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val) in nvlist_add_uint32() argument
1331 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT32, 1, &val)); in nvlist_add_uint32()
1335 nvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val) in nvlist_add_int64() argument
1337 return (nvlist_add_common(nvl, name, DATA_TYPE_INT64, 1, &val)); in nvlist_add_int64()
1341 nvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val) in nvlist_add_uint64() argument
1343 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT64, 1, &val)); in nvlist_add_uint64()
1348 nvlist_add_double(nvlist_t *nvl, const char *name, double val) in nvlist_add_double() argument
1350 return (nvlist_add_common(nvl, name, DATA_TYPE_DOUBLE, 1, &val)); in nvlist_add_double()
1355 nvlist_add_string(nvlist_t *nvl, const char *name, const char *val) in nvlist_add_string() argument
1357 return (nvlist_add_common(nvl, name, DATA_TYPE_STRING, 1, (void *)val)); in nvlist_add_string()
1361 nvlist_add_boolean_array(nvlist_t *nvl, const char *name, in nvlist_add_boolean_array() argument
1364 return (nvlist_add_common(nvl, name, DATA_TYPE_BOOLEAN_ARRAY, n, a)); in nvlist_add_boolean_array()
1368 nvlist_add_byte_array(nvlist_t *nvl, const char *name, const uchar_t *a, in nvlist_add_byte_array() argument
1371 return (nvlist_add_common(nvl, name, DATA_TYPE_BYTE_ARRAY, n, a)); in nvlist_add_byte_array()
1375 nvlist_add_int8_array(nvlist_t *nvl, const char *name, const int8_t *a, in nvlist_add_int8_array() argument
1378 return (nvlist_add_common(nvl, name, DATA_TYPE_INT8_ARRAY, n, a)); in nvlist_add_int8_array()
1382 nvlist_add_uint8_array(nvlist_t *nvl, const char *name, const uint8_t *a, in nvlist_add_uint8_array() argument
1385 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT8_ARRAY, n, a)); in nvlist_add_uint8_array()
1389 nvlist_add_int16_array(nvlist_t *nvl, const char *name, const int16_t *a, in nvlist_add_int16_array() argument
1392 return (nvlist_add_common(nvl, name, DATA_TYPE_INT16_ARRAY, n, a)); in nvlist_add_int16_array()
1396 nvlist_add_uint16_array(nvlist_t *nvl, const char *name, const uint16_t *a, in nvlist_add_uint16_array() argument
1399 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT16_ARRAY, n, a)); in nvlist_add_uint16_array()
1403 nvlist_add_int32_array(nvlist_t *nvl, const char *name, const int32_t *a, in nvlist_add_int32_array() argument
1406 return (nvlist_add_common(nvl, name, DATA_TYPE_INT32_ARRAY, n, a)); in nvlist_add_int32_array()
1410 nvlist_add_uint32_array(nvlist_t *nvl, const char *name, const uint32_t *a, in nvlist_add_uint32_array() argument
1413 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT32_ARRAY, n, a)); in nvlist_add_uint32_array()
1417 nvlist_add_int64_array(nvlist_t *nvl, const char *name, const int64_t *a, in nvlist_add_int64_array() argument
1420 return (nvlist_add_common(nvl, name, DATA_TYPE_INT64_ARRAY, n, a)); in nvlist_add_int64_array()
1424 nvlist_add_uint64_array(nvlist_t *nvl, const char *name, const uint64_t *a, in nvlist_add_uint64_array() argument
1427 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT64_ARRAY, n, a)); in nvlist_add_uint64_array()
1431 nvlist_add_string_array(nvlist_t *nvl, const char *name, in nvlist_add_string_array() argument
1434 return (nvlist_add_common(nvl, name, DATA_TYPE_STRING_ARRAY, n, a)); in nvlist_add_string_array()
1438 nvlist_add_hrtime(nvlist_t *nvl, const char *name, hrtime_t val) in nvlist_add_hrtime() argument
1440 return (nvlist_add_common(nvl, name, DATA_TYPE_HRTIME, 1, &val)); in nvlist_add_hrtime()
1444 nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *val) in nvlist_add_nvlist() argument
1446 return (nvlist_add_common(nvl, name, DATA_TYPE_NVLIST, 1, val)); in nvlist_add_nvlist()
1450 nvlist_add_nvlist_array(nvlist_t *nvl, const char *name, in nvlist_add_nvlist_array() argument
1453 return (nvlist_add_common(nvl, name, DATA_TYPE_NVLIST_ARRAY, n, a)); in nvlist_add_nvlist_array()
1458 nvlist_next_nvpair(nvlist_t *nvl, const nvpair_t *nvp) in nvlist_next_nvpair() argument
1463 if (nvl == NULL || in nvlist_next_nvpair()
1464 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_next_nvpair()
1476 else if (priv->nvp_curr == curr || nvlist_contains_nvp(nvl, nvp)) in nvlist_next_nvpair()
1487 nvlist_prev_nvpair(nvlist_t *nvl, const nvpair_t *nvp) in nvlist_prev_nvpair() argument
1492 if (nvl == NULL || in nvlist_prev_nvpair()
1493 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_prev_nvpair()
1500 else if (priv->nvp_curr == curr || nvlist_contains_nvp(nvl, nvp)) in nvlist_prev_nvpair()
1511 nvlist_empty(const nvlist_t *nvl) in nvlist_empty() argument
1515 if (nvl == NULL || in nvlist_empty()
1516 (priv = (const nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_empty()
1643 nvlist_lookup_common(const nvlist_t *nvl, const char *name, data_type_t type, in nvlist_lookup_common() argument
1646 if (name == NULL || nvl == NULL || nvl->nvl_priv == 0) in nvlist_lookup_common()
1649 if (!(nvl->nvl_nvflag & (NV_UNIQUE_NAME | NV_UNIQUE_NAME_TYPE))) in nvlist_lookup_common()
1652 nvpair_t *nvp = nvt_lookup_name_type(nvl, name, type); in nvlist_lookup_common()
1660 nvlist_lookup_boolean(const nvlist_t *nvl, const char *name) in nvlist_lookup_boolean() argument
1662 return (nvlist_lookup_common(nvl, name, DATA_TYPE_BOOLEAN, NULL, NULL)); in nvlist_lookup_boolean()
1666 nvlist_lookup_boolean_value(const nvlist_t *nvl, const char *name, in nvlist_lookup_boolean_value() argument
1669 return (nvlist_lookup_common(nvl, name, in nvlist_lookup_boolean_value()
1674 nvlist_lookup_byte(const nvlist_t *nvl, const char *name, uchar_t *val) in nvlist_lookup_byte() argument
1676 return (nvlist_lookup_common(nvl, name, DATA_TYPE_BYTE, NULL, val)); in nvlist_lookup_byte()
1680 nvlist_lookup_int8(const nvlist_t *nvl, const char *name, int8_t *val) in nvlist_lookup_int8() argument
1682 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT8, NULL, val)); in nvlist_lookup_int8()
1686 nvlist_lookup_uint8(const nvlist_t *nvl, const char *name, uint8_t *val) in nvlist_lookup_uint8() argument
1688 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT8, NULL, val)); in nvlist_lookup_uint8()
1692 nvlist_lookup_int16(const nvlist_t *nvl, const char *name, int16_t *val) in nvlist_lookup_int16() argument
1694 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT16, NULL, val)); in nvlist_lookup_int16()
1698 nvlist_lookup_uint16(const nvlist_t *nvl, const char *name, uint16_t *val) in nvlist_lookup_uint16() argument
1700 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT16, NULL, val)); in nvlist_lookup_uint16()
1704 nvlist_lookup_int32(const nvlist_t *nvl, const char *name, int32_t *val) in nvlist_lookup_int32() argument
1706 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT32, NULL, val)); in nvlist_lookup_int32()
1710 nvlist_lookup_uint32(const nvlist_t *nvl, const char *name, uint32_t *val) in nvlist_lookup_uint32() argument
1712 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT32, NULL, val)); in nvlist_lookup_uint32()
1716 nvlist_lookup_int64(const nvlist_t *nvl, const char *name, int64_t *val) in nvlist_lookup_int64() argument
1718 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT64, NULL, val)); in nvlist_lookup_int64()
1722 nvlist_lookup_uint64(const nvlist_t *nvl, const char *name, uint64_t *val) in nvlist_lookup_uint64() argument
1724 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT64, NULL, val)); in nvlist_lookup_uint64()
1729 nvlist_lookup_double(const nvlist_t *nvl, const char *name, double *val) in nvlist_lookup_double() argument
1731 return (nvlist_lookup_common(nvl, name, DATA_TYPE_DOUBLE, NULL, val)); in nvlist_lookup_double()
1736 nvlist_lookup_string(const nvlist_t *nvl, const char *name, const char **val) in nvlist_lookup_string() argument
1738 return (nvlist_lookup_common(nvl, name, DATA_TYPE_STRING, NULL, val)); in nvlist_lookup_string()
1742 nvlist_lookup_nvlist(nvlist_t *nvl, const char *name, nvlist_t **val) in nvlist_lookup_nvlist() argument
1744 return (nvlist_lookup_common(nvl, name, DATA_TYPE_NVLIST, NULL, val)); in nvlist_lookup_nvlist()
1748 nvlist_lookup_boolean_array(nvlist_t *nvl, const char *name, in nvlist_lookup_boolean_array() argument
1751 return (nvlist_lookup_common(nvl, name, in nvlist_lookup_boolean_array()
1756 nvlist_lookup_byte_array(nvlist_t *nvl, const char *name, in nvlist_lookup_byte_array() argument
1759 return (nvlist_lookup_common(nvl, name, DATA_TYPE_BYTE_ARRAY, n, a)); in nvlist_lookup_byte_array()
1763 nvlist_lookup_int8_array(nvlist_t *nvl, const char *name, int8_t **a, uint_t *n) in nvlist_lookup_int8_array() argument
1765 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT8_ARRAY, n, a)); in nvlist_lookup_int8_array()
1769 nvlist_lookup_uint8_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint8_array() argument
1772 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT8_ARRAY, n, a)); in nvlist_lookup_uint8_array()
1776 nvlist_lookup_int16_array(nvlist_t *nvl, const char *name, in nvlist_lookup_int16_array() argument
1779 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT16_ARRAY, n, a)); in nvlist_lookup_int16_array()
1783 nvlist_lookup_uint16_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint16_array() argument
1786 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT16_ARRAY, n, a)); in nvlist_lookup_uint16_array()
1790 nvlist_lookup_int32_array(nvlist_t *nvl, const char *name, in nvlist_lookup_int32_array() argument
1793 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT32_ARRAY, n, a)); in nvlist_lookup_int32_array()
1797 nvlist_lookup_uint32_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint32_array() argument
1800 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT32_ARRAY, n, a)); in nvlist_lookup_uint32_array()
1804 nvlist_lookup_int64_array(nvlist_t *nvl, const char *name, in nvlist_lookup_int64_array() argument
1807 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT64_ARRAY, n, a)); in nvlist_lookup_int64_array()
1811 nvlist_lookup_uint64_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint64_array() argument
1814 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT64_ARRAY, n, a)); in nvlist_lookup_uint64_array()
1818 nvlist_lookup_string_array(nvlist_t *nvl, const char *name, in nvlist_lookup_string_array() argument
1821 return (nvlist_lookup_common(nvl, name, DATA_TYPE_STRING_ARRAY, n, a)); in nvlist_lookup_string_array()
1825 nvlist_lookup_nvlist_array(nvlist_t *nvl, const char *name, in nvlist_lookup_nvlist_array() argument
1828 return (nvlist_lookup_common(nvl, name, DATA_TYPE_NVLIST_ARRAY, n, a)); in nvlist_lookup_nvlist_array()
1832 nvlist_lookup_hrtime(nvlist_t *nvl, const char *name, hrtime_t *val) in nvlist_lookup_hrtime() argument
1834 return (nvlist_lookup_common(nvl, name, DATA_TYPE_HRTIME, NULL, val)); in nvlist_lookup_hrtime()
1838 nvlist_lookup_pairs(nvlist_t *nvl, int flag, ...) in nvlist_lookup_pairs() argument
1853 ret = nvlist_lookup_common(nvl, name, type, NULL, NULL); in nvlist_lookup_pairs()
1873 ret = nvlist_lookup_common(nvl, name, type, NULL, val); in nvlist_lookup_pairs()
1890 ret = nvlist_lookup_common(nvl, name, type, nelem, val); in nvlist_lookup_pairs()
1921 nvlist_lookup_nvpair_ei_sep(nvlist_t *nvl, const char *name, const char sep, in nvlist_lookup_nvpair_ei_sep() argument
1937 if ((nvl == NULL) || (name == NULL)) in nvlist_lookup_nvpair_ei_sep()
1945 if (!(nvl->nvl_nvflag & NV_UNIQUE_NAME)) in nvlist_lookup_nvpair_ei_sep()
2029 for (nvp = nvlist_next_nvpair(nvl, NULL); nvp != NULL; in nvlist_lookup_nvpair_ei_sep()
2030 nvp = nvlist_next_nvpair(nvl, nvp)) { in nvlist_lookup_nvpair_ei_sep()
2059 nvl = EMBEDDED_NVL(nvp); in nvlist_lookup_nvpair_ei_sep()
2069 nvl = nva[idx]; in nvlist_lookup_nvpair_ei_sep()
2091 nvlist_lookup_nvpair(nvlist_t *nvl, const char *name, nvpair_t **ret) in nvlist_lookup_nvpair() argument
2093 return (nvlist_lookup_nvpair_ei_sep(nvl, name, 0, ret, NULL, NULL)); in nvlist_lookup_nvpair()
2101 int nvlist_lookup_nvpair_embedded_index(nvlist_t *nvl, in nvlist_lookup_nvpair_embedded_index() argument
2104 return (nvlist_lookup_nvpair_ei_sep(nvl, name, '.', ret, ip, ep)); in nvlist_lookup_nvpair_embedded_index()
2108 nvlist_exists(const nvlist_t *nvl, const char *name) in nvlist_exists() argument
2114 if (name == NULL || nvl == NULL || in nvlist_exists()
2115 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_exists()
2290 nvlist_add_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvlist_add_nvpair() argument
2292 if (nvl == NULL || nvp == NULL) in nvlist_add_nvpair()
2295 return (nvlist_add_common(nvl, NVP_NAME(nvp), NVP_TYPE(nvp), in nvlist_add_nvpair()
2306 nvlist_merge(nvlist_t *dst, nvlist_t *nvl, int flag) in nvlist_merge() argument
2310 if (nvl == NULL || dst == NULL) in nvlist_merge()
2313 if (dst != nvl) in nvlist_merge()
2314 return (nvlist_copy_pairs(nvl, dst)); in nvlist_merge()
2371 nvs_encode_pairs(nvstream_t *nvs, nvlist_t *nvl) in nvs_encode_pairs() argument
2373 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvs_encode_pairs()
2387 nvs_decode_pairs(nvstream_t *nvs, nvlist_t *nvl) in nvs_decode_pairs() argument
2405 if ((nvp = nvp_buf_alloc(nvl, nvsize)) == NULL) in nvs_decode_pairs()
2409 nvp_buf_free(nvl, nvp); in nvs_decode_pairs()
2415 nvp_buf_free(nvl, nvp); in nvs_decode_pairs()
2419 err = nvt_add_nvpair(nvl, nvp); in nvs_decode_pairs()
2422 nvp_buf_free(nvl, nvp); in nvs_decode_pairs()
2425 nvp_buf_link(nvl, nvp); in nvs_decode_pairs()
2431 nvs_getsize_pairs(nvstream_t *nvs, nvlist_t *nvl, size_t *buflen) in nvs_getsize_pairs() argument
2433 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvs_getsize_pairs()
2454 nvs_operation(nvstream_t *nvs, nvlist_t *nvl, size_t *buflen) in nvs_operation() argument
2458 if (nvl->nvl_priv == 0) in nvs_operation()
2464 if ((err = nvs->nvs_ops->nvs_nvlist(nvs, nvl, buflen)) != 0) in nvs_operation()
2469 err = nvs_encode_pairs(nvs, nvl); in nvs_operation()
2473 err = nvs_decode_pairs(nvs, nvl); in nvs_operation()
2477 err = nvs_getsize_pairs(nvs, nvl, buflen); in nvs_operation()
2590 nvlist_common(nvlist_t *nvl, char *buf, size_t *buflen, int encoding, in nvlist_common() argument
2605 if (buflen == NULL || nvl == NULL || in nvlist_common()
2606 (nvs.nvs_priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_common()
2663 err = nvs_native(&nvs, nvl, buf, buflen); in nvlist_common()
2666 err = nvs_xdr(&nvs, nvl, buf, buflen); in nvlist_common()
2677 nvlist_size(nvlist_t *nvl, size_t *size, int encoding) in nvlist_size() argument
2679 return (nvlist_common(nvl, NULL, size, encoding, NVS_OP_GETSIZE)); in nvlist_size()
2686 nvlist_pack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding, in nvlist_pack() argument
2689 return (nvlist_xpack(nvl, bufp, buflen, encoding, in nvlist_pack()
2694 nvlist_xpack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding, in nvlist_xpack() argument
2702 if (nva == NULL || nvl == NULL || bufp == NULL || buflen == NULL) in nvlist_xpack()
2706 return (nvlist_common(nvl, *bufp, buflen, encoding, in nvlist_xpack()
2723 if ((err = nvlist_size(nvl, &alloc_size, encoding))) in nvlist_xpack()
2729 if ((err = nvlist_common(nvl, buf, &alloc_size, encoding, in nvlist_xpack()
2752 nvlist_t *nvl; in nvlist_xunpack() local
2758 if ((err = nvlist_xalloc(&nvl, 0, nva)) != 0) in nvlist_xunpack()
2761 if ((err = nvlist_common(nvl, buf, &buflen, NV_ENCODE_NATIVE, in nvlist_xunpack()
2763 nvlist_free(nvl); in nvlist_xunpack()
2765 *nvlp = nvl; in nvlist_xunpack()
2850 nvs_native_nvlist(nvstream_t *nvs, nvlist_t *nvl, size_t *size) in nvs_native_nvlist() argument
2863 if (native_cp(nvs, &nvl->nvl_version, sizeof (int32_t)) != 0 || in nvs_native_nvlist()
2864 native_cp(nvs, &nvl->nvl_nvflag, sizeof (int32_t)) != 0) in nvs_native_nvlist()
3129 nvs_native(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen) in nvs_native() argument
3140 err = nvs_operation(nvs, nvl, buflen); in nvs_native()
3205 nvs_xdr_nvlist(nvstream_t *nvs, nvlist_t *nvl, size_t *size) in nvs_xdr_nvlist() argument
3212 if (!xdr_int(xdr, &nvl->nvl_version) || in nvs_xdr_nvlist()
3213 !xdr_u_int(xdr, &nvl->nvl_nvflag)) in nvs_xdr_nvlist()
3666 nvs_xdr(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen) in nvs_xdr() argument
3677 err = nvs_operation(nvs, nvl, buflen); in nvs_xdr()