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

Function nvpair_free

freebsd/contrib/openzfs/module/nvpair/nvpair.c:841–860  ·  view source on GitHub ↗

* Frees all memory allocated for an nvpair (like embedded lists) with * the exception of the nvpair buffer itself. */

Source from the content-addressed store, hash-verified

839 * the exception of the nvpair buffer itself.
840 */
841static void
842nvpair_free(nvpair_t *nvp)
843{
844 switch (NVP_TYPE(nvp)) {
845 case DATA_TYPE_NVLIST:
846 nvlist_free(EMBEDDED_NVL(nvp));
847 break;
848 case DATA_TYPE_NVLIST_ARRAY: {
849 nvlist_t **nvlp = EMBEDDED_NVL_ARRAY(nvp);
850 int i;
851
852 for (i = 0; i < NVP_NELEM(nvp); i++)
853 if (nvlp[i] != NULL)
854 nvlist_free(nvlp[i]);
855 break;
856 }
857 default:
858 break;
859 }
860}
861
862/*
863 * nvlist_free - free an unpacked nvlist

Callers 5

nvlist_freeFunction · 0.70
nvlist_remove_nvpairFunction · 0.70
nvlist_add_commonFunction · 0.70
nvs_decode_pairsFunction · 0.70
nvs_embedded_nvl_arrayFunction · 0.70

Calls 1

nvlist_freeFunction · 0.70

Tested by

no test coverage detected