mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Chunwei Chen <david.chen@nutanix.com> Closes #15921
This commit is contained in:
committed by
Brian Behlendorf
parent
141368a4b6
commit
3cf2bfa570
+11
-1
@@ -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
|
||||
|
||||
@@ -191,7 +191,8 @@ typedef struct zap_name {
|
||||
uint64_t zn_hash;
|
||||
matchtype_t zn_matchtype;
|
||||
int zn_normflags;
|
||||
char zn_normbuf[ZAP_MAXNAMELEN];
|
||||
int zn_normbuf_len;
|
||||
char zn_normbuf[];
|
||||
} zap_name_t;
|
||||
|
||||
#define zap_f zap_u.zap_fat
|
||||
|
||||
Reference in New Issue
Block a user