aboutsummaryrefslogtreecommitdiff
path: root/sys/security
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2008-01-13 14:44:15 +0000
committerAttilio Rao <attilio@FreeBSD.org>2008-01-13 14:44:15 +0000
commit22db15c06f1fbc66b47c8c931bbe291b9fd23d45 (patch)
tree880b0acaab5ef09fe469c4b041d99ff26adca8b8 /sys/security
parentce4c63c52a45d7a3fc5c13b6c0a50fcece35a1f8 (diff)
downloadsrc-22db15c06f1fbc66b47c8c931bbe291b9fd23d45.tar.gz
src-22db15c06f1fbc66b47c8c931bbe291b9fd23d45.zip
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>
Notes
Notes: svn path=/head/; revision=175294
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 7d84f76e1c4e..199aa47bd9ec 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 f9865f5c4062..5a841fbc224c 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 35df1b2ad210..102e9f913ce1 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 6c81e080038a..d136387a14da 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 9d8227df2db1..9b5286c5c10d 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);