summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-01-13 14:44:15 +0000
committerattilio <attilio@FreeBSD.org>2008-01-13 14:44:15 +0000
commit71b7824213151e91b40ee4afa9fa7f100c90ed0b (patch)
tree880b0acaab5ef09fe469c4b041d99ff26adca8b8 /sys/security
parent28827547bbae974e5ca23ee55d1ba558da366885 (diff)
downloadFreeBSD-src-71b7824213151e91b40ee4afa9fa7f100c90ed0b.zip
FreeBSD-src-71b7824213151e91b40ee4afa9fa7f100c90ed0b.tar.gz
VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in
conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit_arg.c4
-rw-r--r--sys/security/audit/audit_syscalls.c4
-rw-r--r--sys/security/audit/audit_worker.c14
-rw-r--r--sys/security/mac/mac_process.c4
-rw-r--r--sys/security/mac/mac_syscalls.c4
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c
index 7d84f76..199aa47 100644
--- a/sys/security/audit/audit_arg.c
+++ b/sys/security/audit/audit_arg.c
@@ -632,7 +632,7 @@ audit_arg_file(struct proc *p, struct file *fp)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
audit_arg_vnode(vp, ARG_VNODE1);
- VOP_UNLOCK(vp, 0, curthread);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
break;
@@ -850,7 +850,7 @@ audit_sysclose(struct thread *td, int fd)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
audit_arg_vnode(vp, ARG_VNODE1);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
}
diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c
index f9865f5..5a841fb 100644
--- a/sys/security/audit/audit_syscalls.c
+++ b/sys/security/audit/audit_syscalls.c
@@ -656,14 +656,14 @@ auditctl(struct thread *td, struct auditctl_args *uap)
vp = nd.ni_vp;
#ifdef MAC
error = mac_system_check_auditctl(td->td_ucred, vp);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
if (error) {
vn_close(vp, AUDIT_CLOSE_FLAGS, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
#else
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
#endif
NDFREE(&nd, NDF_ONLY_PNBUF);
if (vp->v_type != VREG) {
diff --git a/sys/security/audit/audit_worker.c b/sys/security/audit/audit_worker.c
index 35df1b2..102e9f9 100644
--- a/sys/security/audit/audit_worker.c
+++ b/sys/security/audit/audit_worker.c
@@ -138,7 +138,7 @@ audit_record_write(struct vnode *vp, struct ucred *cred, struct thread *td,
goto fail;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_GETATTR(vp, &vattr, cred, td);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
if (error)
goto fail;
audit_fstat.af_currsz = vattr.va_size;
@@ -251,9 +251,9 @@ audit_record_write(struct vnode *vp, struct ucred *cred, struct thread *td,
*/
if (audit_in_failure) {
if (audit_q_len == 0 && audit_pre_q_len == 0) {
- VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, td);
+ VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
(void)VOP_FSYNC(vp, MNT_WAIT, td);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
panic("Audit store overflow; record queue drained.");
}
}
@@ -268,9 +268,9 @@ fail_enospc:
* space, or ENOSPC returned by the vnode write call.
*/
if (audit_fail_stop) {
- VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, td);
+ VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
(void)VOP_FSYNC(vp, MNT_WAIT, td);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
panic("Audit log space exhausted and fail-stop set.");
}
(void)send_trigger(AUDIT_TRIGGER_NO_SPACE);
@@ -283,9 +283,9 @@ fail:
* lost, which may require an immediate system halt.
*/
if (audit_panic_on_write_fail) {
- VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, td);
+ VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
(void)VOP_FSYNC(vp, MNT_WAIT, td);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
panic("audit_worker: write error %d\n", error);
} else if (ppsratecheck(&last_fail, &cur_fail, 1))
printf("audit_worker: write error %d\n", error);
diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c
index 6c81e08..d136387 100644
--- a/sys/security/mac/mac_process.c
+++ b/sys/security/mac/mac_process.c
@@ -368,7 +368,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred,
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
result = vme->max_protection;
mac_vnode_check_mmap_downgrade(cred, vp, &result);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
/*
* Find out what maximum protection we may be allowing now
* but a policy needs to get removed.
@@ -409,7 +409,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred,
PAGE_MASK),
OBJPC_SYNC);
VM_OBJECT_UNLOCK(object);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
vm_object_deallocate(object);
/*
diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c
index 9d8227d..9b5286c 100644
--- a/sys/security/mac/mac_syscalls.c
+++ b/sys/security/mac/mac_syscalls.c
@@ -257,7 +257,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
mac_vnode_copy_label(vp->v_label, intlabel);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
error = mac_vnode_externalize_label(intlabel, elements,
buffer, mac.m_buflen);
@@ -450,7 +450,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
}
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = vn_setlabel(vp, intlabel, td->td_ucred);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
mac_vnode_label_free(intlabel);
OpenPOWER on IntegriCloud