Lines Matching refs:nvl

130 static int nvlist_add_common(nvlist_t *nvl, const char *name, data_type_t type,
174 nvlist_lookup_nv_alloc(nvlist_t *nvl) in nvlist_lookup_nv_alloc() argument
178 if (nvl == NULL || in nvlist_lookup_nv_alloc()
179 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_lookup_nv_alloc()
250 nvlist_init(nvlist_t *nvl, uint32_t nvflag, nvpriv_t *priv) in nvlist_init() argument
252 nvl->nvl_version = NV_VERSION; in nvlist_init()
253 nvl->nvl_nvflag = nvflag & (NV_UNIQUE_NAME|NV_UNIQUE_NAME_TYPE); in nvlist_init()
254 nvl->nvl_priv = (uint64_t)(uintptr_t)priv; in nvlist_init()
255 nvl->nvl_flag = 0; in nvlist_init()
256 nvl->nvl_pad = 0; in nvlist_init()
260 nvlist_nvflag(nvlist_t *nvl) in nvlist_nvflag() argument
262 return (nvl->nvl_nvflag); in nvlist_nvflag()
306 nvp_buf_alloc(nvlist_t *nvl, size_t len) in nvp_buf_alloc() argument
308 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_alloc()
331 nvp_buf_free(nvlist_t *nvl, nvpair_t *nvp) in nvp_buf_free() argument
333 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_free()
343 nvp_buf_link(nvlist_t *nvl, nvpair_t *nvp) in nvp_buf_link() argument
345 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_link()
362 nvp_buf_unlink(nvlist_t *nvl, nvpair_t *nvp) in nvp_buf_unlink() argument
364 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvp_buf_unlink()
556 nvlist_free(nvlist_t *nvl) in nvlist_free() argument
561 if (nvl == NULL || in nvlist_free()
562 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_free()
574 nvp_buf_free(nvl, nvp); in nvlist_free()
578 nv_mem_free(priv, nvl, NV_ALIGN(sizeof (nvlist_t))); in nvlist_free()
580 nvl->nvl_priv = 0; in nvlist_free()
586 nvlist_contains_nvp(nvlist_t *nvl, nvpair_t *nvp) in nvlist_contains_nvp() argument
588 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvlist_contains_nvp()
606 nvlist_dup(nvlist_t *nvl, nvlist_t **nvlp, int kmflag) in nvlist_dup() argument
609 return (nvlist_xdup(nvl, nvlp, in nvlist_dup()
612 return (nvlist_xdup(nvl, nvlp, nv_alloc_nosleep)); in nvlist_dup()
617 nvlist_xdup(nvlist_t *nvl, nvlist_t **nvlp, nv_alloc_t *nva) in nvlist_xdup() argument
622 if (nvl == NULL || nvlp == NULL) in nvlist_xdup()
625 if ((err = nvlist_xalloc(&ret, nvl->nvl_nvflag, nva)) != 0) in nvlist_xdup()
628 if ((err = nvlist_copy_pairs(nvl, ret)) != 0) in nvlist_xdup()
640 nvlist_remove_all(nvlist_t *nvl, const char *name) in nvlist_remove_all() argument
646 if (nvl == NULL || name == NULL || in nvlist_remove_all()
647 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_remove_all()
658 nvp_buf_unlink(nvl, nvp); in nvlist_remove_all()
660 nvp_buf_free(nvl, nvp); in nvlist_remove_all()
672 nvlist_remove(nvlist_t *nvl, const char *name, data_type_t type) in nvlist_remove() argument
677 if (nvl == NULL || name == NULL || in nvlist_remove()
678 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_remove()
686 nvp_buf_unlink(nvl, nvp); in nvlist_remove()
688 nvp_buf_free(nvl, nvp); in nvlist_remove()
699 nvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvlist_remove_nvpair() argument
701 if (nvl == NULL || nvp == NULL) in nvlist_remove_nvpair()
704 nvp_buf_unlink(nvl, nvp); in nvlist_remove_nvpair()
706 nvp_buf_free(nvl, nvp); in nvlist_remove_nvpair()
835 nvlist_copy_embedded(nvlist_t *nvl, nvlist_t *onvl, nvlist_t *emb_nvl) in nvlist_copy_embedded() argument
841 nvl->nvl_priv)) == NULL) in nvlist_copy_embedded()
858 nvlist_add_common(nvlist_t *nvl, const char *name, in nvlist_add_common() argument
867 if (name == NULL || nvl == NULL || nvl->nvl_priv == 0) in nvlist_add_common()
891 if (data == nvl || data == NULL) in nvlist_add_common()
897 if (onvlp[i] == nvl || onvlp[i] == NULL) in nvlist_add_common()
911 if ((nvp = nvp_buf_alloc(nvl, nvp_sz)) == NULL) in nvlist_add_common()
942 if ((err = nvlist_copy_embedded(nvl, onvl, nnvl)) != 0) { in nvlist_add_common()
943 nvp_buf_free(nvl, nvp); in nvlist_add_common()
955 if ((err = nvlist_copy_embedded(nvl, in nvlist_add_common()
961 nvp_buf_free(nvl, nvp); in nvlist_add_common()
974 if (nvl->nvl_nvflag & NV_UNIQUE_NAME) in nvlist_add_common()
975 (void) nvlist_remove_all(nvl, name); in nvlist_add_common()
976 else if (nvl->nvl_nvflag & NV_UNIQUE_NAME_TYPE) in nvlist_add_common()
977 (void) nvlist_remove(nvl, name, type); in nvlist_add_common()
979 nvp_buf_link(nvl, nvp); in nvlist_add_common()
985 nvlist_add_boolean(nvlist_t *nvl, const char *name) in nvlist_add_boolean() argument
987 return (nvlist_add_common(nvl, name, DATA_TYPE_BOOLEAN, 0, NULL)); in nvlist_add_boolean()
991 nvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val) in nvlist_add_boolean_value() argument
993 return (nvlist_add_common(nvl, name, DATA_TYPE_BOOLEAN_VALUE, 1, &val)); in nvlist_add_boolean_value()
997 nvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val) in nvlist_add_byte() argument
999 return (nvlist_add_common(nvl, name, DATA_TYPE_BYTE, 1, &val)); in nvlist_add_byte()
1003 nvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val) in nvlist_add_int8() argument
1005 return (nvlist_add_common(nvl, name, DATA_TYPE_INT8, 1, &val)); in nvlist_add_int8()
1009 nvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val) in nvlist_add_uint8() argument
1011 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT8, 1, &val)); in nvlist_add_uint8()
1015 nvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val) in nvlist_add_int16() argument
1017 return (nvlist_add_common(nvl, name, DATA_TYPE_INT16, 1, &val)); in nvlist_add_int16()
1021 nvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val) in nvlist_add_uint16() argument
1023 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT16, 1, &val)); in nvlist_add_uint16()
1027 nvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val) in nvlist_add_int32() argument
1029 return (nvlist_add_common(nvl, name, DATA_TYPE_INT32, 1, &val)); in nvlist_add_int32()
1033 nvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val) in nvlist_add_uint32() argument
1035 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT32, 1, &val)); in nvlist_add_uint32()
1039 nvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val) in nvlist_add_int64() argument
1041 return (nvlist_add_common(nvl, name, DATA_TYPE_INT64, 1, &val)); in nvlist_add_int64()
1045 nvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val) in nvlist_add_uint64() argument
1047 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT64, 1, &val)); in nvlist_add_uint64()
1052 nvlist_add_double(nvlist_t *nvl, const char *name, double val) in nvlist_add_double() argument
1054 return (nvlist_add_common(nvl, name, DATA_TYPE_DOUBLE, 1, &val)); in nvlist_add_double()
1059 nvlist_add_string(nvlist_t *nvl, const char *name, const char *val) in nvlist_add_string() argument
1061 return (nvlist_add_common(nvl, name, DATA_TYPE_STRING, 1, (void *)val)); in nvlist_add_string()
1065 nvlist_add_boolean_array(nvlist_t *nvl, const char *name, in nvlist_add_boolean_array() argument
1068 return (nvlist_add_common(nvl, name, DATA_TYPE_BOOLEAN_ARRAY, n, a)); in nvlist_add_boolean_array()
1072 nvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *a, uint_t n) in nvlist_add_byte_array() argument
1074 return (nvlist_add_common(nvl, name, DATA_TYPE_BYTE_ARRAY, n, a)); in nvlist_add_byte_array()
1078 nvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *a, uint_t n) in nvlist_add_int8_array() argument
1080 return (nvlist_add_common(nvl, name, DATA_TYPE_INT8_ARRAY, n, a)); in nvlist_add_int8_array()
1084 nvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *a, uint_t n) in nvlist_add_uint8_array() argument
1086 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT8_ARRAY, n, a)); in nvlist_add_uint8_array()
1090 nvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *a, uint_t n) in nvlist_add_int16_array() argument
1092 return (nvlist_add_common(nvl, name, DATA_TYPE_INT16_ARRAY, n, a)); in nvlist_add_int16_array()
1096 nvlist_add_uint16_array(nvlist_t *nvl, const char *name, uint16_t *a, uint_t n) in nvlist_add_uint16_array() argument
1098 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT16_ARRAY, n, a)); in nvlist_add_uint16_array()
1102 nvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *a, uint_t n) in nvlist_add_int32_array() argument
1104 return (nvlist_add_common(nvl, name, DATA_TYPE_INT32_ARRAY, n, a)); in nvlist_add_int32_array()
1108 nvlist_add_uint32_array(nvlist_t *nvl, const char *name, uint32_t *a, uint_t n) in nvlist_add_uint32_array() argument
1110 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT32_ARRAY, n, a)); in nvlist_add_uint32_array()
1114 nvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *a, uint_t n) in nvlist_add_int64_array() argument
1116 return (nvlist_add_common(nvl, name, DATA_TYPE_INT64_ARRAY, n, a)); in nvlist_add_int64_array()
1120 nvlist_add_uint64_array(nvlist_t *nvl, const char *name, uint64_t *a, uint_t n) in nvlist_add_uint64_array() argument
1122 return (nvlist_add_common(nvl, name, DATA_TYPE_UINT64_ARRAY, n, a)); in nvlist_add_uint64_array()
1126 nvlist_add_string_array(nvlist_t *nvl, const char *name, in nvlist_add_string_array() argument
1129 return (nvlist_add_common(nvl, name, DATA_TYPE_STRING_ARRAY, n, a)); in nvlist_add_string_array()
1133 nvlist_add_hrtime(nvlist_t *nvl, const char *name, hrtime_t val) in nvlist_add_hrtime() argument
1135 return (nvlist_add_common(nvl, name, DATA_TYPE_HRTIME, 1, &val)); in nvlist_add_hrtime()
1139 nvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val) in nvlist_add_nvlist() argument
1141 return (nvlist_add_common(nvl, name, DATA_TYPE_NVLIST, 1, val)); in nvlist_add_nvlist()
1145 nvlist_add_nvlist_array(nvlist_t *nvl, const char *name, nvlist_t **a, uint_t n) in nvlist_add_nvlist_array() argument
1147 return (nvlist_add_common(nvl, name, DATA_TYPE_NVLIST_ARRAY, n, a)); in nvlist_add_nvlist_array()
1152 nvlist_next_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvlist_next_nvpair() argument
1157 if (nvl == NULL || in nvlist_next_nvpair()
1158 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_next_nvpair()
1170 else if (priv->nvp_curr == curr || nvlist_contains_nvp(nvl, nvp)) in nvlist_next_nvpair()
1181 nvlist_prev_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvlist_prev_nvpair() argument
1186 if (nvl == NULL || in nvlist_prev_nvpair()
1187 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_prev_nvpair()
1194 else if (priv->nvp_curr == curr || nvlist_contains_nvp(nvl, nvp)) in nvlist_prev_nvpair()
1205 nvlist_empty(nvlist_t *nvl) in nvlist_empty() argument
1209 if (nvl == NULL || in nvlist_empty()
1210 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_empty()
1324 nvlist_lookup_common(nvlist_t *nvl, const char *name, data_type_t type, in nvlist_lookup_common() argument
1331 if (name == NULL || nvl == NULL || in nvlist_lookup_common()
1332 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_lookup_common()
1335 if (!(nvl->nvl_nvflag & (NV_UNIQUE_NAME | NV_UNIQUE_NAME_TYPE))) in nvlist_lookup_common()
1349 nvlist_lookup_boolean(nvlist_t *nvl, const char *name) in nvlist_lookup_boolean() argument
1351 return (nvlist_lookup_common(nvl, name, DATA_TYPE_BOOLEAN, NULL, NULL)); in nvlist_lookup_boolean()
1355 nvlist_lookup_boolean_value(nvlist_t *nvl, const char *name, boolean_t *val) in nvlist_lookup_boolean_value() argument
1357 return (nvlist_lookup_common(nvl, name, in nvlist_lookup_boolean_value()
1362 nvlist_lookup_byte(nvlist_t *nvl, const char *name, uchar_t *val) in nvlist_lookup_byte() argument
1364 return (nvlist_lookup_common(nvl, name, DATA_TYPE_BYTE, NULL, val)); in nvlist_lookup_byte()
1368 nvlist_lookup_int8(nvlist_t *nvl, const char *name, int8_t *val) in nvlist_lookup_int8() argument
1370 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT8, NULL, val)); in nvlist_lookup_int8()
1374 nvlist_lookup_uint8(nvlist_t *nvl, const char *name, uint8_t *val) in nvlist_lookup_uint8() argument
1376 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT8, NULL, val)); in nvlist_lookup_uint8()
1380 nvlist_lookup_int16(nvlist_t *nvl, const char *name, int16_t *val) in nvlist_lookup_int16() argument
1382 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT16, NULL, val)); in nvlist_lookup_int16()
1386 nvlist_lookup_uint16(nvlist_t *nvl, const char *name, uint16_t *val) in nvlist_lookup_uint16() argument
1388 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT16, NULL, val)); in nvlist_lookup_uint16()
1392 nvlist_lookup_int32(nvlist_t *nvl, const char *name, int32_t *val) in nvlist_lookup_int32() argument
1394 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT32, NULL, val)); in nvlist_lookup_int32()
1398 nvlist_lookup_uint32(nvlist_t *nvl, const char *name, uint32_t *val) in nvlist_lookup_uint32() argument
1400 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT32, NULL, val)); in nvlist_lookup_uint32()
1404 nvlist_lookup_int64(nvlist_t *nvl, const char *name, int64_t *val) in nvlist_lookup_int64() argument
1406 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT64, NULL, val)); in nvlist_lookup_int64()
1410 nvlist_lookup_uint64(nvlist_t *nvl, const char *name, uint64_t *val) in nvlist_lookup_uint64() argument
1412 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT64, NULL, val)); in nvlist_lookup_uint64()
1417 nvlist_lookup_double(nvlist_t *nvl, const char *name, double *val) in nvlist_lookup_double() argument
1419 return (nvlist_lookup_common(nvl, name, DATA_TYPE_DOUBLE, NULL, val)); in nvlist_lookup_double()
1424 nvlist_lookup_string(nvlist_t *nvl, const char *name, char **val) in nvlist_lookup_string() argument
1426 return (nvlist_lookup_common(nvl, name, DATA_TYPE_STRING, NULL, val)); in nvlist_lookup_string()
1430 nvlist_lookup_nvlist(nvlist_t *nvl, const char *name, nvlist_t **val) in nvlist_lookup_nvlist() argument
1432 return (nvlist_lookup_common(nvl, name, DATA_TYPE_NVLIST, NULL, val)); in nvlist_lookup_nvlist()
1436 nvlist_lookup_boolean_array(nvlist_t *nvl, const char *name, in nvlist_lookup_boolean_array() argument
1439 return (nvlist_lookup_common(nvl, name, in nvlist_lookup_boolean_array()
1444 nvlist_lookup_byte_array(nvlist_t *nvl, const char *name, in nvlist_lookup_byte_array() argument
1447 return (nvlist_lookup_common(nvl, name, DATA_TYPE_BYTE_ARRAY, n, a)); in nvlist_lookup_byte_array()
1451 nvlist_lookup_int8_array(nvlist_t *nvl, const char *name, int8_t **a, uint_t *n) in nvlist_lookup_int8_array() argument
1453 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT8_ARRAY, n, a)); in nvlist_lookup_int8_array()
1457 nvlist_lookup_uint8_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint8_array() argument
1460 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT8_ARRAY, n, a)); in nvlist_lookup_uint8_array()
1464 nvlist_lookup_int16_array(nvlist_t *nvl, const char *name, in nvlist_lookup_int16_array() argument
1467 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT16_ARRAY, n, a)); in nvlist_lookup_int16_array()
1471 nvlist_lookup_uint16_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint16_array() argument
1474 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT16_ARRAY, n, a)); in nvlist_lookup_uint16_array()
1478 nvlist_lookup_int32_array(nvlist_t *nvl, const char *name, in nvlist_lookup_int32_array() argument
1481 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT32_ARRAY, n, a)); in nvlist_lookup_int32_array()
1485 nvlist_lookup_uint32_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint32_array() argument
1488 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT32_ARRAY, n, a)); in nvlist_lookup_uint32_array()
1492 nvlist_lookup_int64_array(nvlist_t *nvl, const char *name, in nvlist_lookup_int64_array() argument
1495 return (nvlist_lookup_common(nvl, name, DATA_TYPE_INT64_ARRAY, n, a)); in nvlist_lookup_int64_array()
1499 nvlist_lookup_uint64_array(nvlist_t *nvl, const char *name, in nvlist_lookup_uint64_array() argument
1502 return (nvlist_lookup_common(nvl, name, DATA_TYPE_UINT64_ARRAY, n, a)); in nvlist_lookup_uint64_array()
1506 nvlist_lookup_string_array(nvlist_t *nvl, const char *name, in nvlist_lookup_string_array() argument
1509 return (nvlist_lookup_common(nvl, name, DATA_TYPE_STRING_ARRAY, n, a)); in nvlist_lookup_string_array()
1513 nvlist_lookup_nvlist_array(nvlist_t *nvl, const char *name, in nvlist_lookup_nvlist_array() argument
1516 return (nvlist_lookup_common(nvl, name, DATA_TYPE_NVLIST_ARRAY, n, a)); in nvlist_lookup_nvlist_array()
1520 nvlist_lookup_hrtime(nvlist_t *nvl, const char *name, hrtime_t *val) in nvlist_lookup_hrtime() argument
1522 return (nvlist_lookup_common(nvl, name, DATA_TYPE_HRTIME, NULL, val)); in nvlist_lookup_hrtime()
1526 nvlist_lookup_pairs(nvlist_t *nvl, int flag, ...) in nvlist_lookup_pairs() argument
1541 ret = nvlist_lookup_common(nvl, name, type, NULL, NULL); in nvlist_lookup_pairs()
1561 ret = nvlist_lookup_common(nvl, name, type, NULL, val); in nvlist_lookup_pairs()
1578 ret = nvlist_lookup_common(nvl, name, type, nelem, val); in nvlist_lookup_pairs()
1609 nvlist_lookup_nvpair_ei_sep(nvlist_t *nvl, const char *name, const char sep, in nvlist_lookup_nvpair_ei_sep() argument
1625 if ((nvl == NULL) || (name == NULL)) in nvlist_lookup_nvpair_ei_sep()
1631 if (!(nvl->nvl_nvflag & NV_UNIQUE_NAME)) in nvlist_lookup_nvpair_ei_sep()
1715 for (nvp = nvlist_next_nvpair(nvl, NULL); nvp != NULL; in nvlist_lookup_nvpair_ei_sep()
1716 nvp = nvlist_next_nvpair(nvl, nvp)) { in nvlist_lookup_nvpair_ei_sep()
1745 nvl = EMBEDDED_NVL(nvp); in nvlist_lookup_nvpair_ei_sep()
1752 nvl = nva[idx]; in nvlist_lookup_nvpair_ei_sep()
1774 nvlist_lookup_nvpair(nvlist_t *nvl, const char *name, nvpair_t **ret) in nvlist_lookup_nvpair() argument
1776 return (nvlist_lookup_nvpair_ei_sep(nvl, name, 0, ret, NULL, NULL)); in nvlist_lookup_nvpair()
1784 int nvlist_lookup_nvpair_embedded_index(nvlist_t *nvl, in nvlist_lookup_nvpair_embedded_index() argument
1787 return (nvlist_lookup_nvpair_ei_sep(nvl, name, '.', ret, ip, ep)); in nvlist_lookup_nvpair_embedded_index()
1791 nvlist_exists(nvlist_t *nvl, const char *name) in nvlist_exists() argument
1797 if (name == NULL || nvl == NULL || in nvlist_exists()
1798 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_exists()
1973 nvlist_add_nvpair(nvlist_t *nvl, nvpair_t *nvp) in nvlist_add_nvpair() argument
1975 if (nvl == NULL || nvp == NULL) in nvlist_add_nvpair()
1978 return (nvlist_add_common(nvl, NVP_NAME(nvp), NVP_TYPE(nvp), in nvlist_add_nvpair()
1990 nvlist_merge(nvlist_t *dst, nvlist_t *nvl, int flag) in nvlist_merge() argument
1992 if (nvl == NULL || dst == NULL) in nvlist_merge()
1995 if (dst != nvl) in nvlist_merge()
1996 return (nvlist_copy_pairs(nvl, dst)); in nvlist_merge()
2052 nvs_encode_pairs(nvstream_t *nvs, nvlist_t *nvl) in nvs_encode_pairs() argument
2054 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvs_encode_pairs()
2068 nvs_decode_pairs(nvstream_t *nvs, nvlist_t *nvl) in nvs_decode_pairs() argument
2086 if ((nvp = nvp_buf_alloc(nvl, nvsize)) == NULL) in nvs_decode_pairs()
2090 nvp_buf_free(nvl, nvp); in nvs_decode_pairs()
2096 nvp_buf_free(nvl, nvp); in nvs_decode_pairs()
2100 nvp_buf_link(nvl, nvp); in nvs_decode_pairs()
2106 nvs_getsize_pairs(nvstream_t *nvs, nvlist_t *nvl, size_t *buflen) in nvs_getsize_pairs() argument
2108 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvs_getsize_pairs()
2129 nvs_operation(nvstream_t *nvs, nvlist_t *nvl, size_t *buflen) in nvs_operation() argument
2133 if (nvl->nvl_priv == 0) in nvs_operation()
2139 if ((err = nvs->nvs_ops->nvs_nvlist(nvs, nvl, buflen)) != 0) in nvs_operation()
2144 err = nvs_encode_pairs(nvs, nvl); in nvs_operation()
2148 err = nvs_decode_pairs(nvs, nvl); in nvs_operation()
2152 err = nvs_getsize_pairs(nvs, nvl, buflen); in nvs_operation()
2252 nvlist_common(nvlist_t *nvl, char *buf, size_t *buflen, int encoding, in nvlist_common() argument
2265 if (buflen == NULL || nvl == NULL || in nvlist_common()
2266 (nvs.nvs_priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_common()
2320 err = nvs_native(&nvs, nvl, buf, buflen); in nvlist_common()
2323 err = nvs_xdr(&nvs, nvl, buf, buflen); in nvlist_common()
2334 nvlist_size(nvlist_t *nvl, size_t *size, int encoding) in nvlist_size() argument
2336 return (nvlist_common(nvl, NULL, size, encoding, NVS_OP_GETSIZE)); in nvlist_size()
2344 nvlist_pack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding, in nvlist_pack() argument
2348 return (nvlist_xpack(nvl, bufp, buflen, encoding, in nvlist_pack()
2351 return (nvlist_xpack(nvl, bufp, buflen, encoding, nv_alloc_nosleep)); in nvlist_pack()
2356 nvlist_xpack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding, in nvlist_xpack() argument
2364 if (nva == NULL || nvl == NULL || bufp == NULL || buflen == NULL) in nvlist_xpack()
2368 return (nvlist_common(nvl, *bufp, buflen, encoding, in nvlist_xpack()
2385 if (err = nvlist_size(nvl, &alloc_size, encoding)) in nvlist_xpack()
2391 if ((err = nvlist_common(nvl, buf, &alloc_size, encoding, in nvlist_xpack()
2420 nvlist_t *nvl; in nvlist_xunpack() local
2426 if ((err = nvlist_xalloc(&nvl, 0, nva)) != 0) in nvlist_xunpack()
2429 if ((err = nvlist_common(nvl, buf, &buflen, 0, NVS_OP_DECODE)) != 0) in nvlist_xunpack()
2430 nvlist_free(nvl); in nvlist_xunpack()
2432 *nvlp = nvl; in nvlist_xunpack()
2517 nvs_native_nvlist(nvstream_t *nvs, nvlist_t *nvl, size_t *size) in nvs_native_nvlist() argument
2530 if (native_cp(nvs, &nvl->nvl_version, sizeof (int32_t)) != 0 || in nvs_native_nvlist()
2531 native_cp(nvs, &nvl->nvl_nvflag, sizeof (int32_t)) != 0) in nvs_native_nvlist()
2794 nvs_native(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen) in nvs_native() argument
2805 err = nvs_operation(nvs, nvl, buflen); in nvs_native()
2870 nvs_xdr_nvlist(nvstream_t *nvs, nvlist_t *nvl, size_t *size) in nvs_xdr_nvlist() argument
2877 if (!xdr_int(xdr, &nvl->nvl_version) || in nvs_xdr_nvlist()
2878 !xdr_u_int(xdr, &nvl->nvl_nvflag)) in nvs_xdr_nvlist()
3281 nvs_xdr(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen) in nvs_xdr() argument
3292 err = nvs_operation(nvs, nvl, buflen); in nvs_xdr()