aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/zap.h
diff options
context:
space:
mode:
authorSanjeev Bagewadi <[email protected]>2021-02-02 13:54:15 +0000
committerBrian Behlendorf <[email protected]>2024-10-01 13:39:08 -0700
commit3cf2bfa57008af7f0690f73491d7f9b4ac4ed65a (patch)
treeb92ca0e4bcf693c3b6f6df68c1995dcc4dfe5e63 /include/sys/zap.h
parent141368a4b6da039cefb745f6219d15b71e38326c (diff)
Allocate zap_attribute_t from kmem instead of stack
This patch is preparatory work for long name feature. It changes all users of zap_attribute_t to allocate it from kmem instead of stack. It also make zap_attribute_t and zap_name_t structure variable length. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #15921
Diffstat (limited to 'include/sys/zap.h')
-rw-r--r--include/sys/zap.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/sys/zap.h b/include/sys/zap.h
index 0027f7c51..ec37c3447 100644
--- a/include/sys/zap.h
+++ b/include/sys/zap.h
@@ -376,9 +376,19 @@ typedef struct {
boolean_t za_normalization_conflict;
uint64_t za_num_integers;
uint64_t za_first_integer; /* no sign extension for <8byte ints */
- char za_name[ZAP_MAXNAMELEN];
+ uint32_t za_name_len;
+ char za_name[];
} zap_attribute_t;
+void zap_init(void);
+void zap_fini(void);
+
+/*
+ * Alloc and free zap_attribute_t.
+ */
+zap_attribute_t *zap_attribute_alloc(void);
+void zap_attribute_free(zap_attribute_t *attrp);
+
/*
* The interface for listing all the attributes of a zapobj can be
* thought of as cursor moving down a list of the attributes one by