MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nvpair_create_nvlist

Function nvpair_create_nvlist

freebsd/contrib/libnv/bsd_nvpair.c:1248–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1246}
1247
1248nvpair_t *
1249nvpair_create_nvlist(const char *name, const nvlist_t *value)
1250{
1251 nvlist_t *nvl;
1252 nvpair_t *nvp;
1253
1254 if (value == NULL) {
1255 ERRNO_SET(EINVAL);
1256 return (NULL);
1257 }
1258
1259 nvl = nvlist_clone(value);
1260 if (nvl == NULL)
1261 return (NULL);
1262
1263 nvp = nvpair_allocv(name, NV_TYPE_NVLIST, (uint64_t)(uintptr_t)nvl, 0,
1264 0);
1265 if (nvp == NULL)
1266 nvlist_destroy(nvl);
1267 else
1268 nvlist_set_parent(nvl, nvp);
1269
1270 return (nvp);
1271}
1272
1273#ifndef _KERNEL
1274nvpair_t *

Callers 1

nvpair_cloneFunction · 0.85

Calls 4

nvlist_cloneFunction · 0.85
nvpair_allocvFunction · 0.85
nvlist_destroyFunction · 0.85
nvlist_set_parentFunction · 0.85

Tested by

no test coverage detected