diff options
author | attilio <attilio@FreeBSD.org> | 2008-01-10 01:10:58 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-01-10 01:10:58 +0000 |
commit | 18d0a0dd51c7995ce9e549616f78ef724096b1bd (patch) | |
tree | c4e28d990eaa525916ab09f2bd1d9c6ddf2c8dea /sys/security | |
parent | 8df9c26bfdf7538c15226c902c07a0fe350ace36 (diff) | |
download | FreeBSD-src-18d0a0dd51c7995ce9e549616f78ef724096b1bd.zip FreeBSD-src-18d0a0dd51c7995ce9e549616f78ef724096b1bd.tar.gz |
vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.
Manpage and FreeBSD_version will be updated through further commits.
As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.
Tested by: Diego Sardina <siarodx at gmail dot com>,
Andrea Di Pasquale <whyx dot it at gmail dot com>
Diffstat (limited to 'sys/security')
-rw-r--r-- | sys/security/audit/audit_arg.c | 4 | ||||
-rw-r--r-- | sys/security/audit/audit_bsm_klib.c | 2 | ||||
-rw-r--r-- | sys/security/audit/audit_worker.c | 2 | ||||
-rw-r--r-- | sys/security/mac/mac_process.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_syscalls.c | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index 678076d..7d84f76 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -630,7 +630,7 @@ audit_arg_file(struct proc *p, struct file *fp) */ vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); audit_arg_vnode(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0, curthread); VFS_UNLOCK_GIANT(vfslocked); @@ -848,7 +848,7 @@ audit_sysclose(struct thread *td, int fd) vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); audit_arg_vnode(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0, td); VFS_UNLOCK_GIANT(vfslocked); diff --git a/sys/security/audit/audit_bsm_klib.c b/sys/security/audit/audit_bsm_klib.c index 3282226..5361ad3 100644 --- a/sys/security/audit/audit_bsm_klib.c +++ b/sys/security/audit/audit_bsm_klib.c @@ -526,7 +526,7 @@ canon_path(struct thread *td, char *path, char *cpath) * attention. */ vfslocked = VFS_LOCK_GIANT(vnp->v_mount); - vn_lock(vnp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vnp, LK_EXCLUSIVE | LK_RETRY); error = vn_fullpath(td, vnp, &retbuf, &freebuf); if (error == 0) { /* Copy and free buffer allocated by vn_fullpath(). diff --git a/sys/security/audit/audit_worker.c b/sys/security/audit/audit_worker.c index 2ced60a..35df1b2 100644 --- a/sys/security/audit/audit_worker.c +++ b/sys/security/audit/audit_worker.c @@ -136,7 +136,7 @@ audit_record_write(struct vnode *vp, struct ucred *cred, struct thread *td, error = VFS_STATFS(vp->v_mount, mnt_stat, td); if (error) goto fail; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_GETATTR(vp, &vattr, cred, td); VOP_UNLOCK(vp, 0, td); if (error) diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c index 6ed6d91..6c81e08 100644 --- a/sys/security/mac/mac_process.c +++ b/sys/security/mac/mac_process.c @@ -365,7 +365,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred, continue; vp = (struct vnode *)object->handle; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); result = vme->max_protection; mac_vnode_check_mmap_downgrade(cred, vp, &result); VOP_UNLOCK(vp, 0, td); @@ -401,7 +401,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred, */ vm_object_reference(object); (void) vn_start_write(vp, &mp, V_WAIT); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VM_OBJECT_LOCK(object); vm_object_page_clean(object, OFF_TO_IDX(offset), diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 0c41c78..9d8227d 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -255,7 +255,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) vp = fp->f_vnode; intlabel = mac_vnode_label_alloc(); vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); mac_vnode_copy_label(vp->v_label, intlabel); VOP_UNLOCK(vp, 0, td); VFS_UNLOCK_GIANT(vfslocked); @@ -448,7 +448,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) mac_vnode_label_free(intlabel); break; } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = vn_setlabel(vp, intlabel, td->td_ucred); VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); |