diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
commit | b6baa60b1e807d09641c20b2ff1fe838ddebbd3b (patch) | |
tree | 81781cbbf3ad98f73e64d11188dfe3084b844e12 /sys/kern/vfs_acl.c | |
parent | 0c5b7b7672ac24978496b6d8b72a9f4c74349b64 (diff) | |
download | FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.zip FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.tar.gz |
Back out proc locking to protect p_ucred for obtaining additional
references along with the actual obtaining of additional references.
Diffstat (limited to 'sys/kern/vfs_acl.c')
-rw-r--r-- | sys/kern/vfs_acl.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 8d0c6c7..0e9fc40 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -72,22 +72,16 @@ vacl_set_acl(struct proc *p, struct vnode *vp, acl_type_t type, struct acl *aclp) { struct acl inkernacl; - struct ucred *uc; int error; error = copyin(aclp, &inkernacl, sizeof(struct acl)); if (error) return(error); - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - VOP_LEASE(vp, p, uc, LEASE_WRITE); + VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_SETACL(vp, type, &inkernacl, uc, p); + error = VOP_SETACL(vp, type, &inkernacl, p->p_ucred, p); VOP_UNLOCK(vp, 0, p); - crfree(uc); - return (error); + return(error); } /* @@ -98,18 +92,12 @@ vacl_get_acl(struct proc *p, struct vnode *vp, acl_type_t type, struct acl *aclp) { struct acl inkernelacl; - struct ucred *uc; int error; - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - VOP_LEASE(vp, p, uc, LEASE_WRITE); + VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_GETACL(vp, type, &inkernelacl, uc, p); + error = VOP_GETACL(vp, type, &inkernelacl, p->p_ucred, p); VOP_UNLOCK(vp, 0, p); - crfree(uc); if (error == 0) error = copyout(&inkernelacl, aclp, sizeof(struct acl)); return (error); @@ -121,18 +109,12 @@ vacl_get_acl(struct proc *p, struct vnode *vp, acl_type_t type, static int vacl_delete(struct proc *p, struct vnode *vp, acl_type_t type) { - struct ucred *uc; int error; - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - VOP_LEASE(vp, p, uc, LEASE_WRITE); + VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_SETACL(vp, ACL_TYPE_DEFAULT, 0, uc, p); + error = VOP_SETACL(vp, ACL_TYPE_DEFAULT, 0, p->p_ucred, p); VOP_UNLOCK(vp, 0, p); - crfree(uc); return (error); } @@ -144,18 +126,12 @@ vacl_aclcheck(struct proc *p, struct vnode *vp, acl_type_t type, struct acl *aclp) { struct acl inkernelacl; - struct ucred *uc; int error; error = copyin(aclp, &inkernelacl, sizeof(struct acl)); if (error) return(error); - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = VOP_ACLCHECK(vp, type, &inkernelacl, uc, p); - crfree(uc); + error = VOP_ACLCHECK(vp, type, &inkernelacl, p->p_ucred, p); return (error); } |