diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
| commit | ba88dfc73375c2729cafdc4c1da0c84e720b4c29 (patch) | |
| tree | 736b37523fefba09638b90d177dab23b40c2ce3d /sys/kern/vfs_acl.c | |
| parent | f0ae4fa2db4779c0b62db45a8135101e444b31d0 (diff) | |
Notes
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 8d0c6c733fba..0e9fc40acaa2 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); } |
