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/ufs | |
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/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 8b72088..3c7d401 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -318,7 +318,7 @@ ufs_access(ap) #ifdef UFS_ACL if ((vp->v_mount->mnt_flag & MNT_ACLS) != 0) { - MALLOC(acl, struct acl *, sizeof(*acl), M_ACL, M_WAITOK); + acl = uma_zalloc(acl_zone, M_WAITOK); error = VOP_GETACL(vp, ACL_TYPE_ACCESS, acl, ap->a_cred, ap->a_td); switch (error) { @@ -342,7 +342,7 @@ ufs_access(ap) error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, ap->a_mode, ap->a_cred, NULL); } - FREE(acl, M_ACL); + uma_zfree(acl_zone, acl); } else #endif /* !UFS_ACL */ error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, @@ -1400,8 +1400,8 @@ ufs_mkdir(ap) #ifdef UFS_ACL acl = dacl = NULL; if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) { - MALLOC(acl, struct acl *, sizeof(*acl), M_ACL, M_WAITOK); - MALLOC(dacl, struct acl *, sizeof(*dacl), M_ACL, M_WAITOK); + acl = uma_zalloc(acl_zone, M_WAITOK); + dacl = uma_zalloc(acl_zone, M_WAITOK); /* * Retrieve default ACL from parent, if any. @@ -1431,16 +1431,16 @@ ufs_mkdir(ap) */ ip->i_mode = dmode; DIP_SET(ip, i_mode, dmode); - FREE(acl, M_ACL); - FREE(dacl, M_ACL); + uma_zfree(acl_zone, acl); + uma_zfree(acl_zone, dacl); dacl = acl = NULL; break; default: UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); - FREE(acl, M_ACL); - FREE(dacl, M_ACL); + uma_zfree(acl_zone, acl); + uma_zfree(acl_zone, dacl); return (error); } } else { @@ -1510,13 +1510,13 @@ ufs_mkdir(ap) break; default: - FREE(acl, M_ACL); - FREE(dacl, M_ACL); + uma_zfree(acl_zone, acl); + uma_zfree(acl_zone, dacl); dacl = acl = NULL; goto bad; } - FREE(acl, M_ACL); - FREE(dacl, M_ACL); + uma_zfree(acl_zone, acl); + uma_zfree(acl_zone, dacl); dacl = acl = NULL; } #endif /* !UFS_ACL */ @@ -1582,9 +1582,9 @@ bad: } else { #ifdef UFS_ACL if (acl != NULL) - FREE(acl, M_ACL); + uma_zfree(acl_zone, acl); if (dacl != NULL) - FREE(dacl, M_ACL); + uma_zfree(acl_zone, dacl); #endif dp->i_effnlink--; dp->i_nlink--; @@ -2231,7 +2231,7 @@ ufs_makeinode(mode, dvp, vpp, cnp) #ifdef UFS_ACL acl = NULL; if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) { - MALLOC(acl, struct acl *, sizeof(*acl), M_ACL, M_WAITOK); + acl = uma_zalloc(acl_zone, M_WAITOK); /* * Retrieve default ACL for parent, if any. @@ -2266,14 +2266,14 @@ ufs_makeinode(mode, dvp, vpp, cnp) */ ip->i_mode = mode; DIP_SET(ip, i_mode, mode); - FREE(acl, M_ACL); + uma_zfree(acl_zone, acl); acl = NULL; break; default: UFS_VFREE(tvp, ip->i_number, mode); vput(tvp); - FREE(acl, M_ACL); + uma_zfree(acl_zone, acl); acl = NULL; return (error); } @@ -2339,10 +2339,10 @@ ufs_makeinode(mode, dvp, vpp, cnp) break; default: - FREE(acl, M_ACL); + uma_zfree(acl_zone, acl); goto bad; } - FREE(acl, M_ACL); + uma_zfree(acl_zone, acl); } #endif /* !UFS_ACL */ ufs_makedirentry(ip, cnp, &newdir); |