diff options
Diffstat (limited to 'module/nvpair')
-rw-r--r-- | module/nvpair/fnvpair.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/module/nvpair/fnvpair.c b/module/nvpair/fnvpair.c index 7faea0fce..a91b9524d 100644 --- a/module/nvpair/fnvpair.c +++ b/module/nvpair/fnvpair.c @@ -26,6 +26,7 @@ #include <sys/nvpair.h> #include <sys/kmem.h> #include <sys/debug.h> +#include <sys/param.h> #ifndef _KERNEL #include <stdlib.h> #endif @@ -114,6 +115,18 @@ fnvlist_merge(nvlist_t *dst, nvlist_t *src) VERIFY0(nvlist_merge(dst, src, KM_SLEEP)); } +size_t +fnvlist_num_pairs(nvlist_t *nvl) +{ + size_t count = 0; + nvpair_t *pair; + + for (pair = nvlist_next_nvpair(nvl, 0); pair != NULL; + pair = nvlist_next_nvpair(nvl, pair)) + count++; + return (count); +} + void fnvlist_add_boolean(nvlist_t *nvl, const char *name) { @@ -563,5 +576,6 @@ EXPORT_SYMBOL(fnvpair_value_int64); EXPORT_SYMBOL(fnvpair_value_uint64); EXPORT_SYMBOL(fnvpair_value_string); EXPORT_SYMBOL(fnvpair_value_nvlist); +EXPORT_SYMBOL(fnvlist_num_pairs); #endif |