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

Function nvpair_move_nvlist

freebsd/contrib/libnv/bsd_nvpair.c:1560–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1558}
1559
1560nvpair_t *
1561nvpair_move_nvlist(const char *name, nvlist_t *value)
1562{
1563 nvpair_t *nvp;
1564
1565 if (value == NULL || nvlist_get_nvpair_parent(value) != NULL) {
1566 ERRNO_SET(EINVAL);
1567 return (NULL);
1568 }
1569
1570 if (nvlist_error(value) != 0) {
1571 ERRNO_SET(nvlist_error(value));
1572 nvlist_destroy(value);
1573 return (NULL);
1574 }
1575
1576 nvp = nvpair_allocv(name, NV_TYPE_NVLIST, (uint64_t)(uintptr_t)value,
1577 0, 0);
1578 if (nvp == NULL)
1579 nvlist_destroy(value);
1580 else
1581 nvlist_set_parent(value, nvp);
1582
1583 return (nvp);
1584}
1585
1586#ifndef _KERNEL
1587nvpair_t *

Callers 1

nvlist_move_nvlistFunction · 0.85

Calls 5

nvlist_get_nvpair_parentFunction · 0.85
nvlist_errorFunction · 0.85
nvlist_destroyFunction · 0.85
nvpair_allocvFunction · 0.85
nvlist_set_parentFunction · 0.85

Tested by

no test coverage detected