From 33e564c762c6b0bcdfa170e4b47150b5c02828b1 Mon Sep 17 00:00:00 2001 From: csjp Date: Tue, 6 Sep 2005 00:06:30 +0000 Subject: Convert the primary ACL allocator from malloc(9) to using a UMA zone instead. Also introduce an aclinit function which will be used to create the UMA zone for use by file systems at system start up. MFC after: 1 month Discussed with: rwatson --- sys/kern/kern_acl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_acl.c') diff --git a/sys/kern/kern_acl.c b/sys/kern/kern_acl.c index 7beca5c..f238b98 100644 --- a/sys/kern/kern_acl.c +++ b/sys/kern/kern_acl.c @@ -53,8 +53,9 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ACL, "acl", "access control list"); +#include +uma_zone_t acl_zone; static int vacl_set_acl(struct thread *td, struct vnode *vp, acl_type_t type, struct acl *aclp); static int vacl_get_acl(struct thread *td, struct vnode *vp, @@ -1021,3 +1022,14 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) mtx_unlock(&Giant); return (error); } + +/* ARGUSED */ + +static void +aclinit(void *dummy __unused) +{ + + acl_zone = uma_zcreate("ACL UMA zone", sizeof(struct acl), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); +} +SYSINIT(acls, SI_SUB_ACL, SI_ORDER_FIRST, aclinit, NULL) -- cgit v1.1