diff options
author | csjp <csjp@FreeBSD.org> | 2005-09-06 00:06:30 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2005-09-06 00:06:30 +0000 |
commit | 33e564c762c6b0bcdfa170e4b47150b5c02828b1 (patch) | |
tree | d8b5c8f0b1af634da8bde1ba95b01d4ecb762d4a /sys/kern/vfs_acl.c | |
parent | b1c29887f76142f408b1f0c6c42150b789e2f1f3 (diff) | |
download | FreeBSD-src-33e564c762c6b0bcdfa170e4b47150b5c02828b1.zip FreeBSD-src-33e564c762c6b0bcdfa170e4b47150b5c02828b1.tar.gz |
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
Diffstat (limited to 'sys/kern/vfs_acl.c')
-rw-r--r-- | sys/kern/vfs_acl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 7beca5c..f238b98 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -53,8 +53,9 @@ __FBSDID("$FreeBSD$"); #include <sys/stat.h> #include <sys/acl.h> -MALLOC_DEFINE(M_ACL, "acl", "access control list"); +#include <vm/uma.h> +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) |