From ca466baeb91097acf0817cd63a0c33886ca69d31 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 5 May 2006 21:15:11 +0000 Subject: [PATCH] Simplify vn_lock(), VOP_LOCK(), and VOP_UNLOCK() by removing the thread_t argument. These calls now always use the current thread as the lockholder. Passing a thread_t to these functions has always been questionable at best. --- sys/dev/disk/ccd/ccd.c | 4 +- sys/dev/disk/vn/vn.c | 12 ++-- sys/emulation/ibcs2/coff/imgact_coff.c | 6 +- sys/emulation/ibcs2/i386/ibcs2_misc.c | 10 +-- .../linux/i386/linprocfs/linprocfs_vnops.c | 4 +- sys/emulation/linux/linux_file.c | 6 +- sys/emulation/linux/linux_misc.c | 6 +- sys/emulation/ndis/subr_ndis.c | 4 +- sys/emulation/svr4/svr4_misc.c | 14 ++--- sys/kern/imgact_elf.c | 9 ++- sys/kern/init_main.c | 4 +- sys/kern/kern_acct.c | 4 +- sys/kern/kern_acl.c | 10 +-- sys/kern/kern_exec.c | 6 +- sys/kern/kern_ktrace.c | 8 +-- sys/kern/kern_sig.c | 8 +-- sys/kern/link_aout.c | 4 +- sys/kern/link_elf.c | 4 +- sys/kern/tty.c | 6 +- sys/kern/tty_tty.c | 10 +-- sys/kern/uipc_syscalls.c | 6 +- sys/kern/uipc_usrreq.c | 4 +- sys/kern/vfs_cache.c | 8 +-- sys/kern/vfs_default.c | 30 +++++---- sys/kern/vfs_lock.c | 8 +-- sys/kern/vfs_lookup.c | 7 +-- sys/kern/vfs_nlookup.c | 4 +- sys/kern/vfs_subr.c | 7 +-- sys/kern/vfs_syscalls.c | 42 ++++++------- sys/kern/vfs_vnops.c | 33 +++++----- sys/kern/vfs_vopops.c | 8 +-- sys/netproto/smb/smb_conn.c | 4 +- sys/sys/vfsops.h | 18 +++--- sys/sys/vnode.h | 10 +-- sys/vfs/coda/coda_vnops.c | 14 ++--- sys/vfs/fdesc/fdesc_vfsops.c | 5 +- sys/vfs/fdesc/fdesc_vnops.c | 10 +-- sys/vfs/fifofs/fifo_vnops.c | 19 +++--- sys/vfs/gnu/ext2fs/ext2_lookup.c | 17 +++-- sys/vfs/gnu/ext2fs/ext2_quota.c | 16 +++-- sys/vfs/gnu/ext2fs/ext2_vfsops.c | 28 ++++----- sys/vfs/gnu/ext2fs/ext2_vnops.c | 26 ++++---- sys/vfs/gnu/ext2fs/fs.h | 6 +- sys/vfs/hpfs/hpfs.h | 8 +-- sys/vfs/isofs/cd9660/cd9660_lookup.c | 11 ++-- sys/vfs/isofs/cd9660/cd9660_vfsops.c | 14 ++--- sys/vfs/msdosfs/msdosfs_lookup.c | 17 +++-- sys/vfs/msdosfs/msdosfs_vfsops.c | 24 +++---- sys/vfs/msdosfs/msdosfs_vnops.c | 15 +++-- sys/vfs/nfs/nfs_serv.c | 16 ++--- sys/vfs/nfs/nfs_subs.c | 5 +- sys/vfs/nfs/nfs_vfsops.c | 4 +- sys/vfs/nfs/nfs_vnops.c | 15 +++-- sys/vfs/ntfs/ntfs.h | 6 +- sys/vfs/nullfs/null_vfsops.c | 7 +-- sys/vfs/nwfs/nwfs_vfsops.c | 4 +- sys/vfs/nwfs/nwfs_vnops.c | 16 ++--- sys/vfs/portal/portal_vfsops.c | 5 +- sys/vfs/procfs/procfs_vnops.c | 4 +- sys/vfs/smbfs/smbfs_io.c | 6 +- sys/vfs/smbfs/smbfs_vfsops.c | 4 +- sys/vfs/smbfs/smbfs_vnops.c | 16 ++--- sys/vfs/specfs/spec_vnops.c | 18 +++--- sys/vfs/udf/udf_vfsops.c | 10 +-- sys/vfs/udf/udf_vnops.c | 4 +- sys/vfs/ufs/ffs_rawread.c | 10 +-- sys/vfs/ufs/ffs_softdep.c | 11 ++-- sys/vfs/ufs/ffs_vfsops.c | 36 +++++------ sys/vfs/ufs/ufs_lookup.c | 29 +++++---- sys/vfs/ufs/ufs_quota.c | 16 +++-- sys/vfs/ufs/ufs_vnops.c | 22 +++---- sys/vfs/umapfs/umap_vfsops.c | 6 +- sys/vfs/union/union_subr.c | 34 +++++----- sys/vfs/union/union_vfsops.c | 4 +- sys/vfs/union/union_vnops.c | 63 +++++++++---------- sys/vm/vm_contig.c | 8 +-- sys/vm/vm_map.c | 8 +-- sys/vm/vm_swap.c | 6 +- 78 files changed, 456 insertions(+), 495 deletions(-) diff --git a/sys/dev/disk/ccd/ccd.c b/sys/dev/disk/ccd/ccd.c index ca13ef3759..bce6be1a9b 100644 --- a/sys/dev/disk/ccd/ccd.c +++ b/sys/dev/disk/ccd/ccd.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ccd/ccd.c,v 1.73.2.1 2001/09/11 09:49:52 kris Exp $ */ -/* $DragonFly: src/sys/dev/disk/ccd/ccd.c,v 1.30 2006/05/04 18:32:19 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/ccd/ccd.c,v 1.31 2006/05/05 21:15:06 dillon Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -1598,7 +1598,7 @@ ccdlookup(char *path, struct thread *td, struct vnode **vpp) vprint("ccdlookup: vnode info", vp); #endif - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); nd.nl_open_vp = NULL; nlookup_done(&nd); *vpp = vp; /* leave ref intact */ diff --git a/sys/dev/disk/vn/vn.c b/sys/dev/disk/vn/vn.c index 0ffe9e8602..a185ea6092 100644 --- a/sys/dev/disk/vn/vn.c +++ b/sys/dev/disk/vn/vn.c @@ -39,7 +39,7 @@ * * from: @(#)vn.c 8.6 (Berkeley) 4/1/94 * $FreeBSD: src/sys/dev/vn/vn.c,v 1.105.2.4 2001/11/18 07:11:00 dillon Exp $ - * $DragonFly: src/sys/dev/disk/vn/vn.c,v 1.22 2006/05/05 09:28:05 swildner Exp $ + * $DragonFly: src/sys/dev/disk/vn/vn.c,v 1.23 2006/05/05 21:15:08 dillon Exp $ */ /* @@ -385,12 +385,12 @@ vnstrategy(dev_t dev, struct bio *bio) auio.uio_rw = UIO_WRITE; auio.uio_resid = bp->b_bcount; auio.uio_td = curthread; - vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY); if (bp->b_cmd == BUF_CMD_READ) error = VOP_READ(vn->sc_vp, &auio, IO_DIRECT, vn->sc_cred); else error = VOP_WRITE(vn->sc_vp, &auio, IO_NOWDRAIN, vn->sc_cred); - VOP_UNLOCK(vn->sc_vp, 0, curthread); + VOP_UNLOCK(vn->sc_vp, 0); bp->b_resid = auio.uio_resid; if (error) { bp->b_error = error; @@ -572,7 +572,7 @@ vniocattach_file(struct vn_softc *vn, struct vn_ioctl *vio, dev_t dev, error = EINVAL; goto done; } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vn->sc_secsize = DEV_BSIZE; vn->sc_vp = vp; nd.nl_open_vp = NULL; @@ -724,9 +724,9 @@ vnsetcred(struct vn_softc *vn, struct ucred *cred) auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; auio.uio_resid = aiov.iov_len; - vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_READ(vn->sc_vp, &auio, 0, vn->sc_cred); - VOP_UNLOCK(vn->sc_vp, 0, curthread); + VOP_UNLOCK(vn->sc_vp, 0); free(tmpbuf, M_TEMP); } return (error); diff --git a/sys/emulation/ibcs2/coff/imgact_coff.c b/sys/emulation/ibcs2/coff/imgact_coff.c index 0ef74ffbb2..09a14874a7 100644 --- a/sys/emulation/ibcs2/coff/imgact_coff.c +++ b/sys/emulation/ibcs2/coff/imgact_coff.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/imgact_coff.c,v 1.40 1999/12/15 23:01:47 eivind Exp $ - * $DragonFly: src/sys/emulation/ibcs2/coff/Attic/imgact_coff.c,v 1.14 2005/02/17 13:59:36 joerg Exp $ + * $DragonFly: src/sys/emulation/ibcs2/coff/Attic/imgact_coff.c,v 1.15 2006/05/05 21:15:08 dillon Exp $ */ #include @@ -212,7 +212,7 @@ coff_load_file(struct thread *td, char *name) * Lose the lock on the vnode. It's no longer needed, and must not * exist for the pagefault paging to work below. */ - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if ((error = vm_mmap(kernel_map, (vm_offset_t *) &ptr, @@ -285,7 +285,7 @@ coff_load_file(struct thread *td, char *name) panic("%s: vm_map_remove failed", __func__); fail: - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); unlocked_fail: vrele(vp); done: diff --git a/sys/emulation/ibcs2/i386/ibcs2_misc.c b/sys/emulation/ibcs2/i386/ibcs2_misc.c index f06de91ca0..23e6b354a5 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_misc.c +++ b/sys/emulation/ibcs2/i386/ibcs2_misc.c @@ -46,7 +46,7 @@ * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * * $FreeBSD: src/sys/i386/ibcs2/ibcs2_misc.c,v 1.34 1999/09/29 15:12:09 marcel Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_misc.c,v 1.11 2005/08/27 20:23:05 joerg Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_misc.c,v 1.12 2006/05/05 21:15:08 dillon Exp $ */ /* @@ -330,7 +330,7 @@ ibcs2_getdents(struct ibcs2_getdents_args *uap) buflen = max(DIRBLKSIZ, SCARG(uap, nbytes)); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -432,7 +432,7 @@ eof: out: if (cookies) free(cookies, M_TEMP); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); free(buf, M_TEMP); return (error); } @@ -479,7 +479,7 @@ ibcs2_read(struct ibcs2_read_args *uap) buflen = max(DIRBLKSIZ, SCARG(uap, nbytes)); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -585,7 +585,7 @@ eof: out: if (cookies) free(cookies, M_TEMP); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); free(buf, M_TEMP); return (error); } diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c index 0fe1fdf05d..ad364b6fbb 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c @@ -39,7 +39,7 @@ * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vnops.c,v 1.3.2.5 2001/08/12 14:29:19 rwatson Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.28 2006/04/01 20:46:50 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.29 2006/05/05 21:15:08 dillon Exp $ */ /* @@ -722,7 +722,7 @@ out: if (error == 0) { if (*vpp != dvp && (cnp->cn_flags & CNP_LOCKPARENT) == 0) { cnp->cn_flags |= CNP_PDIRUNLOCK; - VOP_UNLOCK(dvp, 0, cnp->cn_td); + VOP_UNLOCK(dvp, 0); } } return (error); diff --git a/sys/emulation/linux/linux_file.c b/sys/emulation/linux/linux_file.c index 5c9e90a48a..ef2033c216 100644 --- a/sys/emulation/linux/linux_file.c +++ b/sys/emulation/linux/linux_file.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_file.c,v 1.41.2.6 2003/01/06 09:19:43 fjoe Exp $ - * $DragonFly: src/sys/emulation/linux/linux_file.c,v 1.26 2006/04/27 08:03:56 swildner Exp $ + * $DragonFly: src/sys/emulation/linux/linux_file.c,v 1.27 2006/05/05 21:15:08 dillon Exp $ */ #include "opt_compat.h" @@ -286,7 +286,7 @@ getdents_common(struct linux_getdents64_args *args, int is64bit) buflen = max(LINUX_DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); again: aiov.iov_base = buf; @@ -425,7 +425,7 @@ out: if (cookies) free(cookies, M_TEMP); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); free(buf, M_TEMP); return (error); } diff --git a/sys/emulation/linux/linux_misc.c b/sys/emulation/linux/linux_misc.c index 2f6b5c42a7..a0a101a10e 100644 --- a/sys/emulation/linux/linux_misc.c +++ b/sys/emulation/linux/linux_misc.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.85.2.9 2002/09/24 08:11:41 mdodd Exp $ - * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.25 2005/10/08 11:41:11 corecode Exp $ + * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.26 2006/05/05 21:15:08 dillon Exp $ */ #include "opt_compat.h" @@ -308,7 +308,7 @@ linux_uselib(struct linux_uselib_args *args) /* * Lock no longer needed */ - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); locked = 0; /* Pull in executable header into kernel_map */ @@ -447,7 +447,7 @@ cleanup: /* Unlock/release vnode */ if (vp) { if (locked) - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vrele(vp); } /* Release the kernel mapping. */ diff --git a/sys/emulation/ndis/subr_ndis.c b/sys/emulation/ndis/subr_ndis.c index b7272b0697..16ab8838e6 100644 --- a/sys/emulation/ndis/subr_ndis.c +++ b/sys/emulation/ndis/subr_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.62 2004/07/11 00:19:30 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.11 2006/03/07 20:03:54 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.12 2006/05/05 21:15:08 dillon Exp $ */ /* @@ -2315,7 +2315,7 @@ ndis_open_file(ndis_status *status, ndis_handle *filehandle, uint32_t *filelengt /* Get the file size. */ VOP_GETATTR(vp, vap, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); fh->nf_vp = vp; fh->nf_map = NULL; diff --git a/sys/emulation/svr4/svr4_misc.c b/sys/emulation/svr4/svr4_misc.c index 272ce8ec10..4dbf65a63e 100644 --- a/sys/emulation/svr4/svr4_misc.c +++ b/sys/emulation/svr4/svr4_misc.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_misc.c,v 1.13.2.7 2003/01/14 21:33:58 dillon Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_misc.c,v 1.32 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_misc.c,v 1.33 2006/05/05 21:15:08 dillon Exp $ */ /* @@ -288,7 +288,7 @@ svr4_sys_getdents64(struct svr4_sys_getdents64_args *uap) buflen = max(DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -402,7 +402,7 @@ eof: out: if (cookies) free(cookies, M_TEMP); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); free(buf, M_TEMP); return error; } @@ -442,7 +442,7 @@ svr4_sys_getdents(struct svr4_sys_getdents_args *uap) buflen = min(MAXBSIZE, SCARG(uap, nbytes)); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); off = fp->f_offset; again: aiov.iov_base = buf; @@ -516,7 +516,7 @@ again: eof: *retval = SCARG(uap, nbytes) - resid; out: - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (cookiebuf) free(cookiebuf, M_TEMP); free(buf, M_TEMP); @@ -611,12 +611,12 @@ svr4_sys_fchroot(struct svr4_sys_fchroot_args *uap) if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) return error; vp = (struct vnode *) fp->f_data; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type != VDIR || fp->f_ncp == NULL) error = ENOTDIR; else error = VOP_ACCESS(vp, VEXEC, cred, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (error) return error; vref(vp); diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index aebdc7e8c0..71fe5c6d3b 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/imgact_elf.c,v 1.73.2.13 2002/12/28 19:49:41 dillon Exp $ - * $DragonFly: src/sys/kern/imgact_elf.c,v 1.35 2006/03/29 18:44:50 dillon Exp $ + * $DragonFly: src/sys/kern/imgact_elf.c,v 1.36 2006/05/05 21:15:08 dillon Exp $ */ #include @@ -391,7 +391,6 @@ elf_load_file(struct proc *p, const char *file, u_long *addr, u_long *entry) u_long rbase; u_long base_addr = 0; int error, i, numsegs; - struct thread *td = p->p_thread; tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK); nd = &tempdata->nd; @@ -421,7 +420,7 @@ elf_load_file(struct proc *p, const char *file, u_long *addr, u_long *entry) */ error = exec_check_permissions(imgp); if (error) { - VOP_UNLOCK(imgp->vp, 0, td); + VOP_UNLOCK(imgp->vp, 0); goto fail; } @@ -432,7 +431,7 @@ elf_load_file(struct proc *p, const char *file, u_long *addr, u_long *entry) */ if (error == 0) imgp->vp->v_flag |= VTEXT; - VOP_UNLOCK(imgp->vp, 0, td); + VOP_UNLOCK(imgp->vp, 0); if (error) goto fail; @@ -910,7 +909,7 @@ elf_coredump(struct proc *p, struct vnode *vp, off_t limit) fp->f_flag = O_CREAT|O_WRONLY|O_NOFOLLOW; fp->f_ops = &vnode_fileops; fp->f_data = vp; - VOP_UNLOCK(vp, 0, p->p_thread); + VOP_UNLOCK(vp, 0); error = generic_elf_coredump(p, fp, limit); diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 90da0c21a1..c3708ca6f2 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -40,7 +40,7 @@ * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/init_main.c,v 1.134.2.8 2003/06/06 20:21:32 tegge Exp $ - * $DragonFly: src/sys/kern/init_main.c,v 1.51 2005/11/14 18:50:05 dillon Exp $ + * $DragonFly: src/sys/kern/init_main.c,v 1.52 2006/05/05 21:15:08 dillon Exp $ */ #include "opt_init_path.h" @@ -475,7 +475,7 @@ start_init(void *dummy) p->p_fd->fd_rdir = vp; vref(p->p_fd->fd_rdir); vfs_cache_setroot(vp, cache_hold(mp->mnt_ncp)); - VOP_UNLOCK(vp, 0, curthread); /* leave ref intact */ + VOP_UNLOCK(vp, 0); /* leave ref intact */ p->p_fd->fd_ncdir = cache_hold(mp->mnt_ncp); p->p_fd->fd_nrdir = cache_hold(mp->mnt_ncp); diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 2d4d1d62bb..2981a00711 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -38,7 +38,7 @@ * * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 * $FreeBSD: src/sys/kern/kern_acct.c,v 1.23.2.1 2002/07/24 18:33:55 johan Exp $ - * $DragonFly: src/sys/kern/kern_acct.c,v 1.20 2006/03/27 16:18:34 dillon Exp $ + * $DragonFly: src/sys/kern/kern_acct.c,v 1.21 2006/05/05 21:15:08 dillon Exp $ */ #include @@ -150,7 +150,7 @@ acct(struct acct_args *uap) nd.nl_open_vp = NULL; nlookup_done(&nd); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } else { vp = NULL; } diff --git a/sys/kern/kern_acl.c b/sys/kern/kern_acl.c index 273145cb82..2af8f4de23 100644 --- a/sys/kern/kern_acl.c +++ b/sys/kern/kern_acl.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_acl.c,v 1.2.2.1 2000/07/28 18:48:16 rwatson Exp $ - * $DragonFly: src/sys/kern/kern_acl.c,v 1.10 2006/03/27 16:18:34 dillon Exp $ + * $DragonFly: src/sys/kern/kern_acl.c,v 1.11 2006/05/05 21:15:08 dillon Exp $ */ /* @@ -79,9 +79,9 @@ vacl_set_acl(struct vnode *vp, acl_type_t type, struct acl *aclp) KKASSERT(td->td_proc); ucred = td->td_proc->p_ucred; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_SETACL(vp, type, &inkernacl, ucred, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return(error); } @@ -116,9 +116,9 @@ vacl_delete(struct vnode *vp, acl_type_t type) KKASSERT(td->td_proc); ucred = td->td_proc->p_ucred; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_SETACL(vp, ACL_TYPE_DEFAULT, 0, ucred, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (error); } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index ca1c6b1848..2c4c32ae3f 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_exec.c,v 1.107.2.15 2002/07/30 15:40:46 nectar Exp $ - * $DragonFly: src/sys/kern/kern_exec.c,v 1.36 2006/03/29 18:44:50 dillon Exp $ + * $DragonFly: src/sys/kern/kern_exec.c,v 1.37 2006/05/05 21:15:08 dillon Exp $ */ #include @@ -206,12 +206,12 @@ interpret: */ error = exec_check_permissions(imgp); if (error) { - VOP_UNLOCK(imgp->vp, 0, td); + VOP_UNLOCK(imgp->vp, 0); goto exec_fail_dealloc; } error = exec_map_first_page(imgp); - VOP_UNLOCK(imgp->vp, 0, td); + VOP_UNLOCK(imgp->vp, 0); if (error) goto exec_fail_dealloc; diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 3c6dcee595..1454ced698 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -32,7 +32,7 @@ * * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 * $FreeBSD: src/sys/kern/kern_ktrace.c,v 1.35.2.6 2002/07/05 22:36:38 darrenr Exp $ - * $DragonFly: src/sys/kern/kern_ktrace.c,v 1.20 2006/03/27 16:18:34 dillon Exp $ + * $DragonFly: src/sys/kern/kern_ktrace.c,v 1.21 2006/05/05 21:15:08 dillon Exp $ */ #include "opt_ktrace.h" @@ -274,7 +274,7 @@ ktrace(struct ktrace_args *uap) vp = nd.nl_open_vp; nd.nl_open_vp = NULL; nlookup_done(&nd); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } /* * Clear all uses of the tracefile. XXX umm, what happens to the @@ -495,12 +495,12 @@ ktrwrite(struct vnode *vp, struct ktr_header *kth, struct uio *uio) if (uio != NULL) kth->ktr_len += uio->uio_resid; } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, p->p_ucred); if (error == 0 && uio != NULL) { error = VOP_WRITE(vp, uio, IO_UNIT | IO_APPEND, p->p_ucred); } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vrele(vp); if (!error) return; diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 18adf4e99a..1ea00291ca 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -37,7 +37,7 @@ * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 * $FreeBSD: src/sys/kern/kern_sig.c,v 1.72.2.17 2003/05/16 16:34:34 obrien Exp $ - * $DragonFly: src/sys/kern/kern_sig.c,v 1.44 2006/03/27 16:18:34 dillon Exp $ + * $DragonFly: src/sys/kern/kern_sig.c,v 1.45 2006/05/05 21:15:08 dillon Exp $ */ #include "opt_ktrace.h" @@ -1668,7 +1668,7 @@ coredump(struct proc *p) nd.nl_open_vp = NULL; nlookup_done(&nd); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; @@ -1685,11 +1685,11 @@ coredump(struct proc *p) } VATTR_NULL(&vattr); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vattr.va_size = 0; VOP_SETATTR(vp, &vattr, cred, td); p->p_acflag |= ACORE; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); error = p->p_sysent->sv_coredump ? p->p_sysent->sv_coredump(p, vp, limit) : ENOSYS; diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c index 43cf60d53b..8d9526709a 100644 --- a/sys/kern/link_aout.c +++ b/sys/kern/link_aout.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/link_aout.c,v 1.26 1999/12/24 15:33:36 bde Exp $ - * $DragonFly: src/sys/kern/link_aout.c,v 1.15 2006/03/27 16:18:34 dillon Exp $ + * $DragonFly: src/sys/kern/link_aout.c,v 1.16 2006/05/05 21:15:08 dillon Exp $ */ #define FREEBSD_AOUT 1 @@ -289,7 +289,7 @@ link_aout_load_file(const char* filename, linker_file_t* result) *result = lf; out: - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vn_close(vp, FREAD, td); return error; diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 20d52da0c5..22e7e3ab88 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/link_elf.c,v 1.24 1999/12/24 15:33:36 bde Exp $ - * $DragonFly: src/sys/kern/link_elf.c,v 1.17 2005/03/04 00:01:30 dillon Exp $ + * $DragonFly: src/sys/kern/link_elf.c,v 1.18 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -695,7 +695,7 @@ out: free(shdr, M_LINKER); if (firstpage) free(firstpage, M_LINKER); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vn_close(vp, FREAD, td); return error; diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e3558de801..56a5dc90ba 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -37,7 +37,7 @@ * * @(#)tty.c 8.8 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/tty.c,v 1.129.2.5 2002/03/11 01:32:31 dd Exp $ - * $DragonFly: src/sys/kern/tty.c,v 1.21 2006/04/03 21:32:23 dillon Exp $ + * $DragonFly: src/sys/kern/tty.c,v 1.22 2006/05/05 21:15:09 dillon Exp $ */ /*- @@ -309,10 +309,10 @@ ttyclosesession(struct session *sp, int dorele) return; sp->s_ttyvp = NULL; if (vp->v_flag & VCTTYISOPEN) { - if (vn_lock(vp, LK_EXCLUSIVE|LK_RETRY, td) == 0) { + if (vn_lock(vp, LK_EXCLUSIVE|LK_RETRY) == 0) { vclrflags(vp, VCTTYISOPEN); VOP_CLOSE(vp, FREAD|FWRITE, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } } if (dorele) diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index a592504d46..a2db5a63be 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -32,7 +32,7 @@ * * @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 * $FreeBSD: src/sys/kern/tty_tty.c,v 1.30 1999/09/25 18:24:24 phk Exp $ - * $DragonFly: src/sys/kern/tty_tty.c,v 1.13 2006/04/03 21:32:23 dillon Exp $ + * $DragonFly: src/sys/kern/tty_tty.c,v 1.14 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -98,11 +98,11 @@ cttyopen(dev_t dev, int flag, int mode, struct thread *td) error = 0; } else { vsetflags(ttyvp, VCTTYISOPEN); - vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(ttyvp, FREAD|FWRITE, NOCRED, NULL, td); if (error) vclrflags(ttyvp, VCTTYISOPEN); - VOP_UNLOCK(ttyvp, 0, td); + VOP_UNLOCK(ttyvp, 0); } } else { error = ENXIO; @@ -133,10 +133,10 @@ cttyclose(dev_t dev, int fflag, int devtype, struct thread *td) error = 0; } else if (ttyvp->v_flag & VCTTYISOPEN) { vclrflags(ttyvp, VCTTYISOPEN); - error = vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY, td); + error = vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); if (error == 0) { error = VOP_CLOSE(ttyvp, FREAD|FWRITE, td); - VOP_UNLOCK(ttyvp, 0, td); + VOP_UNLOCK(ttyvp, 0); } } else { error = 0; diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 2a49c0d83b..da6a303597 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -35,7 +35,7 @@ * * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 * $FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.65.2.17 2003/04/04 17:11:16 tegge Exp $ - * $DragonFly: src/sys/kern/uipc_syscalls.c,v 1.62 2006/04/26 17:42:53 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_syscalls.c,v 1.63 2006/05/05 21:15:09 dillon Exp $ */ #include "opt_ktrace.h" @@ -1570,11 +1570,11 @@ retry_lookup: auio.uio_segflg = UIO_NOCOPY; auio.uio_rw = UIO_READ; auio.uio_td = td; - vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY); error = VOP_READ(vp, &auio, IO_VMIO | ((MAXBSIZE / bsize) << 16), p->p_ucred); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vm_page_flag_clear(pg, PG_ZERO); vm_page_io_finish(pg); if (error) { diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0a06b29c72..245e2e0223 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -32,7 +32,7 @@ * * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.54.2.10 2003/03/04 17:28:09 nectar Exp $ - * $DragonFly: src/sys/kern/uipc_usrreq.c,v 1.22 2005/06/22 01:33:21 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_usrreq.c,v 1.23 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -613,7 +613,7 @@ unp_bind(struct unpcb *unp, struct sockaddr *nam, struct thread *td) vp->v_socket = unp->unp_socket; unp->unp_vnode = vp; unp->unp_addr = (struct sockaddr_un *)dup_sockaddr(nam); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } done: nlookup_done(&nd); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index a415562b5b..45a70b24b6 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -67,7 +67,7 @@ * * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95 * $FreeBSD: src/sys/kern/vfs_cache.c,v 1.42.2.6 2001/10/05 20:07:03 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_cache.c,v 1.64 2006/04/25 22:11:28 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_cache.c,v 1.65 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -1066,7 +1066,7 @@ force: printf("lookupdotdot failed %d dvp %p\n", error, dvp); break; } - VOP_UNLOCK(pvp, 0, curthread); + VOP_UNLOCK(pvp, 0); /* * Reuse makeit as a recursion depth counter. @@ -1128,7 +1128,7 @@ cache_fromdvp_try(struct vnode *dvp, struct ucred *cred, vrele(dvp); return (error); } - VOP_UNLOCK(pvp, 0, curthread); + VOP_UNLOCK(pvp, 0); if ((ncp = TAILQ_FIRST(&pvp->v_namecache)) != NULL) { cache_hold(ncp); vrele(pvp); @@ -1258,7 +1258,7 @@ again: } nlc.nlc_nameptr = den->d_name; nlc.nlc_namelen = den->d_namlen; - VOP_UNLOCK(pvp, 0, curthread); + VOP_UNLOCK(pvp, 0); rncp = cache_nlookup(ncp, &nlc); KKASSERT(rncp != NULL); break; diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 1f38e36f3f..75913eb07f 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -37,7 +37,7 @@ * * * $FreeBSD: src/sys/kern/vfs_default.c,v 1.28.2.7 2003/01/10 18:23:26 bde Exp $ - * $DragonFly: src/sys/kern/vfs_default.c,v 1.37 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_default.c,v 1.38 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -228,9 +228,9 @@ vop_compat_nresolve(struct vop_nresolve_args *ap) */ error = vop_old_lookup(ap->a_head.a_ops, dvp, &vp, &cnp); if (error == 0) - VOP_UNLOCK(vp, 0, curthread); + VOP_UNLOCK(vp, 0); if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, curthread); + VOP_UNLOCK(dvp, 0); if ((ncp->nc_flag & NCF_UNRESOLVED) == 0) { /* was resolved by another process while we were unlocked */ if (error == 0) @@ -300,7 +300,7 @@ vop_compat_nlookupdotdot(struct vop_nlookupdotdot_args *ap) */ error = vop_old_lookup(ap->a_head.a_ops, ap->a_dvp, ap->a_vpp, &cnp); if (error == 0) - VOP_UNLOCK(*ap->a_vpp, 0, curthread); + VOP_UNLOCK(*ap->a_vpp, 0); if (cnp.cn_flags & CNP_PDIRUNLOCK) vrele(ap->a_dvp); else @@ -385,7 +385,7 @@ vop_compat_ncreate(struct vop_ncreate_args *ap) KKASSERT(*ap->a_vpp == NULL); } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -467,7 +467,7 @@ vop_compat_nmkdir(struct vop_nmkdir_args *ap) KKASSERT(*ap->a_vpp == NULL); } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -549,7 +549,7 @@ vop_compat_nmknod(struct vop_nmknod_args *ap) KKASSERT(*ap->a_vpp == NULL); } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -628,7 +628,7 @@ vop_compat_nlink(struct vop_nlink_args *ap) } } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -703,7 +703,7 @@ vop_compat_nsymlink(struct vop_nsymlink_args *ap) KKASSERT(vp == NULL); } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -798,7 +798,7 @@ vop_compat_nwhiteout(struct vop_nwhiteout_args *ap) break; } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -873,7 +873,7 @@ vop_compat_nremove(struct vop_nremove_args *ap) vput(vp); } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -956,7 +956,7 @@ vop_compat_nrmdir(struct vop_nrmdir_args *ap) vput(vp); } if ((cnp.cn_flags & CNP_PDIRUNLOCK) == 0) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); vrele(dvp); return (error); } @@ -1030,13 +1030,13 @@ vop_compat_nrename(struct vop_nrename_args *ap) } if ((fcnp.cn_flags & CNP_PDIRUNLOCK) == 0) { fcnp.cn_flags |= CNP_PDIRUNLOCK; - VOP_UNLOCK(fdvp, 0, td); + VOP_UNLOCK(fdvp, 0); } if (error) { vrele(fdvp); return (error); } - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); /* * fdvp and fvp are now referenced and unlocked. @@ -1252,7 +1252,6 @@ vop_stdlock(ap) struct vop_lock_args /* { struct vnode *a_vp; int a_flags; - struct thread *a_td; } */ *ap; { int error; @@ -1271,7 +1270,6 @@ vop_stdunlock(ap) struct vop_unlock_args /* { struct vnode *a_vp; int a_flags; - struct thread *a_td; } */ *ap; { int error; diff --git a/sys/kern/vfs_lock.c b/sys/kern/vfs_lock.c index 2b27e3ebcf..f18424e95a 100644 --- a/sys/kern/vfs_lock.c +++ b/sys/kern/vfs_lock.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/vfs_lock.c,v 1.15 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_lock.c,v 1.16 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -316,10 +316,10 @@ vget(struct vnode *vp, int flags, thread_t td) crit_enter(); __vref(vp); if (flags & LK_TYPE_MASK) { - if ((error = vn_lock(vp, flags, td)) != 0) { + if ((error = vn_lock(vp, flags)) != 0) { vrele(vp); } else if (vp->v_flag & VRECLAIMED) { - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); vrele(vp); error = ENOENT; } else { @@ -337,7 +337,7 @@ vget(struct vnode *vp, int flags, thread_t td) void vput(struct vnode *vp) { - VOP_UNLOCK(vp, 0, curthread); + VOP_UNLOCK(vp, 0); vrele(vp); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 9980dbf478..d9df74a9d3 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -37,7 +37,7 @@ * * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 * $FreeBSD: src/sys/kern/vfs_lookup.c,v 1.38.2.3 2001/08/31 19:36:49 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_lookup.c,v 1.21 2004/11/12 00:09:24 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_lookup.c,v 1.22 2006/05/05 21:15:09 dillon Exp $ */ #include "opt_ktrace.h" @@ -79,7 +79,6 @@ SYSCTL_INT(_vfs, OID_AUTO, varsym_enable, CTLFLAG_RW, &varsym_enable, 0, int relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) { - struct thread *td = cnp->cn_td; int rdonly; /* lookup read-only flag bit */ int error = 0; @@ -88,7 +87,7 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) */ KKASSERT(cnp->cn_flags & CNP_LOCKPARENT); KKASSERT(cnp->cn_flags & CNP_PDIRUNLOCK); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); cnp->cn_flags &= ~CNP_PDIRUNLOCK; *vpp = NULL; @@ -152,7 +151,7 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) bad: if ((cnp->cn_flags & CNP_PDIRUNLOCK) == 0) { cnp->cn_flags |= CNP_PDIRUNLOCK; - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); } if (*vpp) { vput(*vpp); diff --git a/sys/kern/vfs_nlookup.c b/sys/kern/vfs_nlookup.c index 540b3f32e9..fd0f8b9e25 100644 --- a/sys/kern/vfs_nlookup.c +++ b/sys/kern/vfs_nlookup.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/vfs_nlookup.c,v 1.12 2006/03/29 18:44:50 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_nlookup.c,v 1.13 2006/05/05 21:15:09 dillon Exp $ */ /* * nlookup() is the 'new' namei interface. Rather then return directory and @@ -224,7 +224,7 @@ nlookup_done(struct nlookupdata *nd) } if (nd->nl_open_vp) { if (nd->nl_flags & NLC_LOCKVP) { - VOP_UNLOCK(nd->nl_open_vp, 0, nd->nl_td); + VOP_UNLOCK(nd->nl_open_vp, 0); nd->nl_flags &= ~NLC_LOCKVP; } vn_close(nd->nl_open_vp, nd->nl_vp_fmode, nd->nl_td); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 4916964c21..d2615303b0 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -37,7 +37,7 @@ * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 * $FreeBSD: src/sys/kern/vfs_subr.c,v 1.249.2.30 2003/04/04 20:35:57 tegge Exp $ - * $DragonFly: src/sys/kern/vfs_subr.c,v 1.81 2006/05/05 16:35:00 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_subr.c,v 1.82 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -1289,7 +1289,6 @@ vcount(struct vnode *vp) int vinitvmio(struct vnode *vp, off_t filesize) { - thread_t td = curthread; vm_object_t object; int error = 0; @@ -1304,9 +1303,9 @@ retry: vp->v_usecount--; } else { if (object->flags & OBJ_DEAD) { - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); tsleep(object, 0, "vodead", 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); goto retry; } } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 8caee36689..8731c2d42b 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -37,7 +37,7 @@ * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 * $FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.151.2.18 2003/04/04 20:35:58 tegge Exp $ - * $DragonFly: src/sys/kern/vfs_syscalls.c,v 1.83 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_syscalls.c,v 1.84 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -213,7 +213,7 @@ mount(struct mount_args *uap) vp->v_flag |= VMOUNT; mp->mnt_flag |= uap->flags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); goto update; } /* @@ -304,7 +304,7 @@ mount(struct mount_args *uap) mp->mnt_vnodecovered = vp; mp->mnt_stat.f_owner = p->p_ucred->cr_uid; mp->mnt_iosize_max = DFLTPHYS; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); update: /* * Set the mount level flags. @@ -342,7 +342,7 @@ update: cache_drop(ncp); return (error); } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* * Put the new filesystem on the mount list after root. The mount * point gets its own mnt_ncp which is a special ncp linking the @@ -368,7 +368,7 @@ update: mountlist_insert(mp, MNTINS_LAST); checkdirs(vp, mp->mnt_ncp); cache_unlock(mp->mnt_ncp); /* leave ref intact */ - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); error = vfs_allocate_syncvnode(mp); vfs_unbusy(mp, td); if ((error = VFS_START(mp, 0, td)) != 0) @@ -1038,7 +1038,7 @@ fchdir(struct fchdir_args *uap) return (error); vp = (struct vnode *)fp->f_data; vref(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type != VDIR || fp->f_ncp == NULL) error = ENOTDIR; else @@ -1063,7 +1063,7 @@ fchdir(struct fchdir_args *uap) if (error == 0) { ovp = fdp->fd_cdir; oncp = fdp->fd_ncdir; - VOP_UNLOCK(vp, 0, td); /* leave ref intact */ + VOP_UNLOCK(vp, 0); /* leave ref intact */ fdp->fd_cdir = vp; fdp->fd_ncdir = ncp; cache_drop(oncp); @@ -1093,7 +1093,7 @@ kern_chdir(struct nlookupdata *nd) return (error); error = checkvp_chdir(vp, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (error == 0) { ovp = fdp->fd_cdir; oncp = fdp->fd_ncdir; @@ -1204,7 +1204,7 @@ kern_chroot(struct namecache *ncp) * associate it with rdir/jdir. */ error = checkvp_chdir(vp, td); - VOP_UNLOCK(vp, 0, td); /* leave reference intact */ + VOP_UNLOCK(vp, 0); /* leave reference intact */ if (error == 0) { vrele(fdp->fd_rdir); fdp->fd_rdir = vp; /* reference inherited by fd_rdir */ @@ -2510,7 +2510,7 @@ kern_truncate(struct nlookupdata *nd, off_t length) return (error); if ((error = cache_vref(nd->nl_ncp, nd->nl_cred, &vp)) != 0) return (error); - if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, nd->nl_td)) != 0) { + if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) != 0) { vrele(vp); return (error); } @@ -2561,7 +2561,7 @@ kern_ftruncate(int fd, off_t length) if ((fp->f_flag & FWRITE) == 0) return (EINVAL); vp = (struct vnode *)fp->f_data; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type == VDIR) error = EISDIR; else if ((error = vn_writechk(vp)) == 0) { @@ -2569,7 +2569,7 @@ kern_ftruncate(int fd, off_t length) vattr.va_size = length; error = VOP_SETATTR(vp, &vattr, fp->f_cred, td); } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (error); } @@ -2607,14 +2607,14 @@ fsync(struct fsync_args *uap) if ((error = getvnode(p->p_fd, uap->fd, &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if ((obj = vp->v_object) != NULL) vm_object_page_clean(obj, 0, 0, 0); if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) && bioops.io_fsync) error = (*bioops.io_fsync)(vp); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (error); } @@ -2899,12 +2899,12 @@ unionread: auio.uio_segflg = direction; auio.uio_td = td; auio.uio_resid = count; - /* vn_lock(vp, LK_SHARED | LK_RETRY, td); */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + /* vn_lock(vp, LK_SHARED | LK_RETRY); */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); loff = auio.uio_offset = fp->f_offset; error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL, NULL); fp->f_offset = auio.uio_offset; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (error) return (error); if (count == auio.uio_resid) { @@ -3170,8 +3170,8 @@ fhopen(struct fhopen_args *uap) goto bad; } if (fmode & O_TRUNC) { - VOP_UNLOCK(vp, 0, td); /* XXX */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); /* XXX */ + VOP_UNLOCK(vp, 0); /* XXX */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */ VATTR_NULL(vap); vap->va_size = 0; error = VOP_SETATTR(vp, vap, p->p_ucred, td); @@ -3233,7 +3233,7 @@ fhopen(struct fhopen_args *uap) type = F_FLOCK; if ((fmode & FNONBLOCK) == 0) type |= F_WAIT; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if ((error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type)) != 0) { /* * lock request failed. Normally close the descriptor @@ -3252,7 +3252,7 @@ fhopen(struct fhopen_args *uap) vrele(vp); return (error); } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); fp->f_flag |= FHASLOCK; } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a3cddbf400..497a622fd0 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -37,7 +37,7 @@ * * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/vfs_vnops.c,v 1.87.2.13 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_vnops.c,v 1.37 2006/04/01 20:46:48 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_vnops.c,v 1.38 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -257,8 +257,8 @@ again: } } if (fmode & O_TRUNC) { - VOP_UNLOCK(vp, 0, td); /* XXX */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); /* XXX */ + VOP_UNLOCK(vp, 0); /* XXX */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */ VATTR_NULL(vap); vap->va_size = 0; error = VOP_SETATTR(vp, vap, cred, td); @@ -320,7 +320,7 @@ again: nd->nl_open_vp = vp; nd->nl_vp_fmode = fmode; if ((nd->nl_flags & NLC_LOCKVP) == 0) - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } else { vput(vp); } @@ -358,9 +358,9 @@ vn_close(struct vnode *vp, int flags, struct thread *td) { int error; - if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td)) == 0) { + if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) == 0) { error = VOP_CLOSE(vp, flags, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } vrele(vp); return (error); @@ -420,7 +420,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) int error; if ((ioflg & IO_NODELOCKED) == 0) - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; aiov.iov_base = base; @@ -441,7 +441,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) if (auio.uio_resid && error == 0) error = EIO; if ((ioflg & IO_NODELOCKED) == 0) - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (error); } @@ -518,7 +518,7 @@ vn_read(fp, uio, cred, flags, td) ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; - vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY); if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; @@ -528,7 +528,7 @@ vn_read(fp, uio, cred, flags, td) if ((flags & FOF_OFFSET) == 0) fp->f_offset = uio->uio_offset; fp->f_nextoff = uio->uio_offset; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (error); } @@ -612,7 +612,7 @@ vn_write(fp, uio, cred, flags, td) if ((fp->f_flag & O_FSYNC) || (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SYNCHRONOUS))) ioflag |= IO_SYNC; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; ioflag |= sequential_heuristic(uio, fp); @@ -620,7 +620,7 @@ vn_write(fp, uio, cred, flags, td) if ((flags & FOF_OFFSET) == 0) fp->f_offset = uio->uio_offset; fp->f_nextoff = uio->uio_offset; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (error); } @@ -900,10 +900,9 @@ vn_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) */ int #ifndef DEBUG_LOCKS -vn_lock(struct vnode *vp, int flags, struct thread *td) +vn_lock(struct vnode *vp, int flags) #else -debug_vn_lock(struct vnode *vp, int flags, struct thread *td, - const char *filename, int line) +debug_vn_lock(struct vnode *vp, int flags, const char *filename, int line) #endif { int error; @@ -913,7 +912,7 @@ debug_vn_lock(struct vnode *vp, int flags, struct thread *td, vp->filename = filename; vp->line = line; #endif - error = VOP_LOCK(vp, flags | LK_NOPAUSE, td); + error = VOP_LOCK(vp, flags | LK_NOPAUSE); if (error == 0) break; } while (flags & LK_RETRY); @@ -924,7 +923,7 @@ debug_vn_lock(struct vnode *vp, int flags, struct thread *td, * refs go away. So we can just check the flag. */ if (error == 0 && (vp->v_flag & VRECLAIMED)) { - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); error = ENOENT; } return (error); diff --git a/sys/kern/vfs_vopops.c b/sys/kern/vfs_vopops.c index e68714bc39..36e14dfb7e 100644 --- a/sys/kern/vfs_vopops.c +++ b/sys/kern/vfs_vopops.c @@ -32,7 +32,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.23 2006/05/05 16:35:00 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.24 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -807,7 +807,7 @@ vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td) } int -vop_lock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td) +vop_lock(struct vop_ops *ops, struct vnode *vp, int flags) { struct vop_lock_args ap; int error; @@ -816,14 +816,13 @@ vop_lock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td) ap.a_head.a_ops = ops; ap.a_vp = vp; ap.a_flags = flags; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_lock); return(error); } int -vop_unlock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td) +vop_unlock(struct vop_ops *ops, struct vnode *vp, int flags) { struct vop_unlock_args ap; int error; @@ -832,7 +831,6 @@ vop_unlock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td) ap.a_head.a_ops = ops; ap.a_vp = vp; ap.a_flags = flags; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_unlock); return(error); diff --git a/sys/netproto/smb/smb_conn.c b/sys/netproto/smb/smb_conn.c index 12c9ec7a3e..b59a20f256 100644 --- a/sys/netproto/smb/smb_conn.c +++ b/sys/netproto/smb/smb_conn.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_conn.c,v 1.1.2.1 2001/05/22 08:32:33 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_conn.c,v 1.15 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/netproto/smb/smb_conn.c,v 1.16 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -278,8 +278,6 @@ smb_co_ref(struct smb_connobj *cp, struct thread *td) void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred) { - struct thread *td = scred->scr_td; - SMB_CO_LOCK(cp); if (cp->co_usecount > 1) { cp->co_usecount--; diff --git a/sys/sys/vfsops.h b/sys/sys/vfsops.h index 1dbd7caff3..96bf349760 100644 --- a/sys/sys/vfsops.h +++ b/sys/sys/vfsops.h @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/vfsops.h,v 1.20 2006/05/05 16:35:03 dillon Exp $ + * $DragonFly: src/sys/sys/vfsops.h,v 1.21 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -305,14 +305,12 @@ struct vop_lock_args { struct vop_generic_args a_head; struct vnode *a_vp; int a_flags; - struct thread *a_td; }; struct vop_unlock_args { struct vop_generic_args a_head; struct vnode *a_vp; int a_flags; - struct thread *a_td; }; struct vop_bmap_args { @@ -774,10 +772,8 @@ int vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio, struct ucred *cred); int vop_inactive(struct vop_ops *ops, struct vnode *vp, struct thread *td); int vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td); -int vop_lock(struct vop_ops *ops, struct vnode *vp, - int flags, struct thread *td); -int vop_unlock(struct vop_ops *ops, struct vnode *vp, - int flags, struct thread *td); +int vop_lock(struct vop_ops *ops, struct vnode *vp, int flags); +int vop_unlock(struct vop_ops *ops, struct vnode *vp, int flags); int vop_bmap(struct vop_ops *ops, struct vnode *vp, off_t loffset, struct vnode **vpp, off_t *doffsetp, int *runp, int *runb); int vop_strategy(struct vop_ops *ops, struct vnode *vp, struct bio *bio); @@ -1011,10 +1007,10 @@ extern struct vnodeop_desc vop_nrename_desc; vop_inactive(*(vp)->v_ops, vp, td) #define VOP_RECLAIM(vp, td) \ vop_reclaim(*(vp)->v_ops, vp, td) -#define VOP_LOCK(vp, flags, td) \ - vop_lock(*(vp)->v_ops, vp, flags, td) -#define VOP_UNLOCK(vp, flags, td) \ - vop_unlock(*(vp)->v_ops, vp, flags, td) +#define VOP_LOCK(vp, flags) \ + vop_lock(*(vp)->v_ops, vp, flags) +#define VOP_UNLOCK(vp, flags) \ + vop_unlock(*(vp)->v_ops, vp, flags) #define VOP_BMAP(vp, loff, vpp, doffp, runp, runb) \ vop_bmap(*(vp)->v_ops, vp, loff, vpp, doffp, runp, runb) #define VOP_PRINT(vp) \ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index d419b61bb6..b8fc1a0666 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -32,7 +32,7 @@ * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 * $FreeBSD: src/sys/sys/vnode.h,v 1.111.2.19 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/sys/vnode.h,v 1.50 2006/05/05 16:35:03 dillon Exp $ + * $DragonFly: src/sys/sys/vnode.h,v 1.51 2006/05/05 21:15:09 dillon Exp $ */ #ifndef _SYS_VNODE_H_ @@ -604,11 +604,11 @@ int vrecycle (struct vnode *vp, struct thread *td); void vn_strategy(struct vnode *vp, struct bio *bio); int vn_close (struct vnode *vp, int flags, struct thread *td); int vn_isdisk (struct vnode *vp, int *errp); -int vn_lock (struct vnode *vp, int flags, struct thread *td); +int vn_lock (struct vnode *vp, int flags); #ifdef DEBUG_LOCKS -int debug_vn_lock (struct vnode *vp, int flags, struct thread *td, - const char *filename, int line); -#define vn_lock(vp,flags,p) debug_vn_lock(vp,flags,p,__FILE__,__LINE__) +int debug_vn_lock (struct vnode *vp, int flags, + const char *filename, int line); +#define vn_lock(vp,flags) debug_vn_lock(vp, flags, __FILE__, __LINE__) #endif int vn_get_namelen(struct vnode *, int *); diff --git a/sys/vfs/coda/coda_vnops.c b/sys/vfs/coda/coda_vnops.c index e6ba17190e..8958c13f61 100644 --- a/sys/vfs/coda/coda_vnops.c +++ b/sys/vfs/coda/coda_vnops.c @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vnops.c,v 1.22.2.1 2001/06/29 16:26:22 shafeeq Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.36 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.37 2006/05/05 21:15:09 dillon Exp $ * */ @@ -264,7 +264,7 @@ coda_open(void *v) goto done; /* We get the vnode back locked. Needs unlocked */ - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); /* Keep a reference until the close comes in. */ vref(*vpp); @@ -440,7 +440,7 @@ coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag, * We get the vnode back locked in both Mach and * NetBSD. Needs unlocked */ - VOP_UNLOCK(cfvp, 0, td); + VOP_UNLOCK(cfvp, 0); } else { opened_internally = 1; @@ -1036,7 +1036,7 @@ coda_lookup(void *v) */ if (!error || (error == EJUSTRETURN)) { if ((cnp->cn_flags & CNP_LOCKPARENT) == 0) { - if ((error = VOP_UNLOCK(dvp, 0, td))) { + if ((error = VOP_UNLOCK(dvp, 0))) { return error; } /* @@ -1044,7 +1044,7 @@ coda_lookup(void *v) * lock it without bothering to check anything else. */ if (*ap->a_vpp) { - if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) { + if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE))) { printf("coda_lookup: "); panic("unlocked parent but couldn't lock child"); } @@ -1053,7 +1053,7 @@ coda_lookup(void *v) /* The parent is locked, and may be the same as the child */ if (*ap->a_vpp && (*ap->a_vpp != dvp)) { /* Different, go ahead and lock it. */ - if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) { + if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE))) { printf("coda_lookup: "); panic("unlocked parent but couldn't lock child"); } @@ -1140,7 +1140,7 @@ coda_create(void *v) } if (!error) { - if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) { + if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE))) { printf("coda_create: "); panic("unlocked parent but couldn't lock child"); } diff --git a/sys/vfs/fdesc/fdesc_vfsops.c b/sys/vfs/fdesc/fdesc_vfsops.c index f2298c2999..f39d25d746 100644 --- a/sys/vfs/fdesc/fdesc_vfsops.c +++ b/sys/vfs/fdesc/fdesc_vfsops.c @@ -36,7 +36,7 @@ * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc_vfsops.c,v 1.22.2.3 2002/08/23 17:42:39 njl Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.17 2006/01/13 21:09:27 swildner Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.18 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -142,7 +142,6 @@ fdesc_unmount(struct mount *mp, int mntflags, struct thread *td) int fdesc_root(struct mount *mp, struct vnode **vpp) { - struct thread *td = curthread; /* XXX */ struct vnode *vp; /* @@ -150,7 +149,7 @@ fdesc_root(struct mount *mp, struct vnode **vpp) */ vp = VFSTOFDESC(mp)->f_root; vref(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return (0); } diff --git a/sys/vfs/fdesc/fdesc_vnops.c b/sys/vfs/fdesc/fdesc_vnops.c index f2aceb2696..e09e2d39a9 100644 --- a/sys/vfs/fdesc/fdesc_vnops.c +++ b/sys/vfs/fdesc/fdesc_vnops.c @@ -36,7 +36,7 @@ * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc_vnops.c,v 1.47.2.1 2001/10/22 22:49:26 chris Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.25 2006/04/01 20:46:53 dillon Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.26 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -192,11 +192,11 @@ fdesc_lookup(struct vop_old_lookup_args *ap) goto bad; } - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); if (cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp; vref(dvp); - vn_lock(dvp, LK_SHARED | LK_RETRY, td); + vn_lock(dvp, LK_SHARED | LK_RETRY); return (0); } @@ -228,12 +228,12 @@ fdesc_lookup(struct vop_old_lookup_args *ap) if (error) goto bad; VTOFDESC(fvp)->fd_fd = fd; - vn_lock(fvp, LK_SHARED | LK_RETRY, td); + vn_lock(fvp, LK_SHARED | LK_RETRY); *vpp = fvp; return (0); bad: - vn_lock(dvp, LK_SHARED | LK_RETRY, td); + vn_lock(dvp, LK_SHARED | LK_RETRY); *vpp = NULL; return (error); } diff --git a/sys/vfs/fifofs/fifo_vnops.c b/sys/vfs/fifofs/fifo_vnops.c index 9642caf2e9..b544dcfc38 100644 --- a/sys/vfs/fifofs/fifo_vnops.c +++ b/sys/vfs/fifofs/fifo_vnops.c @@ -32,7 +32,7 @@ * * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 * $FreeBSD: src/sys/miscfs/fifofs/fifo_vnops.c,v 1.45.2.4 2003/04/22 10:11:24 bde Exp $ - * $DragonFly: src/sys/vfs/fifofs/fifo_vnops.c,v 1.26 2006/04/14 01:07:38 dillon Exp $ + * $DragonFly: src/sys/vfs/fifofs/fifo_vnops.c,v 1.27 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -219,10 +219,10 @@ fifo_open(struct vop_open_args *ap) } if ((ap->a_mode & FREAD) && (ap->a_mode & O_NONBLOCK) == 0) { if (fip->fi_writers == 0) { - VOP_UNLOCK(vp, 0, ap->a_td); + VOP_UNLOCK(vp, 0); error = tsleep((caddr_t)&fip->fi_readers, PCATCH, "fifoor", 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, ap->a_td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error) goto bad; /* @@ -240,10 +240,10 @@ fifo_open(struct vop_open_args *ap) } } else { if (fip->fi_readers == 0) { - VOP_UNLOCK(vp, 0, ap->a_td); + VOP_UNLOCK(vp, 0); error = tsleep((caddr_t)&fip->fi_writers, PCATCH, "fifoow", 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, ap->a_td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error) goto bad; /* @@ -273,7 +273,6 @@ fifo_read(struct vop_read_args *ap) { struct uio *uio = ap->a_uio; struct socket *rso = ap->a_vp->v_fifoinfo->fi_readsock; - struct thread *td = uio->uio_td; int error, startresid; #ifdef DIAGNOSTIC @@ -285,10 +284,10 @@ fifo_read(struct vop_read_args *ap) if (ap->a_ioflag & IO_NDELAY) rso->so_state |= SS_NBIO; startresid = uio->uio_resid; - VOP_UNLOCK(ap->a_vp, 0, td); + VOP_UNLOCK(ap->a_vp, 0); error = soreceive(rso, (struct sockaddr **)0, uio, (struct mbuf **)0, (struct mbuf **)0, (int *)0); - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY); if (ap->a_ioflag & IO_NDELAY) rso->so_state &= ~SS_NBIO; return (error); @@ -314,10 +313,10 @@ fifo_write(struct vop_write_args *ap) #endif if (ap->a_ioflag & IO_NDELAY) wso->so_state |= SS_NBIO; - VOP_UNLOCK(ap->a_vp, 0, td); + VOP_UNLOCK(ap->a_vp, 0); error = sosend(wso, (struct sockaddr *)0, ap->a_uio, 0, (struct mbuf *)0, 0, td); - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY); if (ap->a_ioflag & IO_NDELAY) wso->so_state &= ~SS_NBIO; return (error); diff --git a/sys/vfs/gnu/ext2fs/ext2_lookup.c b/sys/vfs/gnu/ext2fs/ext2_lookup.c index d5ab53f4fb..6da31f03c8 100644 --- a/sys/vfs/gnu/ext2fs/ext2_lookup.c +++ b/sys/vfs/gnu/ext2fs/ext2_lookup.c @@ -5,7 +5,7 @@ * University of Utah, Department of Computer Science * * $FreeBSD: src/sys/gnu/ext2fs/ext2_lookup.c,v 1.21.2.3 2002/11/17 02:02:42 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_lookup.c,v 1.20 2006/05/05 16:35:05 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_lookup.c,v 1.21 2006/05/05 21:15:09 dillon Exp $ */ /* * Copyright (c) 1989, 1993 @@ -300,7 +300,6 @@ ext2_lookup(struct vop_old_lookup_args *ap) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct thread *td = cnp->cn_td; globaldata_t gd = mycpu; int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->s_blocksize; @@ -517,7 +516,7 @@ searchloop: * information cannot be used. */ if (!lockparent) - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); return (EJUSTRETURN); } return (ENOENT); @@ -590,7 +589,7 @@ found: } *vpp = tdp; if (!lockparent) - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); return (0); } @@ -613,7 +612,7 @@ found: return (error); *vpp = tdp; if (!lockparent) - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); return (0); } @@ -638,12 +637,12 @@ found: */ pdp = vdp; if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ + VOP_UNLOCK(pdp, 0); /* race to get the inode */ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) { - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); return (error); } - if (lockparent && (error = vn_lock(pdp, LK_EXCLUSIVE, td))) { + if (lockparent && (error = vn_lock(pdp, LK_EXCLUSIVE))) { vput(tdp); return (error); } @@ -655,7 +654,7 @@ found: if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) return (error); if (!lockparent) - VOP_UNLOCK(pdp, 0, td); + VOP_UNLOCK(pdp, 0); *vpp = tdp; } return (0); diff --git a/sys/vfs/gnu/ext2fs/ext2_quota.c b/sys/vfs/gnu/ext2fs/ext2_quota.c index 9994aeda31..c5a122f1bb 100644 --- a/sys/vfs/gnu/ext2fs/ext2_quota.c +++ b/sys/vfs/gnu/ext2fs/ext2_quota.c @@ -35,7 +35,7 @@ * * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ufs/ufs_quota.c,v 1.27.2.3 2002/01/15 10:33:32 phk Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_quota.c,v 1.1 2006/04/04 17:34:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_quota.c,v 1.2 2006/05/05 21:15:09 dillon Exp $ */ #include @@ -401,7 +401,7 @@ ext2_quotaon(struct thread *td, struct mount *mp, int type, caddr_t fname) nd.nl_open_vp = NULL; nlookup_done(&nd); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (*vpp != vp) ext2_quotaoff(td, mp, type); ump->um_qflags[type] |= QTF_OPENING; @@ -725,7 +725,6 @@ static int ext2_dqget(struct vnode *vp, u_long id, struct ext2mount *ump, int type, struct ext2_dquot **dqp) { - struct thread *td = curthread; /* XXX */ struct ext2_dquot *dq; struct ext2_dqhash *dqh; struct vnode *dqvp; @@ -781,7 +780,7 @@ ext2_dqget(struct vnode *vp, u_long id, struct ext2mount *ump, int type, * Initialize the contents of the dquot structure. */ if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); LIST_INSERT_HEAD(dqh, dq, dq_hash); DQREF(dq); dq->dq_flags = DQ_LOCK; @@ -801,7 +800,7 @@ ext2_dqget(struct vnode *vp, u_long id, struct ext2mount *ump, int type, if (auio.uio_resid == sizeof(struct ext2_dqblk) && error == 0) bzero((caddr_t)&dq->dq_dqb, sizeof(struct ext2_dqblk)); if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, td); + VOP_UNLOCK(dqvp, 0); if (dq->dq_flags & DQ_WANT) wakeup((caddr_t)dq); dq->dq_flags = 0; @@ -868,7 +867,6 @@ ext2_dqrele(struct vnode *vp, struct ext2_dquot *dq) static int ext2_dqsync(struct vnode *vp, struct ext2_dquot *dq) { - struct thread *td = curthread; /* XXX */ struct vnode *dqvp; struct iovec aiov; struct uio auio; @@ -881,13 +879,13 @@ ext2_dqsync(struct vnode *vp, struct ext2_dquot *dq) if ((dqvp = dq->dq_ump->um_quotas[dq->dq_type]) == NULLVP) panic("dqsync: file"); if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); while (dq->dq_flags & DQ_LOCK) { dq->dq_flags |= DQ_WANT; (void) tsleep((caddr_t)dq, 0, "dqsync", 0); if ((dq->dq_flags & DQ_MOD) == 0) { if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, td); + VOP_UNLOCK(dqvp, 0); return (0); } } @@ -908,7 +906,7 @@ ext2_dqsync(struct vnode *vp, struct ext2_dquot *dq) wakeup((caddr_t)dq); dq->dq_flags &= ~(DQ_MOD|DQ_LOCK|DQ_WANT); if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, td); + VOP_UNLOCK(dqvp, 0); return (error); } diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index edb434f4b1..5405f07e72 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vfsops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vfsops.c @@ -38,7 +38,7 @@ * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vfsops.c,v 1.63.2.7 2002/07/01 00:18:51 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.38 2006/04/09 20:47:56 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.39 2006/05/05 21:15:09 dillon Exp $ */ #include "opt_quota.h" @@ -284,10 +284,10 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, ext2_sbupdate(ump, MNT_WAIT); } fs->s_rd_only = 1; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); VOP_CLOSE(devvp, FREAD|FWRITE, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } if (!error && (mp->mnt_flag & MNT_RELOAD)) error = ext2_reload(mp, proc0.p_ucred, td); @@ -302,13 +302,13 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, * that user has necessary permissions on the device. */ if (cred->cr_uid != 0) { - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_ACCESS(devvp, VREAD | VWRITE, cred, td)) != 0) { - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 || @@ -327,10 +327,10 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, fs->s_es->s_state &= ~EXT2_VALID_FS; ext2_sbupdate(ump, MNT_WAIT); fs->s_rd_only = 0; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, NULL, td); VOP_CLOSE(devvp, FREAD, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } if (args.fspec == 0) { /* @@ -366,12 +366,12 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, accessmode = VREAD; if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_ACCESS(devvp, accessmode, cred, td)) != 0) { vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } if ((mp->mnt_flag & MNT_UPDATE) == 0) { @@ -731,9 +731,9 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) #endif ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return (error); dev = devvp->v_rdev; @@ -1021,10 +1021,10 @@ ext2_sync(struct mount *mp, int waitfor, struct thread *td) * Force stale file system control information to be flushed. */ if (waitfor != MNT_LAZY) { - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) scaninfo.allerror = error; - VOP_UNLOCK(ump->um_devvp, 0, td); + VOP_UNLOCK(ump->um_devvp, 0); } #if QUOTA ext2_qsync(mp); diff --git a/sys/vfs/gnu/ext2fs/ext2_vnops.c b/sys/vfs/gnu/ext2fs/ext2_vnops.c index 49923ccde7..26ad2f6c96 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vnops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vnops.c @@ -44,7 +44,7 @@ * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 * @(#)ext2_vnops.c 8.7 (Berkeley) 2/3/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vnops.c,v 1.51.2.2 2003/01/02 17:26:18 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.31 2006/04/28 16:45:34 swildner Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.32 2006/05/05 21:15:09 dillon Exp $ */ #include "opt_quota.h" @@ -355,7 +355,6 @@ ext2_link(struct vop_old_link_args *ap) struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; struct componentname *cnp = ap->a_cnp; - struct thread *td = cnp->cn_td; struct inode *ip; int error; @@ -363,7 +362,7 @@ ext2_link(struct vop_old_link_args *ap) error = EXDEV; goto out2; } - if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) { + if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE))) { goto out2; } ip = VTOI(vp); @@ -386,7 +385,7 @@ ext2_link(struct vop_old_link_args *ap) } out1: if (tdvp != vp) - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); out2: return (error); } @@ -408,7 +407,6 @@ ext2_rename(struct vop_old_rename_args *ap) struct vnode *fdvp = ap->a_fdvp; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; - struct thread *td = fcnp->cn_td; struct inode *ip, *xp, *dp; struct dirtemplate dirbuf; int doingdirectory = 0, oldparent = 0, newparent = 0; @@ -449,7 +447,7 @@ abortit: goto abortit; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, td)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) goto abortit; /* @@ -459,13 +457,13 @@ abortit: dp = VTOI(fdvp); ip = VTOI(fvp); if (ip->i_nlink >= LINK_MAX) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EMLINK; goto abortit; } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EPERM; goto abortit; } @@ -476,7 +474,7 @@ abortit: if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') || dp == ip || (fcnp->cn_flags | tcnp->cn_flags) & CNP_ISDOTDOT || (ip->i_flag & IN_RENAME)) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EINVAL; goto abortit; } @@ -505,7 +503,7 @@ abortit: ip->i_nlink++; ip->i_flag |= IN_CHANGE; if ((error = EXT2_UPDATE(fvp, 1)) != 0) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); goto bad; } @@ -520,7 +518,7 @@ abortit: * call to checkpath(). */ error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); /* * tvp (if not NULL) and tdvp are locked. fvp and fdvp are not. @@ -828,7 +826,7 @@ bad: out: if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { ip->i_nlink--; ip->i_flag |= IN_CHANGE; ip->i_flag &= ~IN_RENAME; @@ -1055,7 +1053,7 @@ ext2_rmdir(struct vop_old_rmdir_args *ap) goto out; dp->i_nlink--; dp->i_flag |= IN_CHANGE; - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); /* * Truncate inode. The only stuff left * in the directory is "." and "..". The @@ -1069,7 +1067,7 @@ ext2_rmdir(struct vop_old_rmdir_args *ap) */ ip->i_nlink -= 2; error = EXT2_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred, td); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); out: return (error); } diff --git a/sys/vfs/gnu/ext2fs/fs.h b/sys/vfs/gnu/ext2fs/fs.h index 4fe6dc250b..665435b214 100644 --- a/sys/vfs/gnu/ext2fs/fs.h +++ b/sys/vfs/gnu/ext2fs/fs.h @@ -38,7 +38,7 @@ * * @(#)fs.h 8.7 (Berkeley) 4/19/94 * $FreeBSD: src/sys/gnu/ext2fs/fs.h,v 1.5.2.1 2000/11/11 13:12:45 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/fs.h,v 1.9 2006/04/05 21:06:22 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/fs.h,v 1.10 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -167,8 +167,8 @@ extern u_char *fragtbl[]; * I think I'll try a VOP_LOCK/VOP_UNLOCK on the device vnode */ #define DEVVP(inode) (VFSTOEXT2(ITOV(inode)->v_mount)->um_devvp) -#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, curthread) -#define unlock_super(devvp) VOP_UNLOCK(devvp, 0, curthread) +#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY) +#define unlock_super(devvp) VOP_UNLOCK(devvp, 0) /* * To lock a buffer, set the B_LOCKED flag and then brelse() it. To unlock, diff --git a/sys/vfs/hpfs/hpfs.h b/sys/vfs/hpfs/hpfs.h index 4b1d34fe27..5192070423 100644 --- a/sys/vfs/hpfs/hpfs.h +++ b/sys/vfs/hpfs/hpfs.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs.h,v 1.1 1999/12/09 19:09:58 semenu Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs.h,v 1.17 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs.h,v 1.18 2006/05/05 21:15:09 dillon Exp $ */ /*#define HPFS_DEBUG 10*/ @@ -399,10 +399,10 @@ typedef int (vop_t) (void *); #define LOCKMGR(a, b, d) lockmgr((a), (b), NULL) #else /* defined(__DragonFly__) */ #define HASHINIT(a, b, c, d) hashinit((a), (b), (d)) -#define VOP__LOCK(a, b, c) VOP_LOCK((a), (b), (c)) -#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b), (c)) +#define VOP__LOCK(a, b, c) VOP_LOCK((a), (b)) +#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b)) #define VGET(a, b, c) vget((a), (b), (c)) -#define VN_LOCK(a, b, c) vn_lock((a), (b), (c)) +#define VN_LOCK(a, b, c) vn_lock((a), (b)) #define LOCKMGR(a, b, d) lockmgr((a), (b)) #endif diff --git a/sys/vfs/isofs/cd9660/cd9660_lookup.c b/sys/vfs/isofs/cd9660/cd9660_lookup.c index 962437b8e7..e629b1653f 100644 --- a/sys/vfs/isofs/cd9660/cd9660_lookup.c +++ b/sys/vfs/isofs/cd9660/cd9660_lookup.c @@ -39,7 +39,7 @@ * * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94 * $FreeBSD: src/sys/isofs/cd9660/cd9660_lookup.c,v 1.23.2.2 2001/11/04 06:19:47 dillon Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_lookup.c,v 1.21 2006/04/07 06:38:31 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_lookup.c,v 1.22 2006/05/05 21:15:10 dillon Exp $ */ #include @@ -120,7 +120,6 @@ cd9660_lookup(struct vop_old_lookup_args *ap) struct componentname *cnp = ap->a_cnp; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct thread *td = cnp->cn_td; bp = NULL; *vpp = NULL; @@ -347,16 +346,16 @@ found: * it's a relocated directory. */ if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ + VOP_UNLOCK(pdp, 0); /* race to get the inode */ error = cd9660_vget_internal(vdp->v_mount, dp->i_ino, &tdp, dp->i_ino != ino, ep); brelse(bp); if (error) { - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); return (error); } if (lockparent) { - if ((error = vn_lock(pdp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vn_lock(pdp, LK_EXCLUSIVE)) != 0) { cnp->cn_flags |= CNP_PDIRUNLOCK; vput(tdp); return (error); @@ -376,7 +375,7 @@ found: return (error); if (!lockparent) { cnp->cn_flags |= CNP_PDIRUNLOCK; - VOP_UNLOCK(pdp, 0, td); + VOP_UNLOCK(pdp, 0); } *vpp = tdp; } diff --git a/sys/vfs/isofs/cd9660/cd9660_vfsops.c b/sys/vfs/isofs/cd9660/cd9660_vfsops.c index fe88b06774..fb1aca7c55 100644 --- a/sys/vfs/isofs/cd9660/cd9660_vfsops.c +++ b/sys/vfs/isofs/cd9660/cd9660_vfsops.c @@ -37,7 +37,7 @@ * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 * $FreeBSD: src/sys/isofs/cd9660/cd9660_vfsops.c,v 1.74.2.7 2002/04/08 09:39:29 bde Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.33 2006/04/07 06:38:31 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.34 2006/05/05 21:15:10 dillon Exp $ */ #include @@ -151,9 +151,9 @@ iso_mountroot(struct mount *mp, struct thread *td) } args.flags = ISOFSMNT_ROOT; - vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(rootvp, FREAD, FSCRED, NULL, td); - VOP_UNLOCK(rootvp, 0, td); + VOP_UNLOCK(rootvp, 0); if (error) return (error); @@ -231,7 +231,7 @@ cd9660_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) * or has superuser abilities */ accessmode = VREAD; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(devvp, accessmode, td->td_proc->p_ucred, td); if (error) error = suser(td); @@ -239,7 +239,7 @@ cd9660_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if ((mp->mnt_flag & MNT_UPDATE) == 0) { error = iso_mountfs(devvp, mp, td, &args); @@ -300,9 +300,9 @@ iso_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0))) return (error); - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return error; dev = devvp->v_rdev; diff --git a/sys/vfs/msdosfs/msdosfs_lookup.c b/sys/vfs/msdosfs/msdosfs_lookup.c index 5e821c0890..32b1824a5a 100644 --- a/sys/vfs/msdosfs/msdosfs_lookup.c +++ b/sys/vfs/msdosfs/msdosfs_lookup.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_lookup.c,v 1.30.2.1 2000/11/03 15:55:39 bp Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.17 2006/03/24 22:39:22 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.18 2006/05/05 21:15:10 dillon Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */ /*- @@ -109,7 +109,6 @@ msdosfs_lookup(struct vop_old_lookup_args *ap) u_char dosfilename[12]; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct thread *td = cnp->cn_td; int unlen; int wincnt = 1; @@ -362,7 +361,7 @@ notfound: * information cannot be used. */ if (!lockparent) { - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (EJUSTRETURN); @@ -448,7 +447,7 @@ foundroot: return (error); *vpp = DETOV(tdp); if (!lockparent) { - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (0); @@ -479,7 +478,7 @@ foundroot: return (error); *vpp = DETOV(tdp); if (!lockparent) { - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (0); @@ -506,16 +505,16 @@ foundroot: */ pdp = vdp; if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(pdp, 0, td); + VOP_UNLOCK(pdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; error = deget(pmp, cluster, blkoff, &tdp); if (error) { - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); cnp->cn_flags &= ~CNP_PDIRUNLOCK; return (error); } if (lockparent) { - error = vn_lock(pdp, LK_EXCLUSIVE, td); + error = vn_lock(pdp, LK_EXCLUSIVE); if (error) { vput(DETOV(tdp)); return (error); @@ -530,7 +529,7 @@ foundroot: if ((error = deget(pmp, cluster, blkoff, &tdp)) != 0) return (error); if (!lockparent) { - VOP_UNLOCK(pdp, 0, td); + VOP_UNLOCK(pdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } *vpp = DETOV(tdp); diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index 1b4a823f83..52b91e1aeb 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -1,5 +1,5 @@ /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/msdosfs/Attic/msdosfs_vfsops.c,v 1.60.2.8 2004/03/02 09:43:04 tjr Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.31 2006/03/24 18:35:34 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.32 2006/05/05 21:15:10 dillon Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -205,14 +205,14 @@ msdosfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) */ if (p->p_ucred->cr_uid != 0) { devvp = pmp->pm_devvp; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(devvp, VREAD | VWRITE, p->p_ucred, td); if (error) { - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } pmp->pm_flags &= ~MSDOSFSMNT_RONLY; } @@ -257,13 +257,13 @@ msdosfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) accessmode = VREAD; if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(devvp, accessmode, p->p_ucred, td); if (error) { vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } if ((mp->mnt_flag & MNT_UPDATE) == 0) { error = mountmsdosfs(devvp, mp, td, &args); @@ -325,16 +325,16 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td, return (error); if (count_udev(devvp->v_udev) > 0) return (EBUSY); - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = vinvalbuf(devvp, V_SAVE, td, 0, 0); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return (error); dev = devvp->v_rdev; @@ -809,10 +809,10 @@ msdosfs_sync(struct mount *mp, int waitfor, struct thread *td) * Flush filesystem control info. */ if (waitfor != MNT_LAZY) { - vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(pmp->pm_devvp, waitfor, td)) != 0) scaninfo.allerror = error; - VOP_UNLOCK(pmp->pm_devvp, 0, td); + VOP_UNLOCK(pmp->pm_devvp, 0); } return (scaninfo.allerror); } diff --git a/sys/vfs/msdosfs/msdosfs_vnops.c b/sys/vfs/msdosfs/msdosfs_vnops.c index c16eeae46d..9496c10774 100644 --- a/sys/vfs/msdosfs/msdosfs_vnops.c +++ b/sys/vfs/msdosfs/msdosfs_vnops.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_vnops.c,v 1.95.2.4 2003/06/13 15:05:47 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.35 2006/04/24 22:01:52 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.36 2006/05/05 21:15:10 dillon Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -978,7 +978,6 @@ msdosfs_rename(struct vop_old_rename_args *ap) struct vnode *tvp = ap->a_tvp; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; - struct thread *td = fcnp->cn_td; struct denode *ip, *xp, *dp, *zp; u_char toname[11], oldname[11]; u_long from_diroffset, to_diroffset; @@ -1027,7 +1026,7 @@ abortit: * fvp, fdvp are unlocked, tvp, tdvp are locked. Lock fvp and note * that we have to unlock it to use the abortit target. */ - error = vn_lock(fvp, LK_EXCLUSIVE, td); + error = vn_lock(fvp, LK_EXCLUSIVE); if (error) goto abortit; dp = VTODE(fdvp); @@ -1048,7 +1047,7 @@ abortit: (fcnp->cn_flags & CNP_ISDOTDOT) || (tcnp->cn_flags & CNP_ISDOTDOT) || (ip->de_flag & DE_RENAME)) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EINVAL; goto abortit; } @@ -1082,7 +1081,7 @@ abortit: * call to doscheckpath(). */ error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); if (VTODE(fdvp)->de_StartCluster != VTODE(tdvp)->de_StartCluster) newparent = 1; @@ -1186,7 +1185,7 @@ abortit: fcnp->cn_flags &= ~CNP_MODMASK; fcnp->cn_flags |= CNP_LOCKPARENT; if (newparent == 0) - VOP_UNLOCK(tdvp, 0, td); + VOP_UNLOCK(tdvp, 0); error = relookup(fdvp, &fvp, fcnp); if (error || fvp == NULL) { /* @@ -1518,13 +1517,13 @@ msdosfs_rmdir(struct vop_old_rmdir_args *ap) * directory. Since dos filesystems don't do this we just purge * the name cache. */ - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); /* * Truncate the directory that is being deleted. */ error = detrunc(ip, (u_long)0, IO_SYNC, td); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); out: return (error); } diff --git a/sys/vfs/nfs/nfs_serv.c b/sys/vfs/nfs/nfs_serv.c index 9b356f2915..af4b44df62 100644 --- a/sys/vfs/nfs/nfs_serv.c +++ b/sys/vfs/nfs/nfs_serv.c @@ -35,7 +35,7 @@ * * @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95 * $FreeBSD: src/sys/nfs/nfs_serv.c,v 1.93.2.6 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_serv.c,v 1.33 2006/05/05 16:35:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_serv.c,v 1.34 2006/05/05 21:15:10 dillon Exp $ */ /* @@ -491,7 +491,7 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, * However, the cnd resource continues to be maintained * via the original nd. Confused? You aren't alone! */ - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); ncp = cache_hold(nd.nl_ncp); nlookup_done(&nd); error = nlookup_init_raw(&nd, nfs_pub.np_index, @@ -2852,7 +2852,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = 0; goto nfsmout; } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); /* * end section. Allocate rbuf and continue @@ -2869,7 +2869,7 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -2883,7 +2883,7 @@ again: if (!error) error = getret; } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (error) { vrele(vp); vp = NULL; @@ -3133,7 +3133,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = 0; goto nfsmout; } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; @@ -3146,7 +3146,7 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3154,7 +3154,7 @@ again: error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (!cookies && !error) error = NFSERR_PERM; if (!error) diff --git a/sys/vfs/nfs/nfs_subs.c b/sys/vfs/nfs/nfs_subs.c index b61a3f1a2f..2a6d74054f 100644 --- a/sys/vfs/nfs/nfs_subs.c +++ b/sys/vfs/nfs/nfs_subs.c @@ -35,7 +35,7 @@ * * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 * $FreeBSD: /repoman/r/ncvs/src/sys/nfsclient/nfs_subs.c,v 1.128 2004/04/14 23:23:55 peadar Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_subs.c,v 1.37 2006/04/07 06:38:33 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_subs.c,v 1.38 2006/05/05 21:15:10 dillon Exp $ */ /* @@ -1803,7 +1803,6 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, struct ucred *cred, struct nfssvc_sock *slp, struct sockaddr *nam, int *rdonlyp, int kerbflag, int pubflag) { - struct thread *td = curthread; /* XXX */ struct mount *mp; int i; struct ucred *credanon; @@ -1865,7 +1864,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, *rdonlyp = 0; if (!lockflag) - VOP_UNLOCK(*vpp, 0, td); + VOP_UNLOCK(*vpp, 0); return (0); } diff --git a/sys/vfs/nfs/nfs_vfsops.c b/sys/vfs/nfs/nfs_vfsops.c index 05fce3c71f..ac22bfa5d3 100644 --- a/sys/vfs/nfs/nfs_vfsops.c +++ b/sys/vfs/nfs/nfs_vfsops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 * $FreeBSD: src/sys/nfs/nfs_vfsops.c,v 1.91.2.7 2003/01/27 20:04:08 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.38 2006/04/07 06:38:33 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.39 2006/05/05 21:15:10 dillon Exp $ */ #include "opt_bootp.h" @@ -997,7 +997,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, /* * Lose the lock but keep the ref. */ - VOP_UNLOCK(*vpp, 0, curthread); + VOP_UNLOCK(*vpp, 0); return (0); bad: diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index c0b42624bb..d3b2f497c7 100644 --- a/sys/vfs/nfs/nfs_vnops.c +++ b/sys/vfs/nfs/nfs_vnops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 * $FreeBSD: src/sys/nfs/nfs_vnops.c,v 1.150.2.5 2001/12/20 19:56:28 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.59 2006/05/05 16:35:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.60 2006/05/05 21:15:10 dillon Exp $ */ @@ -962,7 +962,6 @@ nfs_lookup(struct vop_old_lookup_args *ap) struct nfsnode *np; int lockparent, wantparent, error = 0, attrflag, fhsize; int v3 = NFS_ISV3(dvp); - struct thread *td = cnp->cn_td; /* * Read-only mount check and directory check. @@ -1028,24 +1027,24 @@ nfs_lookup(struct vop_old_lookup_args *ap) *vpp = newvp; m_freem(mrep); if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (0); } if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; error = nfs_nget(dvp->v_mount, fhp, fhsize, &np); if (error) { - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); cnp->cn_flags &= ~CNP_PDIRUNLOCK; return (error); /* NOTE: return error from nget */ } newvp = NFSTOV(np); if (lockparent) { - error = vn_lock(dvp, LK_EXCLUSIVE, td); + error = vn_lock(dvp, LK_EXCLUSIVE); if (error) { vput(newvp); return (error); @@ -1062,7 +1061,7 @@ nfs_lookup(struct vop_old_lookup_args *ap) return (error); } if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } newvp = NFSTOV(np); @@ -1091,7 +1090,7 @@ nfsmout: cnp->cn_nameiop == NAMEI_RENAME) && error == ENOENT) { if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } if (dvp->v_mount->mnt_flag & MNT_RDONLY) diff --git a/sys/vfs/ntfs/ntfs.h b/sys/vfs/ntfs/ntfs.h index 686628dd86..6cae7ffa91 100644 --- a/sys/vfs/ntfs/ntfs.h +++ b/sys/vfs/ntfs/ntfs.h @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs.h,v 1.8.2.2 2001/10/12 22:08:49 semenu Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs.h,v 1.10 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs.h,v 1.11 2006/05/05 21:15:10 dillon Exp $ */ /*#define NTFS_DEBUG 1*/ @@ -324,9 +324,9 @@ typedef int (vop_t) (void *); #define LOCKMGR(a, b) lockmgr((a), (b), NULL) #else /* !NetBSD */ #define HASHINIT(a, b, c, d) hashinit((a), (b), (d)) -#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b), (c)) +#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b)) #define VGET(a, b, c) vget((a), (b), (c)) -#define VN_LOCK(a, b, c) vn_lock((a), (b), (c)) +#define VN_LOCK(a, b, c) vn_lock((a), (b)) #define LOCKMGR(a, b) lockmgr((a), (b)) #endif /* NetBSD */ diff --git a/sys/vfs/nullfs/null_vfsops.c b/sys/vfs/nullfs/null_vfsops.c index aa274fd687..032f0260ff 100644 --- a/sys/vfs/nullfs/null_vfsops.c +++ b/sys/vfs/nullfs/null_vfsops.c @@ -37,7 +37,7 @@ * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 * $FreeBSD: src/sys/miscfs/nullfs/null_vfsops.c,v 1.35.2.3 2001/07/26 20:37:11 iedowse Exp $ - * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.19 2006/01/04 03:09:53 dillon Exp $ + * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.20 2006/05/05 21:15:10 dillon Exp $ */ /* @@ -129,7 +129,7 @@ nullfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, null_vnodeop_entries, 0); - VOP_UNLOCK(rootvp, 0, td); + VOP_UNLOCK(rootvp, 0); /* * Keep a held reference to the root vnode. @@ -181,7 +181,6 @@ nullfs_unmount(struct mount *mp, int mntflags, struct thread *td) static int nullfs_root(struct mount *mp, struct vnode **vpp) { - struct thread *td = curthread; /* XXX */ struct vnode *vp; NULLFSDEBUG("nullfs_root(mp = %p, vp = %p)\n", (void *)mp, @@ -200,7 +199,7 @@ nullfs_root(struct mount *mp, struct vnode **vpp) return (EDEADLK); } #endif - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return 0; } diff --git a/sys/vfs/nwfs/nwfs_vfsops.c b/sys/vfs/nwfs/nwfs_vfsops.c index dbffce5dcd..cdf2499b4c 100644 --- a/sys/vfs/nwfs/nwfs_vfsops.c +++ b/sys/vfs/nwfs/nwfs_vfsops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_vfsops.c,v 1.6.2.6 2001/10/25 19:18:54 dillon Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.20 2005/09/17 07:43:12 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.21 2006/05/05 21:15:10 dillon Exp $ */ #include "opt_ncp.h" #ifndef NCP @@ -217,7 +217,7 @@ nwfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) /* * Lose the lock but keep the ref. */ - VOP_UNLOCK(vp, 0, curthread); + VOP_UNLOCK(vp, 0); NCPVODEBUG("rootvp.vrefcnt=%d\n",vp->v_usecount); return error; bad: diff --git a/sys/vfs/nwfs/nwfs_vnops.c b/sys/vfs/nwfs/nwfs_vnops.c index 987b23fadc..8ea0c13e32 100644 --- a/sys/vfs/nwfs/nwfs_vnops.c +++ b/sys/vfs/nwfs/nwfs_vnops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_vnops.c,v 1.6.2.3 2001/03/14 11:26:59 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.27 2006/04/28 00:24:46 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.28 2006/05/05 21:15:10 dillon Exp $ */ #include #include @@ -905,7 +905,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & CNP_ISD /* Handle RENAME or CREATE case... */ if ((nameiop == NAMEI_CREATE || nameiop == NAMEI_RENAME) && wantparent) { if (!lockparent) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); return (EJUSTRETURN); } return ENOENT; @@ -924,7 +924,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & CNP_ISD error = nwfs_nget(mp, fid, fap, dvp, &vp); if (error) return (error); *vpp = vp; - if (!lockparent) VOP_UNLOCK(dvp, 0, td); + if (!lockparent) VOP_UNLOCK(dvp, 0); return (0); } if (nameiop == NAMEI_RENAME && wantparent) { @@ -935,17 +935,17 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & CNP_ISD if (error) return (error); *vpp = vp; if (!lockparent) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); return (0); } if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(dvp, 0, td); /* race to get the inode */ + VOP_UNLOCK(dvp, 0); /* race to get the inode */ error = nwfs_nget(mp, fid, NULL, NULL, &vp); if (error) { - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); return (error); } - if (lockparent && (error = vn_lock(dvp, LK_EXCLUSIVE, td))) { + if (lockparent && (error = vn_lock(dvp, LK_EXCLUSIVE))) { vput(vp); return (error); } @@ -959,7 +959,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & CNP_ISD *vpp = vp; NCPVNDEBUG("lookup: getnewvp!\n"); if (!lockparent) - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); } #if 0 /* XXX MOVE TO NREMOVE */ diff --git a/sys/vfs/portal/portal_vfsops.c b/sys/vfs/portal/portal_vfsops.c index 54a0412847..cfcc54acaa 100644 --- a/sys/vfs/portal/portal_vfsops.c +++ b/sys/vfs/portal/portal_vfsops.c @@ -36,7 +36,7 @@ * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/portal/portal_vfsops.c,v 1.26.2.2 2001/07/26 20:37:16 iedowse Exp $ - * $DragonFly: src/sys/vfs/portal/portal_vfsops.c,v 1.17 2005/09/17 07:43:12 dillon Exp $ + * $DragonFly: src/sys/vfs/portal/portal_vfsops.c,v 1.18 2006/05/05 21:15:10 dillon Exp $ */ /* @@ -197,7 +197,6 @@ portal_unmount(struct mount *mp, int mntflags, struct thread *td) static int portal_root(struct mount *mp, struct vnode **vpp) { - struct thread *td = curthread; /* XXX */ struct vnode *vp; /* @@ -205,7 +204,7 @@ portal_root(struct mount *mp, struct vnode **vpp) */ vp = VFSTOPORTAL(mp)->pm_root; vref(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return (0); } diff --git a/sys/vfs/procfs/procfs_vnops.c b/sys/vfs/procfs/procfs_vnops.c index e1b5438417..48de36f2c2 100644 --- a/sys/vfs/procfs/procfs_vnops.c +++ b/sys/vfs/procfs/procfs_vnops.c @@ -37,7 +37,7 @@ * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_vnops.c,v 1.76.2.7 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.29 2006/04/01 20:46:53 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.30 2006/05/05 21:15:10 dillon Exp $ */ /* @@ -769,7 +769,7 @@ out: if (error == 0 && *vpp != dvp) { if ((cnp->cn_flags & CNP_LOCKPARENT) == 0) { cnp->cn_flags |= CNP_PDIRUNLOCK; - VOP_UNLOCK(dvp, 0, cnp->cn_td); + VOP_UNLOCK(dvp, 0); } } return (error); diff --git a/sys/vfs/smbfs/smbfs_io.c b/sys/vfs/smbfs/smbfs_io.c index fa2473956a..2af7394072 100644 --- a/sys/vfs/smbfs/smbfs_io.c +++ b/sys/vfs/smbfs/smbfs_io.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_io.c,v 1.3.2.3 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_io.c,v 1.23 2006/04/30 17:22:18 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_io.c,v 1.24 2006/05/05 21:15:10 dillon Exp $ * */ #include @@ -207,10 +207,10 @@ smbfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) if (vp->v_type == VDIR) { lks = LK_EXCLUSIVE;/*lockstatus(&vp->v_lock, td);*/ if (lks == LK_SHARED) - vn_lock(vp, LK_UPGRADE | LK_RETRY, td); + vn_lock(vp, LK_UPGRADE | LK_RETRY); error = smbfs_readvdir(vp, uiop, cred); if (lks == LK_SHARED) - vn_lock(vp, LK_DOWNGRADE | LK_RETRY, td); + vn_lock(vp, LK_DOWNGRADE | LK_RETRY); return error; } diff --git a/sys/vfs/smbfs/smbfs_vfsops.c b/sys/vfs/smbfs/smbfs_vfsops.c index c65ea85a37..6e5ecaf8d7 100644 --- a/sys/vfs/smbfs/smbfs_vfsops.c +++ b/sys/vfs/smbfs/smbfs_vfsops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_vfsops.c,v 1.2.2.5 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.24 2006/03/02 19:08:00 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.25 2006/05/05 21:15:10 dillon Exp $ */ #include "opt_netsmb.h" #ifndef NETSMB @@ -210,7 +210,7 @@ smbfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) error = smbfs_root(mp, &vp); if (error) goto bad; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); SMBVDEBUG("root.v_usecount = %d\n", vp->v_usecount); #ifdef DIAGNOSTICS diff --git a/sys/vfs/smbfs/smbfs_vnops.c b/sys/vfs/smbfs/smbfs_vnops.c index 17a9c32272..b2175cb82e 100644 --- a/sys/vfs/smbfs/smbfs_vnops.c +++ b/sys/vfs/smbfs/smbfs_vnops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_vnops.c,v 1.2.2.8 2003/04/04 08:57:23 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_vnops.c,v 1.28 2006/04/28 00:24:46 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vnops.c,v 1.29 2006/05/05 21:15:10 dillon Exp $ */ #include #include @@ -1095,7 +1095,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) if (error) return error; if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (EJUSTRETURN); @@ -1121,7 +1121,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) return error; *vpp = vp; if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return 0; @@ -1137,20 +1137,20 @@ smbfs_lookup(struct vop_old_lookup_args *ap) return error; *vpp = vp; if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return 0; } if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); error = smbfs_nget(mp, dvp, name, nmlen, NULL, &vp); if (error) { - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); return error; } if (lockparent) { - error = vn_lock(dvp, LK_EXCLUSIVE, td); + error = vn_lock(dvp, LK_EXCLUSIVE); if (error) { cnp->cn_flags |= CNP_PDIRUNLOCK; vput(vp); @@ -1168,7 +1168,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) *vpp = vp; SMBVDEBUG("lookup: getnewvp!\n"); if (!lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } } diff --git a/sys/vfs/specfs/spec_vnops.c b/sys/vfs/specfs/spec_vnops.c index 365d72e011..14ccbbf394 100644 --- a/sys/vfs/specfs/spec_vnops.c +++ b/sys/vfs/specfs/spec_vnops.c @@ -32,7 +32,7 @@ * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 * $FreeBSD: src/sys/miscfs/specfs/spec_vnops.c,v 1.131.2.4 2001/02/26 04:23:20 jlemon Exp $ - * $DragonFly: src/sys/vfs/specfs/spec_vnops.c,v 1.41 2006/05/05 20:15:02 dillon Exp $ + * $DragonFly: src/sys/vfs/specfs/spec_vnops.c,v 1.42 2006/05/05 21:15:10 dillon Exp $ */ #include @@ -240,9 +240,9 @@ spec_open(struct vop_open_args *ap) * dev_dopen() is always called for each open. dev_dclose() is * only called for the last close unless D_TRACKCLOSE is set. */ - VOP_UNLOCK(vp, 0, ap->a_td); + VOP_UNLOCK(vp, 0); error = dev_dopen(dev, ap->a_mode, S_IFCHR, ap->a_td); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, ap->a_td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error) goto done; @@ -322,9 +322,9 @@ spec_read(struct vop_read_args *ap) if (uio->uio_resid == 0) return (0); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); error = dev_dread(dev, uio, ap->a_ioflag); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); return (error); } @@ -352,9 +352,9 @@ spec_write(struct vop_write_args *ap) if (dev == NULL) /* device was revoked */ return (EBADF); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); error = dev_dwrite(dev, uio, ap->a_ioflag); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); return (error); } @@ -583,11 +583,11 @@ spec_close(struct vop_close_args *ap) needrelock = 0; if (VOP_ISLOCKED(vp, ap->a_td)) { needrelock = 1; - VOP_UNLOCK(vp, 0, ap->a_td); + VOP_UNLOCK(vp, 0); } error = dev_dclose(dev, ap->a_fflag, S_IFCHR, ap->a_td); if (needrelock) - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, ap->a_td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } else { error = 0; } diff --git a/sys/vfs/udf/udf_vfsops.c b/sys/vfs/udf/udf_vfsops.c index ba4b314b02..6c24dddbff 100644 --- a/sys/vfs/udf/udf_vfsops.c +++ b/sys/vfs/udf/udf_vfsops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.16 2003/11/05 06:56:08 scottl Exp $ - * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.16 2006/03/24 18:35:34 dillon Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.17 2006/05/05 21:15:10 dillon Exp $ */ /* udf_vfsops.c */ @@ -170,7 +170,7 @@ udf_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) } /* Check the access rights on the mount device */ - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(devvp, VREAD, td->td_proc->p_ucred, td); if (error) error = suser(td); @@ -178,7 +178,7 @@ udf_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) vput(devvp); return(error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if ((error = udf_mountfs(devvp, mp, td))) { vrele(devvp); @@ -249,9 +249,9 @@ udf_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0))) return(error); - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return(error); needclose = 1; diff --git a/sys/vfs/udf/udf_vnops.c b/sys/vfs/udf/udf_vnops.c index 52fa76a9f5..316f9914a9 100644 --- a/sys/vfs/udf/udf_vnops.c +++ b/sys/vfs/udf/udf_vnops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.33 2003/12/07 05:04:49 scottl Exp $ - * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.19 2006/03/24 18:35:34 dillon Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.20 2006/05/05 21:15:10 dillon Exp $ */ /* udf_vnops.c */ @@ -1009,7 +1009,7 @@ lookloop: gd->gd_nchstats->ncs_pass2++; if ((flags & CNP_LOCKPARENT) == 0) { a->a_cnp->cn_flags |= CNP_PDIRUNLOCK; - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); } *vpp = tdp; diff --git a/sys/vfs/ufs/ffs_rawread.c b/sys/vfs/ufs/ffs_rawread.c index 8722e86907..34e131b2ec 100644 --- a/sys/vfs/ufs/ffs_rawread.c +++ b/sys/vfs/ufs/ffs_rawread.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ufs/ffs/ffs_rawread.c,v 1.3.2.2 2003/05/29 06:15:35 alc Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_rawread.c,v 1.22 2006/04/30 20:23:26 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_rawread.c,v 1.23 2006/05/05 21:15:10 dillon Exp $ */ #include @@ -104,7 +104,7 @@ ffs_rawread_sync(struct vnode *vp, struct thread *td) if (VOP_ISLOCKED(vp, td) != LK_EXCLUSIVE) { upgraded = 1; /* Upgrade to exclusive lock, this might block */ - VOP_LOCK(vp, LK_UPGRADE | LK_NOPAUSE, td); + VOP_LOCK(vp, LK_UPGRADE | LK_NOPAUSE); } else upgraded = 0; @@ -123,7 +123,7 @@ ffs_rawread_sync(struct vnode *vp, struct thread *td) if (error != 0) { crit_exit(); if (upgraded != 0) - VOP_LOCK(vp, LK_DOWNGRADE, td); + VOP_LOCK(vp, LK_DOWNGRADE); return (error); } } @@ -132,7 +132,7 @@ ffs_rawread_sync(struct vnode *vp, struct thread *td) crit_exit(); if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) != 0) { if (upgraded != 0) - VOP_LOCK(vp, LK_DOWNGRADE, td); + VOP_LOCK(vp, LK_DOWNGRADE); return (error); } crit_enter(); @@ -142,7 +142,7 @@ ffs_rawread_sync(struct vnode *vp, struct thread *td) } crit_exit(); if (upgraded != 0) - VOP_LOCK(vp, LK_DOWNGRADE, td); + VOP_LOCK(vp, LK_DOWNGRADE); } else { crit_exit(); } diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index 0f42bc4115..86da441954 100644 --- a/sys/vfs/ufs/ffs_softdep.c +++ b/sys/vfs/ufs/ffs_softdep.c @@ -37,7 +37,7 @@ * * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 * $FreeBSD: src/sys/ufs/ffs/ffs_softdep.c,v 1.57.2.11 2002/02/05 18:46:53 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.40 2006/05/05 16:35:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.41 2006/05/05 21:15:10 dillon Exp $ */ /* @@ -821,9 +821,9 @@ softdep_flushfiles(struct mount *oldmnt, int flags, struct thread *td) if (softdep_process_worklist(oldmnt) == 0) break; } - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(devvp, MNT_WAIT, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) break; } @@ -4016,7 +4016,6 @@ softdep_fsync(vp) struct inode *ip; struct buf *bp; struct fs *fs; - struct thread *td = curthread; /* XXX */ int error, flushparent; ino_t parentino; ufs_lbn_t lbn; @@ -4078,9 +4077,9 @@ softdep_fsync(vp) * ufs_lookup for details on possible races. */ FREE_LOCK(&lk); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); error = VFS_VGET(mnt, parentino, &pvp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) return (error); if (flushparent) { diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c index e20fc21198..2635439b1d 100644 --- a/sys/vfs/ufs/ffs_vfsops.c +++ b/sys/vfs/ufs/ffs_vfsops.c @@ -32,7 +32,7 @@ * * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ffs/ffs_vfsops.c,v 1.117.2.10 2002/06/23 22:34:52 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.39 2006/04/03 02:02:37 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.40 2006/05/05 21:15:10 dillon Exp $ */ #include "opt_quota.h" @@ -226,13 +226,13 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ * that user has necessary permissions on the device. */ if (cred->cr_uid != 0) { - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_ACCESS(devvp, VREAD | VWRITE, cred, td)) != 0) { - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } fs->fs_flags &= ~FS_UNCLEAN; @@ -305,12 +305,12 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ accessmode = VREAD; if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_ACCESS(devvp, accessmode, cred, td)) != 0) { vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); } if (mp->mnt_flag & MNT_UPDATE) { @@ -398,7 +398,7 @@ success: * The device must be re-opened as appropriate or * the device close at unmount time will panic. */ - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if (ronly) { VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); VOP_CLOSE(devvp, FREAD|FWRITE, td); @@ -406,7 +406,7 @@ success: VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, NULL, td); VOP_CLOSE(devvp, FREAD, td); } - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); ffs_sbupdate(ump, MNT_WAIT); } } @@ -457,9 +457,9 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOUFS(mp)->um_devvp; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = vinvalbuf(devvp, 0, td, 0, 0); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) panic("ffs_reload: dirty1"); @@ -612,16 +612,16 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, return (error); if (count_udev(devvp->v_udev) > 0) return (EBUSY); - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = vinvalbuf(devvp, V_SAVE, td, 0, 0); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); - VOP_UNLOCK(devvp, 0, td); + VOP_UNLOCK(devvp, 0); if (error) return (error); dev = devvp->v_rdev; @@ -903,9 +903,9 @@ ffs_flushfiles(struct mount *mp, int flags, struct thread *td) /* * Flush filesystem metadata. */ - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(ump->um_devvp, MNT_WAIT, td); - VOP_UNLOCK(ump->um_devvp, 0, td); + VOP_UNLOCK(ump->um_devvp, 0); return (error); } @@ -982,10 +982,10 @@ ffs_sync(struct mount *mp, int waitfor, struct thread *td) if (waitfor != MNT_LAZY) { if (ump->um_mountp->mnt_flag & MNT_SOFTDEP) waitfor = MNT_NOWAIT; - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) scaninfo.allerror = error; - VOP_UNLOCK(ump->um_devvp, 0, td); + VOP_UNLOCK(ump->um_devvp, 0); } #ifdef QUOTA ufs_qsync(mp); diff --git a/sys/vfs/ufs/ufs_lookup.c b/sys/vfs/ufs/ufs_lookup.c index fd48946886..c2838142da 100644 --- a/sys/vfs/ufs/ufs_lookup.c +++ b/sys/vfs/ufs/ufs_lookup.c @@ -37,7 +37,7 @@ * * @(#)ufs_lookup.c 8.15 (Berkeley) 6/16/95 * $FreeBSD: src/sys/ufs/ufs/ufs_lookup.c,v 1.33.2.7 2001/09/22 19:22:13 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_lookup.c,v 1.23 2006/05/05 16:35:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_lookup.c,v 1.24 2006/05/05 21:15:10 dillon Exp $ */ #include "opt_ufs.h" @@ -137,7 +137,6 @@ ufs_lookup(struct vop_old_lookup_args *ap) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct thread *td = cnp->cn_td; globaldata_t gd = mycpu; bp = NULL; @@ -425,7 +424,7 @@ notfound: * information cannot be used. */ if (!lockparent) { - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (EJUSTRETURN); @@ -484,10 +483,10 @@ found: return (0); } if (flags & CNP_ISDOTDOT) - VOP_UNLOCK(vdp, 0, td);/* race to get the inode */ + VOP_UNLOCK(vdp, 0); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp); if (flags & CNP_ISDOTDOT) { - if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, td) != 0) + if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY) != 0) cnp->cn_flags |= CNP_PDIRUNLOCK; } if (error) @@ -507,7 +506,7 @@ found: } *vpp = tdp; if (!lockparent) { - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (0); @@ -529,17 +528,17 @@ found: if (dp->i_number == dp->i_ino) return (EISDIR); if (flags & CNP_ISDOTDOT) - VOP_UNLOCK(vdp, 0, td); /* race to get the inode */ + VOP_UNLOCK(vdp, 0); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp); if (flags & CNP_ISDOTDOT) { - if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, td) != 0) + if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY) != 0) cnp->cn_flags |= CNP_PDIRUNLOCK; } if (error) return (error); *vpp = tdp; if (!lockparent) { - VOP_UNLOCK(vdp, 0, td); + VOP_UNLOCK(vdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } return (0); @@ -566,15 +565,15 @@ found: */ pdp = vdp; if (flags & CNP_ISDOTDOT) { - VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ + VOP_UNLOCK(pdp, 0); /* race to get the inode */ cnp->cn_flags |= CNP_PDIRUNLOCK; if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) { - if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td) == 0) + if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY) == 0) cnp->cn_flags &= ~CNP_PDIRUNLOCK; return (error); } if (lockparent) { - if ((error = vn_lock(pdp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vn_lock(pdp, LK_EXCLUSIVE)) != 0) { vput(tdp); return (error); } @@ -589,7 +588,7 @@ found: if (error) return (error); if (!lockparent) { - VOP_UNLOCK(pdp, 0, td); + VOP_UNLOCK(pdp, 0); cnp->cn_flags |= CNP_PDIRUNLOCK; } *vpp = tdp; @@ -899,14 +898,14 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, */ if (error == 0 && dp->i_endoff && dp->i_endoff < dp->i_size) { if (tvp != NULL) - VOP_UNLOCK(tvp, 0, td); + VOP_UNLOCK(tvp, 0); #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); #endif (void)UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, cred, td); if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); } return (error); } diff --git a/sys/vfs/ufs/ufs_quota.c b/sys/vfs/ufs/ufs_quota.c index eeed48d3d8..1cb4b90bfe 100644 --- a/sys/vfs/ufs/ufs_quota.c +++ b/sys/vfs/ufs/ufs_quota.c @@ -35,7 +35,7 @@ * * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ufs/ufs_quota.c,v 1.27.2.3 2002/01/15 10:33:32 phk Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_quota.c,v 1.19 2006/04/03 02:02:37 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_quota.c,v 1.20 2006/05/05 21:15:10 dillon Exp $ */ #include @@ -399,7 +399,7 @@ ufs_quotaon(struct thread *td, struct mount *mp, int type, caddr_t fname) nd.nl_open_vp = NULL; nlookup_done(&nd); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (*vpp != vp) ufs_quotaoff(td, mp, type); ump->um_qflags[type] |= QTF_OPENING; @@ -723,7 +723,6 @@ static int ufs_dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type, struct ufs_dquot **dqp) { - struct thread *td = curthread; /* XXX */ struct ufs_dquot *dq; struct ufs_dqhash *dqh; struct vnode *dqvp; @@ -779,7 +778,7 @@ ufs_dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type, * Initialize the contents of the dquot structure. */ if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); LIST_INSERT_HEAD(dqh, dq, dq_hash); DQREF(dq); dq->dq_flags = DQ_LOCK; @@ -799,7 +798,7 @@ ufs_dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type, if (auio.uio_resid == sizeof(struct ufs_dqblk) && error == 0) bzero((caddr_t)&dq->dq_dqb, sizeof(struct ufs_dqblk)); if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, td); + VOP_UNLOCK(dqvp, 0); if (dq->dq_flags & DQ_WANT) wakeup((caddr_t)dq); dq->dq_flags = 0; @@ -866,7 +865,6 @@ ufs_dqrele(struct vnode *vp, struct ufs_dquot *dq) static int ufs_dqsync(struct vnode *vp, struct ufs_dquot *dq) { - struct thread *td = curthread; /* XXX */ struct vnode *dqvp; struct iovec aiov; struct uio auio; @@ -879,13 +877,13 @@ ufs_dqsync(struct vnode *vp, struct ufs_dquot *dq) if ((dqvp = dq->dq_ump->um_quotas[dq->dq_type]) == NULLVP) panic("dqsync: file"); if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); while (dq->dq_flags & DQ_LOCK) { dq->dq_flags |= DQ_WANT; (void) tsleep((caddr_t)dq, 0, "dqsync", 0); if ((dq->dq_flags & DQ_MOD) == 0) { if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, td); + VOP_UNLOCK(dqvp, 0); return (0); } } @@ -906,7 +904,7 @@ ufs_dqsync(struct vnode *vp, struct ufs_dquot *dq) wakeup((caddr_t)dq); dq->dq_flags &= ~(DQ_MOD|DQ_LOCK|DQ_WANT); if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, td); + VOP_UNLOCK(dqvp, 0); return (error); } diff --git a/sys/vfs/ufs/ufs_vnops.c b/sys/vfs/ufs/ufs_vnops.c index 5f10a4a9da..12dcaafa27 100644 --- a/sys/vfs/ufs/ufs_vnops.c +++ b/sys/vfs/ufs/ufs_vnops.c @@ -37,7 +37,7 @@ * * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 * $FreeBSD: src/sys/ufs/ufs/ufs_vnops.c,v 1.131.2.8 2003/01/02 17:26:19 bde Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.46 2006/05/05 16:35:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.47 2006/05/05 21:15:10 dillon Exp $ */ #include "opt_quota.h" @@ -737,7 +737,6 @@ ufs_link(struct vop_old_link_args *ap) struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; struct componentname *cnp = ap->a_cnp; - struct thread *td = cnp->cn_td; struct inode *ip; struct direct newdir; int error; @@ -746,7 +745,7 @@ ufs_link(struct vop_old_link_args *ap) error = EXDEV; goto out2; } - if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) { + if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE))) { goto out2; } ip = VTOI(vp); @@ -778,7 +777,7 @@ ufs_link(struct vop_old_link_args *ap) } out1: if (tdvp != vp) - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); out2: VN_KNOTE(vp, NOTE_LINK); VN_KNOTE(tdvp, NOTE_WRITE); @@ -874,7 +873,6 @@ ufs_rename(struct vop_old_rename_args *ap) struct vnode *fdvp = ap->a_fdvp; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; - struct thread *td = fcnp->cn_td; struct inode *ip, *xp, *dp; struct direct newdir; ino_t oldparent = 0, newparent = 0; @@ -915,7 +913,7 @@ abortit: goto abortit; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, td)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) goto abortit; /* @@ -925,13 +923,13 @@ abortit: dp = VTOI(fdvp); ip = VTOI(fvp); if (ip->i_nlink >= LINK_MAX) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EMLINK; goto abortit; } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EPERM; goto abortit; } @@ -942,7 +940,7 @@ abortit: if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') || dp == ip || (fcnp->cn_flags | tcnp->cn_flags) & CNP_ISDOTDOT || (ip->i_flag & IN_RENAME)) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); error = EINVAL; goto abortit; } @@ -979,7 +977,7 @@ abortit: softdep_change_linkcnt(ip); if ((error = UFS_UPDATE(fvp, !(DOINGSOFTDEP(fvp) | DOINGASYNC(fvp)))) != 0) { - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); goto bad; } @@ -994,7 +992,7 @@ abortit: * call to checkpath(). */ error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); - VOP_UNLOCK(fvp, 0, td); + VOP_UNLOCK(fvp, 0); /* * We are now back to where we were in that fvp, fdvp are unlocked @@ -1281,7 +1279,7 @@ bad: out: if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { ip->i_effnlink--; ip->i_nlink--; ip->i_flag |= IN_CHANGE; diff --git a/sys/vfs/umapfs/umap_vfsops.c b/sys/vfs/umapfs/umap_vfsops.c index f741e6e187..b7cc84bd1d 100644 --- a/sys/vfs/umapfs/umap_vfsops.c +++ b/sys/vfs/umapfs/umap_vfsops.c @@ -36,7 +36,7 @@ * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/umapfs/umap_vfsops.c,v 1.31.2.2 2001/09/11 09:49:53 kris Exp $ - * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vfsops.c,v 1.18 2005/09/17 07:43:12 dillon Exp $ + * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vfsops.c,v 1.19 2006/05/05 21:15:11 dillon Exp $ */ /* @@ -205,7 +205,7 @@ umapfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) /* * Unlock the node (either the lower or the alias) */ - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); /* * Make sure the node alias worked */ @@ -290,7 +290,7 @@ umapfs_root(struct mount *mp, struct vnode **vpp) */ vp = MOUNTTOUMAPMOUNT(mp)->umapm_rootvp; vref(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return (0); } diff --git a/sys/vfs/union/union_subr.c b/sys/vfs/union/union_subr.c index 196805719e..be3440e7df 100644 --- a/sys/vfs/union/union_subr.c +++ b/sys/vfs/union/union_subr.c @@ -36,7 +36,7 @@ * * @(#)union_subr.c 8.20 (Berkeley) 5/20/95 * $FreeBSD: src/sys/miscfs/union/union_subr.c,v 1.43.2.2 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/union/union_subr.c,v 1.22 2006/04/01 20:46:54 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_subr.c,v 1.23 2006/05/05 21:15:11 dillon Exp $ */ #include @@ -433,21 +433,21 @@ loop: * while moving up the tree). */ vref(dvp); - VOP_UNLOCK(dvp, 0, td); - error = vn_lock(un->un_vnode, LK_EXCLUSIVE, td); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + VOP_UNLOCK(dvp, 0); + error = vn_lock(un->un_vnode, LK_EXCLUSIVE); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); vrele(dvp); } else { /* * our new un is under dvp */ - error = vn_lock(un->un_vnode, LK_EXCLUSIVE, td); + error = vn_lock(un->un_vnode, LK_EXCLUSIVE); } } else if (dvp == NULLVP) { /* * dvp is NULL, we need to lock un. */ - error = vn_lock(un->un_vnode, LK_EXCLUSIVE, td); + error = vn_lock(un->un_vnode, LK_EXCLUSIVE); } else { /* * dvp == un->un_vnode, we are already locked. @@ -726,9 +726,9 @@ union_copyup(struct union_node *un, int docopy, struct ucred *cred, * If the user does not have read permission, the vnode should not * be copied to upper layer. */ - vn_lock(un->un_lowervp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(un->un_lowervp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(un->un_lowervp, VREAD, cred, td); - VOP_UNLOCK(un->un_lowervp, 0, td); + VOP_UNLOCK(un->un_lowervp, 0); if (error) return (error); @@ -744,18 +744,18 @@ union_copyup(struct union_node *un, int docopy, struct ucred *cred, * XX - should not ignore errors * from VOP_CLOSE */ - vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(lvp, FREAD, cred, NULL, td); if (error == 0) { error = union_copyfile(lvp, uvp, cred, td); - VOP_UNLOCK(lvp, 0, td); + VOP_UNLOCK(lvp, 0); (void) VOP_CLOSE(lvp, FREAD, td); } if (error == 0) UDEBUG(("union: copied up %s\n", un->un_path)); } - VOP_UNLOCK(uvp, 0, td); + VOP_UNLOCK(uvp, 0); union_newupper(un, uvp); KASSERT(uvp->v_usecount > 0, ("copy: uvp refcount 0: %d", uvp->v_usecount)); union_vn_close(uvp, FWRITE, cred, td); @@ -824,7 +824,7 @@ union_relookup(struct union_mount *um, struct vnode *dvp, struct vnode **vpp, cn->cn_consume = cnp->cn_consume; vref(dvp); - VOP_UNLOCK(dvp, 0, cnp->cn_td); + VOP_UNLOCK(dvp, 0); /* * Pass dvp unlocked and referenced on call to relookup(). @@ -834,7 +834,7 @@ union_relookup(struct union_mount *um, struct vnode *dvp, struct vnode **vpp, if ((error = relookup(dvp, vpp, cn)) != 0) { zfree(namei_zone, cn->cn_nameptr); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); return(error); } zfree(namei_zone, cn->cn_nameptr); @@ -1137,7 +1137,7 @@ union_dircache(struct vnode *vp, struct thread *td) struct union_node *un; int error; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); dircache = VTOUNION(vp)->un_dircache; nvp = NULLVP; @@ -1163,7 +1163,7 @@ union_dircache(struct vnode *vp, struct thread *td) if (*vpp == NULLVP) goto out; - /*vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);*/ + /*vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);*/ UDEBUG(("ALLOCVP-3 %p ref %d\n", *vpp, (*vpp ? (*vpp)->v_usecount : -99))); vref(*vpp); error = union_allocvp(&nvp, vp->v_mount, NULLVP, NULLVP, NULL, *vpp, NULLVP, 0); @@ -1176,7 +1176,7 @@ union_dircache(struct vnode *vp, struct thread *td) un->un_dircache = dircache; out: - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); return (nvp); } @@ -1246,7 +1246,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) vput(lvp); return (error); } - VOP_UNLOCK(lvp, 0, td); + VOP_UNLOCK(lvp, 0); fp->f_data = lvp; fp->f_offset = 0; error = vn_close(*vp, FREAD, td); diff --git a/sys/vfs/union/union_vfsops.c b/sys/vfs/union/union_vfsops.c index fa448bc61f..7390cc75a7 100644 --- a/sys/vfs/union/union_vfsops.c +++ b/sys/vfs/union/union_vfsops.c @@ -36,7 +36,7 @@ * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 * $FreeBSD: src/sys/miscfs/union/union_vfsops.c,v 1.39.2.2 2001/10/25 19:18:53 dillon Exp $ - * $DragonFly: src/sys/vfs/union/union_vfsops.c,v 1.21 2005/09/17 07:43:12 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_vfsops.c,v 1.22 2006/05/05 21:15:11 dillon Exp $ */ /* @@ -128,7 +128,7 @@ union_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) * Unlock lower node to avoid deadlock. */ if (lowerrootvp->v_tag == VT_UNION) - VOP_UNLOCK(lowerrootvp, 0, td); + VOP_UNLOCK(lowerrootvp, 0); #endif /* diff --git a/sys/vfs/union/union_vnops.c b/sys/vfs/union/union_vnops.c index 91134728e6..9fde59dd1f 100644 --- a/sys/vfs/union/union_vnops.c +++ b/sys/vfs/union/union_vnops.c @@ -36,7 +36,7 @@ * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 * $FreeBSD: src/sys/miscfs/union/union_vnops.c,v 1.72 1999/12/15 23:02:14 eivind Exp $ - * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.26 2006/04/30 17:22:18 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.27 2006/05/05 21:15:11 dillon Exp $ */ #include @@ -115,7 +115,7 @@ union_lock_upper(struct union_node *un, struct thread *td) if ((uppervp = un->un_uppervp) != NULL) { vref(uppervp); - vn_lock(uppervp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY, td); + vn_lock(uppervp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY); } KASSERT((uppervp == NULL || uppervp->v_usecount > 0), ("uppervp usecount is 0")); return(uppervp); @@ -138,7 +138,7 @@ union_lock_other(struct union_node *un, struct thread *td) vp = union_lock_upper(un, td); } else if ((vp = un->un_lowervp) != NULL) { vref(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY); } return(vp); } @@ -198,7 +198,7 @@ union_lookup1(struct vnode *udvp, struct vnode **pdvp, struct vnode **vpp, dvp = dvp->v_mount->mnt_vnodecovered; vref(dvp); vput(tdvp); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); } } @@ -230,7 +230,7 @@ union_lookup1(struct vnode *udvp, struct vnode **pdvp, struct vnode **vpp, #if 0 if (dvp != tdvp && (cnp->cn_flags & CNP_XXXISLASTCN) == 0) - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); #endif /* @@ -263,7 +263,7 @@ union_lookup1(struct vnode *udvp, struct vnode **pdvp, struct vnode **vpp, vfs_unbusy(mp, td); if (relock_pdvp) - vn_lock(*pdvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(*pdvp, LK_EXCLUSIVE | LK_RETRY); if (error) { *vpp = NULL; @@ -441,7 +441,7 @@ union_lookup(struct vop_old_lookup_args *ap) * to us so we NULL it out. */ vref(lowerdvp); - vn_lock(lowerdvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(lowerdvp, LK_EXCLUSIVE | LK_RETRY); lerror = union_lookup1(um->um_lowervp, &lowerdvp, &lowervp, cnp); if (lowerdvp == lowervp) vrele(lowerdvp); @@ -465,7 +465,7 @@ union_lookup(struct vop_old_lookup_args *ap) if ((cnp->cn_flags & CNP_ISDOTDOT) && dun->un_pvp != NULLVP) { if ((lowervp = LOWERVP(dun->un_pvp)) != NULL) { vref(lowervp); - vn_lock(lowervp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(lowervp, LK_EXCLUSIVE | LK_RETRY); lerror = 0; } } @@ -528,11 +528,11 @@ union_lookup(struct vop_old_lookup_args *ap) */ if (uppervp && uppervp != upperdvp) - VOP_UNLOCK(uppervp, 0, td); + VOP_UNLOCK(uppervp, 0); if (lowervp) - VOP_UNLOCK(lowervp, 0, td); + VOP_UNLOCK(lowervp, 0); if (upperdvp) - VOP_UNLOCK(upperdvp, 0, td); + VOP_UNLOCK(upperdvp, 0); error = union_allocvp(ap->a_vpp, dvp->v_mount, dvp, upperdvp, cnp, uppervp, lowervp, 1); @@ -594,7 +594,7 @@ out: if (*ap->a_vpp != dvp) { if ((error == 0 || error == EJUSTRETURN) && !lockparent) { - VOP_UNLOCK(dvp, 0, td); + VOP_UNLOCK(dvp, 0); } } @@ -638,7 +638,7 @@ union_create(struct vop_old_create_args *ap) error = VOP_CREATE(dvp, &vp, cnp, ap->a_vap); if (error == 0) { mp = ap->a_dvp->v_mount; - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); UDEBUG(("ALLOCVP-1 FROM %p REFS %d\n", vp, vp->v_usecount)); error = union_allocvp(ap->a_vpp, mp, NULLVP, NULLVP, cnp, vp, NULLVP, 1); @@ -736,7 +736,7 @@ union_open(struct vop_open_args *ap) } else { un->un_openl++; vref(tvp); - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); tvpisupper = 0; } } @@ -833,7 +833,7 @@ union_access(struct vop_access_args *ap) } if ((vp = un->un_lowervp) != NULLVP) { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); ap->a_head.a_ops = *vp->v_ops; ap->a_vp = vp; @@ -855,7 +855,7 @@ union_access(struct vop_access_args *ap) error = vop_access_ap(ap); } } - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); } return(error); } @@ -1256,12 +1256,12 @@ union_link(struct vop_old_link_args *ap) struct union_node *tun = VTOUNION(ap->a_vp); if (tun->un_uppervp == NULLVP) { - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY); #if 0 if (dun->un_uppervp == tun->un_dirvp) { if (dun->un_flags & UN_ULOCK) { dun->un_flags &= ~UN_ULOCK; - VOP_UNLOCK(dun->un_uppervp, 0, td); + VOP_UNLOCK(dun->un_uppervp, 0); } } #endif @@ -1269,11 +1269,11 @@ union_link(struct vop_old_link_args *ap) #if 0 if (dun->un_uppervp == tun->un_dirvp) { vn_lock(dun->un_uppervp, - LK_EXCLUSIVE | LK_RETRY, td); + LK_EXCLUSIVE | LK_RETRY); dun->un_flags |= UN_ULOCK; } #endif - VOP_UNLOCK(ap->a_vp, 0, td); + VOP_UNLOCK(ap->a_vp, 0); } vp = tun->un_uppervp; } @@ -1291,7 +1291,7 @@ union_link(struct vop_old_link_args *ap) if ((tdvp = union_lock_upper(dun, td)) == NULLVP) return (EROFS); - VOP_UNLOCK(ap->a_tdvp, 0, td); /* unlock calling node */ + VOP_UNLOCK(ap->a_tdvp, 0); /* unlock calling node */ error = VOP_LINK(tdvp, vp, cnp); /* call link on upper */ /* @@ -1299,7 +1299,7 @@ union_link(struct vop_old_link_args *ap) * order to avoid a deadlock. */ union_unlock_upper(tdvp, td); - vn_lock(ap->a_tdvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ap->a_tdvp, LK_EXCLUSIVE | LK_RETRY); return (error); } @@ -1353,9 +1353,9 @@ union_rename(struct vop_old_rename_args *ap) if (un->un_uppervp == NULLVP) { switch(fvp->v_type) { case VREG: - vn_lock(un->un_vnode, LK_EXCLUSIVE | LK_RETRY, ap->a_fcnp->cn_td); + vn_lock(un->un_vnode, LK_EXCLUSIVE | LK_RETRY); error = union_copyup(un, 1, ap->a_fcnp->cn_cred, ap->a_fcnp->cn_td); - VOP_UNLOCK(un->un_vnode, 0, ap->a_fcnp->cn_td); + VOP_UNLOCK(un->un_vnode, 0); if (error) goto bad; break; @@ -1371,12 +1371,12 @@ union_rename(struct vop_old_rename_args *ap) #if 0 vrele(fvp); fvp = NULL; - vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY, ap->a_fcnp->cn_td); + vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); error = union_mkshadow(um, fdvp, ap->a_fcnp, &un->un_uppervp); - VOP_UNLOCK(fdvp, 0, ap->a_fcnp->cn_td); + VOP_UNLOCK(fdvp, 0); if (un->un_uppervp) - VOP_UNLOCK(un->un_uppervp, 0, ap->a_fcnp->cn_td); + VOP_UNLOCK(un->un_uppervp, 0); if (error) goto bad; break; @@ -1485,7 +1485,7 @@ union_mkdir(struct vop_old_mkdir_args *ap) union_unlock_upper(upperdvp, td); if (error == 0) { - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); UDEBUG(("ALLOCVP-2 FROM %p REFS %d\n", vp, vp->v_usecount)); error = union_allocvp(ap->a_vpp, ap->a_dvp->v_mount, ap->a_dvp, NULLVP, cnp, vp, NULLVP, 1); @@ -1642,7 +1642,7 @@ union_inactive(struct vop_inactive_args *ap) #if 0 if ((un->un_flags & UN_ULOCK) && un->un_uppervp) { un->un_flags &= ~UN_ULOCK; - VOP_UNLOCK(un->un_uppervp, 0, td); + VOP_UNLOCK(un->un_uppervp, 0); } #endif @@ -1686,12 +1686,11 @@ union_lock(struct vop_lock_args *ap) if (un->un_uppervp != NULLVP && (flags & LK_TYPE_MASK) == LK_EXCLUSIVE) { if ((un->un_flags & UN_ULOCK) == 0 && vp->v_usecount) { - error = vn_lock(un->un_uppervp, flags, td); + error = vn_lock(un->un_uppervp, flags); if (error) { struct vop_unlock_args uap = { 0 }; uap.a_vp = ap->a_vp; uap.a_flags = ap->a_flags; - uap.a_td = ap->a_td; vop_stdunlock(&uap); return (error); } @@ -1731,7 +1730,7 @@ union_unlock(struct vop_unlock_args *ap) if ((un->un_flags & UN_ULOCK) && lockstatus(&un->un_lock, NULL) != LK_EXCLUSIVE) { un->un_flags &= ~UN_ULOCK; - VOP_UNLOCK(un->un_uppervp, LK_EXCLUSIVE, td); + VOP_UNLOCK(un->un_uppervp, LK_EXCLUSIVE); } #endif return(error); diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 1b043c5fc6..724f278efe 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -64,7 +64,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $DragonFly: src/sys/vm/vm_contig.c,v 1.15 2006/01/09 15:14:49 corecode Exp $ + * $DragonFly: src/sys/vm/vm_contig.c,v 1.16 2006/05/05 21:15:11 dillon Exp $ */ /* @@ -157,11 +157,9 @@ vm_contig_pg_clean(int queue) if (m->dirty) { object = m->object; if (object->type == OBJT_VNODE) { - vn_lock(object->handle, - LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(object->handle, LK_EXCLUSIVE|LK_RETRY); vm_object_page_clean(object, 0, 0, OBJPC_SYNC); - VOP_UNLOCK(((struct vnode *)object->handle), - 0, curthread); + VOP_UNLOCK(((struct vnode *)object->handle), 0); return (TRUE); } else if (object->type == OBJT_SWAP || object->type == OBJT_DEFAULT) { diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index d3c9e3243d..826edfe40d 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -62,7 +62,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm_map.c,v 1.187.2.19 2003/05/27 00:47:02 alc Exp $ - * $DragonFly: src/sys/vm/vm_map.c,v 1.42 2006/03/27 01:54:18 dillon Exp $ + * $DragonFly: src/sys/vm/vm_map.c,v 1.43 2006/05/05 21:15:11 dillon Exp $ */ /* @@ -2208,16 +2208,14 @@ vm_map_clean(vm_map_t map, vm_offset_t start, vm_offset_t end, boolean_t syncio, int flags; vm_object_reference(object); - vn_lock(object->handle, - LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(object->handle, LK_EXCLUSIVE | LK_RETRY); flags = (syncio || invalidate) ? OBJPC_SYNC : 0; flags |= invalidate ? OBJPC_INVAL : 0; vm_object_page_clean(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), flags); - VOP_UNLOCK(((struct vnode *)object->handle), - 0, curthread); + VOP_UNLOCK(((struct vnode *)object->handle), 0); vm_object_deallocate(object); } if (object && invalidate && diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 3d267ee45e..3e6edc91b4 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -32,7 +32,7 @@ * * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 * $FreeBSD: src/sys/vm/vm_swap.c,v 1.96.2.2 2001/10/14 18:46:47 iedowse Exp $ - * $DragonFly: src/sys/vm/vm_swap.c,v 1.23 2006/04/30 17:22:18 dillon Exp $ + * $DragonFly: src/sys/vm/vm_swap.c,v 1.24 2006/05/05 21:15:11 dillon Exp $ */ #include "opt_swap.h" @@ -262,9 +262,9 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) } return EINVAL; found: - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(vp, FREAD | FWRITE, cred, NULL, td); - VOP_UNLOCK(vp, 0, td); + VOP_UNLOCK(vp, 0); if (error) return (error); -- 2.41.0