diff options
author | Christian S.J. Peron <csjp@FreeBSD.org> | 2005-09-06 00:06:30 +0000 |
---|---|---|
committer | Christian S.J. Peron <csjp@FreeBSD.org> | 2005-09-06 00:06:30 +0000 |
commit | d1dfd921774f005fd7f28558bacd6836ea5297f5 (patch) | |
tree | d8b5c8f0b1af634da8bde1ba95b01d4ecb762d4a /sys/kern/vfs_acl.c | |
parent | fa973e67a4d08b5feb7fabf0a023cc42687c5392 (diff) | |
download | src-d1dfd921774f005fd7f28558bacd6836ea5297f5.tar.gz src-d1dfd921774f005fd7f28558bacd6836ea5297f5.zip |
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
Notes
Notes:
svn path=/head/; revision=149811
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 7beca5c29831..f238b9859834 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) |