From 87de505741e271c73af7a9c21132c73eea16c6d9 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 6 May 2006 02:43:15 +0000 Subject: [PATCH] The thread/proc pointer argument in the VFS subsystem originally existed for... well, I'm not sure *WHY* it originally existed when most of the time the pointer couldn't be anything other then curthread or curproc or the code wouldn't work. This is particularly true of lockmgr locks. Remove the pointer argument from all VOP_*() functions, all fileops functions, and most ioctl functions. --- sys/dev/disk/ccd/ccd.c | 10 +- sys/dev/disk/vn/vn.c | 12 +- sys/dev/misc/streams/streams.c | 11 +- sys/emulation/dragonfly12/dfbsd12_stat.c | 4 +- sys/emulation/ibcs2/coff/imgact_coff.c | 8 +- sys/emulation/ibcs2/i386/ibcs2_fcntl.c | 4 +- sys/emulation/ibcs2/i386/ibcs2_ioctl.c | 18 +-- sys/emulation/ibcs2/i386/ibcs2_util.c | 6 +- sys/emulation/ibcs2/i386/ibcs2_xenix.c | 5 +- .../linux/i386/linprocfs/linprocfs_subr.c | 5 +- .../linux/i386/linprocfs/linprocfs_vnops.c | 6 +- sys/emulation/linux/linux_file.c | 10 +- sys/emulation/linux/linux_ioctl.c | 104 ++++++------- sys/emulation/linux/linux_misc.c | 8 +- sys/emulation/linux/linux_socket.c | 4 +- sys/emulation/linux/linux_util.c | 7 +- sys/emulation/ndis/subr_ndis.c | 11 +- sys/emulation/svr4/svr4_fcntl.c | 8 +- sys/emulation/svr4/svr4_filio.c | 4 +- sys/emulation/svr4/svr4_misc.c | 6 +- sys/emulation/svr4/svr4_sockio.c | 7 +- sys/emulation/svr4/svr4_stream.c | 5 +- sys/emulation/svr4/svr4_sysvec.c | 6 +- sys/emulation/svr4/svr4_termios.c | 13 +- sys/emulation/svr4/svr4_ttold.c | 27 ++-- sys/i386/i386/vm_machdep.c | 4 +- sys/kern/imgact_aout.c | 8 +- sys/kern/imgact_resident.c | 6 +- sys/kern/kern_acct.c | 11 +- sys/kern/kern_acl.c | 10 +- sys/kern/kern_descrip.c | 50 +++---- sys/kern/kern_event.c | 33 ++-- sys/kern/kern_exec.c | 9 +- sys/kern/kern_fp.c | 20 +-- sys/kern/kern_jail.c | 8 +- sys/kern/kern_ktrace.c | 6 +- sys/kern/kern_sig.c | 9 +- sys/kern/link_aout.c | 8 +- sys/kern/link_elf.c | 14 +- sys/kern/sys_generic.c | 22 +-- sys/kern/sys_pipe.c | 37 +++-- sys/kern/sys_socket.c | 26 ++-- sys/kern/tty.c | 5 +- sys/kern/tty_tty.c | 14 +- sys/kern/uipc_msg.c | 12 +- sys/kern/uipc_socket2.c | 6 +- sys/kern/uipc_syscalls.c | 6 +- sys/kern/uipc_usrreq.c | 4 +- sys/kern/vfs_aio.c | 6 +- sys/kern/vfs_cache.c | 6 +- sys/kern/vfs_default.c | 33 ++-- sys/kern/vfs_jops.c | 14 +- sys/kern/vfs_journal.c | 14 +- sys/kern/vfs_lock.c | 8 +- sys/kern/vfs_mount.c | 13 +- sys/kern/vfs_nlookup.c | 6 +- sys/kern/vfs_subr.c | 31 ++-- sys/kern/vfs_sync.c | 9 +- sys/kern/vfs_syscalls.c | 78 +++++----- sys/kern/vfs_vnops.c | 141 +++++++----------- sys/kern/vfs_vopops.c | 55 +++---- sys/net/if.c | 50 +++---- sys/net/if.h | 5 +- sys/net/if_var.h | 4 +- sys/net/route.c | 4 +- sys/net/route.h | 5 +- sys/net/rtsock.c | 4 +- sys/netproto/ncp/ncp_sock.c | 9 +- sys/netproto/smb/smb_trantcp.c | 4 +- sys/opencrypto/cryptodev.c | 44 ++---- sys/platform/pc32/i386/vm_machdep.c | 4 +- sys/sys/file.h | 37 +++-- sys/sys/file2.h | 43 +++--- sys/sys/kern_syscall.h | 5 +- sys/sys/mapped_ioctl.h | 7 +- sys/sys/mount.h | 6 +- sys/sys/socketops.h | 7 +- sys/sys/socketvar.h | 17 +-- sys/sys/vfsops.h | 118 ++++++--------- sys/sys/vnode.h | 24 ++- sys/vfs/coda/coda_fbsd.c | 67 +-------- sys/vfs/coda/coda_vfsops.c | 10 +- sys/vfs/coda/coda_vfsops.h | 4 +- sys/vfs/coda/coda_vnops.c | 38 +++-- sys/vfs/fdesc/fdesc_vnops.c | 20 ++- sys/vfs/fifofs/fifo_vnops.c | 23 +-- sys/vfs/gnu/ext2fs/ext2_extern.h | 4 +- sys/vfs/gnu/ext2fs/ext2_ihash.c | 5 +- sys/vfs/gnu/ext2fs/ext2_inode.c | 16 +- sys/vfs/gnu/ext2fs/ext2_lookup.c | 16 +- sys/vfs/gnu/ext2fs/ext2_quota.c | 4 +- sys/vfs/gnu/ext2fs/ext2_readwrite.c | 5 +- sys/vfs/gnu/ext2fs/ext2_vfsops.c | 41 +++-- sys/vfs/gnu/ext2fs/ext2_vnops.c | 75 ++++------ sys/vfs/gnu/ext2fs/ext2mount.h | 7 +- sys/vfs/hpfs/hpfs.h | 6 +- sys/vfs/hpfs/hpfs_hash.c | 6 +- sys/vfs/hpfs/hpfs_vfsops.c | 17 +-- sys/vfs/hpfs/hpfs_vnops.c | 13 +- sys/vfs/isofs/cd9660/cd9660_node.c | 10 +- sys/vfs/isofs/cd9660/cd9660_vfsops.c | 16 +- sys/vfs/isofs/cd9660/cd9660_vnops.c | 4 +- sys/vfs/mfs/mfs_vnops.c | 4 +- sys/vfs/msdosfs/denode.h | 4 +- sys/vfs/msdosfs/msdosfs_denode.c | 15 +- sys/vfs/msdosfs/msdosfs_lookup.c | 10 +- sys/vfs/msdosfs/msdosfs_vfsops.c | 27 ++-- sys/vfs/msdosfs/msdosfs_vnops.c | 16 +- sys/vfs/nfs/nfs.h | 4 +- sys/vfs/nfs/nfs_bio.c | 30 ++-- sys/vfs/nfs/nfs_node.c | 7 +- sys/vfs/nfs/nfs_serv.c | 110 +++++++------- sys/vfs/nfs/nfs_vfsops.c | 15 +- sys/vfs/nfs/nfs_vnops.c | 68 +++++---- sys/vfs/ntfs/ntfs.h | 4 +- sys/vfs/ntfs/ntfs_vfsops.c | 18 +-- sys/vfs/nwfs/nwfs.h | 4 +- sys/vfs/nwfs/nwfs_io.c | 28 ++-- sys/vfs/nwfs/nwfs_ioctl.c | 15 +- sys/vfs/nwfs/nwfs_node.c | 15 +- sys/vfs/nwfs/nwfs_vfsops.c | 14 +- sys/vfs/nwfs/nwfs_vnops.c | 46 +++--- sys/vfs/portal/portal_vnops.c | 6 +- sys/vfs/procfs/procfs_subr.c | 5 +- sys/vfs/procfs/procfs_vnops.c | 14 +- sys/vfs/smbfs/smbfs.h | 5 +- sys/vfs/smbfs/smbfs_io.c | 28 ++-- sys/vfs/smbfs/smbfs_node.c | 12 +- sys/vfs/smbfs/smbfs_vfsops.c | 12 +- sys/vfs/smbfs/smbfs_vnops.c | 50 +++---- sys/vfs/specfs/spec_vnops.c | 14 +- sys/vfs/udf/udf_vfsops.c | 12 +- sys/vfs/udf/udf_vnops.c | 4 +- sys/vfs/ufs/ffs_balloc.c | 6 +- sys/vfs/ufs/ffs_extern.h | 6 +- sys/vfs/ufs/ffs_inode.c | 13 +- sys/vfs/ufs/ffs_rawread.c | 4 +- sys/vfs/ufs/ffs_softdep.c | 20 ++- sys/vfs/ufs/ffs_vfsops.c | 45 +++--- sys/vfs/ufs/ufs_ihash.c | 5 +- sys/vfs/ufs/ufs_inode.c | 11 +- sys/vfs/ufs/ufs_lookup.c | 16 +- sys/vfs/ufs/ufs_quota.c | 4 +- sys/vfs/ufs/ufs_readwrite.c | 6 +- sys/vfs/ufs/ufs_vnops.c | 31 ++-- sys/vfs/ufs/ufsmount.h | 7 +- sys/vfs/umapfs/umap_subr.c | 4 +- sys/vfs/umapfs/umap_vnops.c | 4 +- sys/vfs/union/union_subr.c | 35 ++--- sys/vfs/union/union_vnops.c | 15 +- sys/vm/vm_mmap.c | 6 +- sys/vm/vm_object.c | 8 +- sys/vm/vm_pageout.c | 4 +- sys/vm/vm_swap.c | 12 +- sys/vm/vnode_pager.c | 4 +- 155 files changed, 1251 insertions(+), 1486 deletions(-) diff --git a/sys/dev/disk/ccd/ccd.c b/sys/dev/disk/ccd/ccd.c index bce6be1a9b..aeda09764b 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.31 2006/05/05 21:15:06 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/ccd/ccd.c,v 1.32 2006/05/06 02:43:02 dillon Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -409,7 +409,7 @@ ccdinit(struct ccddevice *ccd, char **cpaths, struct thread *td) * Get partition information for the component. */ if ((error = VOP_IOCTL(vp, DIOCGPART, (caddr_t)&dpart, - FREAD, cred, td)) != 0) { + FREAD, cred)) != 0) { #ifdef DEBUG if (ccddebug & (CCDB_FOLLOW|CCDB_INIT)) printf("ccd%d: %s: ioctl failed, error = %d\n", @@ -1352,7 +1352,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, d_thread_t *td) #endif if ((error = ccdlookup(cpp[i], td, &vpp[i])) != 0) { for (j = 0; j < lookedup; ++j) - (void)vn_close(vpp[j], FREAD|FWRITE, td); + (void)vn_close(vpp[j], FREAD|FWRITE); free(vpp, M_DEVBUF); free(cpp, M_DEVBUF); ccdunlock(cs); @@ -1369,7 +1369,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, d_thread_t *td) */ if ((error = ccdinit(&ccd, cpp, td)) != 0) { for (j = 0; j < lookedup; ++j) - (void)vn_close(vpp[j], FREAD|FWRITE, td); + (void)vn_close(vpp[j], FREAD|FWRITE); bzero(&ccd_softc[unit], sizeof(struct ccd_softc)); free(vpp, M_DEVBUF); free(cpp, M_DEVBUF); @@ -1424,7 +1424,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, d_thread_t *td) vprint("CCDIOCCLR: vnode info", cs->sc_cinfo[i].ci_vp); #endif - (void)vn_close(cs->sc_cinfo[i].ci_vp, FREAD|FWRITE, td); + (void)vn_close(cs->sc_cinfo[i].ci_vp, FREAD|FWRITE); free(cs->sc_cinfo[i].ci_path, M_DEVBUF); } diff --git a/sys/dev/disk/vn/vn.c b/sys/dev/disk/vn/vn.c index a185ea6092..a7e3257e11 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.23 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/dev/disk/vn/vn.c,v 1.24 2006/05/06 02:43:03 dillon Exp $ */ /* @@ -567,7 +567,7 @@ vniocattach_file(struct vn_softc *vn, struct vn_ioctl *vio, dev_t dev, } vp = nd.nl_open_vp; if (vp->v_type != VREG || - (error = VOP_GETATTR(vp, &vattr, td))) { + (error = VOP_GETATTR(vp, &vattr))) { if (error == 0) error = EINVAL; goto done; @@ -588,7 +588,7 @@ vniocattach_file(struct vn_softc *vn, struct vn_ioctl *vio, dev_t dev, error = vnsetcred(vn, p->p_ucred); if (error) { vn->sc_vp = NULL; - vn_close(vp, flags, td); + vn_close(vp, flags); goto done; } vn->sc_flags |= VNF_INITED; @@ -735,16 +735,14 @@ vnsetcred(struct vn_softc *vn, struct ucred *cred) void vnclear(struct vn_softc *vn) { - struct thread *td = curthread; /* XXX */ - IFOPT(vn, VN_FOLLOW) printf("vnclear(%p): vp=%p\n", vn, vn->sc_vp); if (vn->sc_slices != NULL) dsgone(&vn->sc_slices); vn->sc_flags &= ~VNF_INITED; if (vn->sc_vp != NULL) { - vn_close(vn->sc_vp, vn->sc_flags & VNF_READONLY ? - FREAD : (FREAD|FWRITE), td); + vn_close(vn->sc_vp, + (vn->sc_flags & VNF_READONLY) ? FREAD : (FREAD|FWRITE)); vn->sc_vp = NULL; } vn->sc_flags &= ~VNF_READONLY; diff --git a/sys/dev/misc/streams/streams.c b/sys/dev/misc/streams/streams.c index e27d367348..46f3630a92 100644 --- a/sys/dev/misc/streams/streams.c +++ b/sys/dev/misc/streams/streams.c @@ -31,7 +31,7 @@ * in 3.0-980524-SNAP then hacked a bit (but probably not enough :-). * * $FreeBSD: src/sys/dev/streams/streams.c,v 1.16.2.1 2001/02/26 04:23:07 jlemon Exp $ - * $DragonFly: src/sys/dev/misc/streams/Attic/streams.c,v 1.22 2005/12/11 01:54:08 swildner Exp $ + * $DragonFly: src/sys/dev/misc/streams/Attic/streams.c,v 1.23 2006/05/06 02:43:08 dillon Exp $ */ #include @@ -64,7 +64,7 @@ #include #include -static int svr4_soo_close (struct file *, struct thread *); +static int svr4_soo_close (struct file *); static int svr4_ptm_alloc (struct thread *); static d_open_t streamsopen; @@ -366,14 +366,13 @@ svr4_delete_socket(struct thread *td, struct file *fp) } static int -svr4_soo_close(struct file *fp, struct thread *td) +svr4_soo_close(struct file *fp) { struct socket *so = (struct socket *)fp->f_data; /* CHECKUNIT_DIAG(ENXIO);*/ - svr4_delete_socket(td, fp); + svr4_delete_socket(curthread, fp); /* XXX curthread */ free(so->so_emuldata, M_TEMP); - return soo_close(fp, td); - return (0); + return (soo_close(fp)); } diff --git a/sys/emulation/dragonfly12/dfbsd12_stat.c b/sys/emulation/dragonfly12/dfbsd12_stat.c index 220ec69a85..4f96badc90 100644 --- a/sys/emulation/dragonfly12/dfbsd12_stat.c +++ b/sys/emulation/dragonfly12/dfbsd12_stat.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/emulation/dragonfly12/dfbsd12_stat.c,v 1.1 2005/08/02 13:03:54 joerg Exp $ + * $DragonFly: src/sys/emulation/dragonfly12/dfbsd12_stat.c,v 1.2 2006/05/06 02:43:09 dillon Exp $ */ #include "opt_compatdf12.h" @@ -149,7 +149,7 @@ dfbsd12_fhstat(struct dfbsd12_fhstat_args *uap) return (ESTALE); if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp))) return (error); - error = vn_stat(vp, &sb, td); + error = vn_stat(vp, &sb, td->td_proc->p_ucred); vput(vp); if (error) return (error); diff --git a/sys/emulation/ibcs2/coff/imgact_coff.c b/sys/emulation/ibcs2/coff/imgact_coff.c index 09a14874a7..fca8e4c4f0 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.15 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/coff/Attic/imgact_coff.c,v 1.16 2006/05/06 02:43:10 dillon Exp $ */ #include @@ -189,7 +189,7 @@ coff_load_file(struct thread *td, char *name) goto fail; } - if ((error = VOP_GETATTR(vp, &attr, td)) != 0) + if ((error = VOP_GETATTR(vp, &attr)) != 0) goto fail; if ((vp->v_mount->mnt_flag & MNT_NOEXEC) @@ -202,10 +202,10 @@ coff_load_file(struct thread *td, char *name) goto fail; } - if ((error = VOP_ACCESS(vp, VEXEC, cred, td)) != 0) + if ((error = VOP_ACCESS(vp, VEXEC, cred)) != 0) goto fail; - if ((error = VOP_OPEN(vp, FREAD, cred, NULL, td)) != 0) + if ((error = VOP_OPEN(vp, FREAD, cred, NULL)) != 0) goto fail; /* diff --git a/sys/emulation/ibcs2/i386/ibcs2_fcntl.c b/sys/emulation/ibcs2/i386/ibcs2_fcntl.c index a0f41d482c..9231815347 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_fcntl.c +++ b/sys/emulation/ibcs2/i386/ibcs2_fcntl.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/ibcs2_fcntl.c,v 1.14 1999/09/19 17:00:14 green Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_fcntl.c,v 1.11 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_fcntl.c,v 1.12 2006/05/06 02:43:11 dillon Exp $ */ #include "opt_spx_hack.h" @@ -191,7 +191,7 @@ ibcs2_open(struct ibcs2_open_args *uap) /* ignore any error, just give it a try */ if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td); + fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, p->p_ucred); } return ret; } diff --git a/sys/emulation/ibcs2/i386/ibcs2_ioctl.c b/sys/emulation/ibcs2/i386/ibcs2_ioctl.c index cf665cf304..9ee75cdf5b 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_ioctl.c +++ b/sys/emulation/ibcs2/i386/ibcs2_ioctl.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/ibcs2_ioctl.c,v 1.13.2.1 2001/07/31 20:14:21 jon Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_ioctl.c,v 1.10 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_ioctl.c,v 1.11 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -361,7 +361,7 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) struct ibcs2_termios sts; struct ibcs2_termio st; - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, p->p_ucred)) != 0) return error; btios2stios (&bts, &sts); @@ -397,7 +397,7 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) } /* get full BSD termios so we don't lose information */ - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, td)) != 0) { + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, p->p_ucred)) != 0) { DPRINTF(("ibcs2_ioctl(%d): TCSET ctl failed fd %d ", p->p_pid, SCARG(uap, fd))); return error; @@ -412,7 +412,7 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) stios2btios(&sts, &bts); return fo_ioctl(fp, SCARG(uap, cmd) - IBCS2_TCSETA + TIOCSETA, - (caddr_t)&bts, td); + (caddr_t)&bts, p->p_ucred); } case IBCS2_XCSETA: @@ -428,7 +428,7 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) } stios2btios (&sts, &bts); return fo_ioctl(fp, SCARG(uap, cmd) - IBCS2_XCSETA + TIOCSETA, - (caddr_t)&bts, td); + (caddr_t)&bts, p->p_ucred); } case IBCS2_OXCSETA: @@ -444,7 +444,7 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) } stios2btios (&sts, &bts); return fo_ioctl(fp, SCARG(uap, cmd) - IBCS2_OXCSETA + TIOCSETA, - (caddr_t)&bts, td); + (caddr_t)&bts, p->p_ucred); } case IBCS2_TCSBRK: @@ -459,9 +459,9 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) DPRINTF(("ibcs2_ioctl(td=%p): TCXONC ", td)); return ENOSYS; case 2: - return fo_ioctl(fp, TIOCSTOP, (caddr_t)0, td); + return fo_ioctl(fp, TIOCSTOP, (caddr_t)0, p->p_ucred); case 3: - return fo_ioctl(fp, TIOCSTART, (caddr_t)1, td); + return fo_ioctl(fp, TIOCSTART, (caddr_t)1, p->p_ucred); default: return EINVAL; } @@ -484,7 +484,7 @@ ibcs2_ioctl(struct ibcs2_ioctl_args *uap) default: return EINVAL; } - return fo_ioctl(fp, TIOCFLUSH, (caddr_t)&arg, td); + return fo_ioctl(fp, TIOCFLUSH, (caddr_t)&arg, p->p_ucred); } case IBCS2_TIOCGWINSZ: diff --git a/sys/emulation/ibcs2/i386/ibcs2_util.c b/sys/emulation/ibcs2/i386/ibcs2_util.c index 663934b476..8effe7b4d8 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_util.c +++ b/sys/emulation/ibcs2/i386/ibcs2_util.c @@ -28,7 +28,7 @@ * * from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp * $FreeBSD: src/sys/i386/ibcs2/ibcs2_util.c,v 1.7 1999/12/15 23:01:45 eivind Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_util.c,v 1.10 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_util.c,v 1.11 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -140,13 +140,13 @@ ibcs2_emul_find(caddr_t *sgp, const char *prefix, char *path, error = cache_vref(nd.nl_ncp, nd.nl_cred, &vp); if (error) goto done; - error = VOP_GETATTR(vp, &vat, nd.nl_td); + error = VOP_GETATTR(vp, &vat); vrele(vp); if (error == 0) error = cache_vref(ndroot.nl_ncp, nd.nl_cred, &vp); if (error) goto done; - error = VOP_GETATTR(vp, &vatroot, nd.nl_td); + error = VOP_GETATTR(vp, &vatroot); vrele(vp); if (error) goto done; diff --git a/sys/emulation/ibcs2/i386/ibcs2_xenix.c b/sys/emulation/ibcs2/i386/ibcs2_xenix.c index a9ee9d5aae..c1802c0839 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_xenix.c +++ b/sys/emulation/ibcs2/i386/ibcs2_xenix.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/ibcs2_xenix.c,v 1.20 1999/12/15 23:01:46 eivind Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_xenix.c,v 1.10 2004/11/12 00:09:16 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_xenix.c,v 1.11 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -192,7 +192,6 @@ xenix_scoinfo(struct xenix_scoinfo_args *uap) int xenix_eaccess(struct xenix_eaccess_args *uap) { - struct thread *td = curthread; /* XXX */ struct proc *p = curproc; struct ucred *cred = p->p_ucred; struct vnode *vp; @@ -220,7 +219,7 @@ xenix_eaccess(struct xenix_eaccess_args *uap) if (SCARG(uap, flags) & IBCS2_X_OK) flags |= VEXEC; if ((flags & VWRITE) == 0 || (error = vn_writechk(vp)) == 0) - error = VOP_ACCESS(vp, flags, cred, td); + error = VOP_ACCESS(vp, flags, cred); } vput(vp); done: diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_subr.c b/sys/emulation/linux/i386/linprocfs/linprocfs_subr.c index 6fe84c7e72..25481d13e0 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_subr.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_subr.c @@ -39,7 +39,7 @@ * @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_subr.c,v 1.3.2.4 2001/06/25 19:46:47 pirzyk Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_subr.c,v 1.16 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_subr.c,v 1.17 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -88,7 +88,6 @@ int linprocfs_allocvp(struct mount *mp, struct vnode **vpp, long pid, pfstype pfs_type) { - struct thread *td = curthread; /* XXX */ struct pfsnode *pfs; struct vnode *vp; struct pfsnode **pp; @@ -100,7 +99,7 @@ loop: if (pfs->pfs_pid == pid && pfs->pfs_type == pfs_type && vp->v_mount == mp) { - if (vget(vp, LK_EXCLUSIVE|LK_SLEEPFAIL, td)) + if (vget(vp, LK_EXCLUSIVE|LK_SLEEPFAIL)) goto loop; *vpp = vp; return (0); diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c index ad364b6fbb..7a6989b37d 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.29 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.30 2006/05/06 02:43:11 dillon Exp $ */ /* @@ -204,13 +204,11 @@ linprocfs_ioctl(struct vop_ioctl_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); struct proc *procp; - struct thread *td; int error; int signo; struct procfs_status *psp; unsigned char flags; - td = ap->a_td; procp = pfind(pfs->pfs_pid); if (procp == NULL) { return ENOTTY; @@ -557,7 +555,7 @@ linprocfs_access(struct vop_access_args *ap) return (0); vap = &vattr; - error = VOP_GETATTR(ap->a_vp, vap, ap->a_td); + error = VOP_GETATTR(ap->a_vp, vap); if (error) return (error); diff --git a/sys/emulation/linux/linux_file.c b/sys/emulation/linux/linux_file.c index ef2033c216..aa2aa87431 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.27 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_file.c,v 1.28 2006/05/06 02:43:11 dillon Exp $ */ #include "opt_compat.h" @@ -144,7 +144,7 @@ linux_open(struct linux_open_args *args) struct file *fp = fdp->fd_files[args->sysmsg_result].fp; if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td); + fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, p->p_ucred); } #ifdef DEBUG if (ldebug(open)) @@ -268,7 +268,7 @@ getdents_common(struct linux_getdents64_args *args, int is64bit) if (vp->v_type != VDIR) return (EINVAL); - if ((error = VOP_GETATTR(vp, &va, td))) + if ((error = VOP_GETATTR(vp, &va))) return (error); nbytes = args->count; @@ -1056,7 +1056,7 @@ linux_fcntl_common(struct linux_fcntl64_args *args) return (EINVAL); } - error = kern_fcntl(args->fd, cmd, &dat); + error = kern_fcntl(args->fd, cmd, &dat, p->p_ucred); if (error == 0) { switch (args->cmd) { @@ -1156,7 +1156,7 @@ linux_fcntl64(struct linux_fcntl64_args *args) return (error); linux_to_bsd_flock64(&linux_flock, &dat.fc_flock); - error = kern_fcntl(args->fd, cmd, &dat); + error = kern_fcntl(args->fd, cmd, &dat, curproc->p_ucred); if (error == 0 && args->cmd == LINUX_F_GETLK64) { bsd_to_linux_flock64(&dat.fc_flock, &linux_flock); diff --git a/sys/emulation/linux/linux_ioctl.c b/sys/emulation/linux/linux_ioctl.c index 58397228e3..1ccdcd5c29 100644 --- a/sys/emulation/linux/linux_ioctl.c +++ b/sys/emulation/linux/linux_ioctl.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.55.2.11 2003/05/01 20:16:09 anholt Exp $ - * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.18 2005/04/22 02:09:15 swildner Exp $ + * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.19 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -67,12 +67,12 @@ static int -linux_ioctl_BLKGETSIZE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_BLKGETSIZE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { int error; struct disklabel dl; - error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, td); + error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, cred); if (error) return (error); bcopy(&(dl.d_secperunit), data, sizeof(dl.d_secperunit)); @@ -469,13 +469,13 @@ linux_to_bsd_termio(struct linux_termio *lio, struct termios *bios) } static int -linux_ioctl_TCGETS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCGETS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termios lios; int error; - error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td); + error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, cred); if (error) return (error); bsd_to_linux_termios(&bios, &lios); @@ -484,46 +484,46 @@ linux_ioctl_TCGETS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struc } static int -linux_ioctl_TCSETS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCSETS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termios lios; bcopy(data, &lios, sizeof(lios)); linux_to_bsd_termios(&lios, &bios); - return (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td)); + return (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, cred)); } static int -linux_ioctl_TCSETSW(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCSETSW(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termios lios; bcopy(data, &lios, sizeof(lios)); linux_to_bsd_termios(&lios, &bios); - return (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td)); + return (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, cred)); } static int -linux_ioctl_TCSETSF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCSETSF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termios lios; bcopy(data, &lios, sizeof(lios)); linux_to_bsd_termios(&lios, &bios); - return (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td)); + return (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, cred)); } static int -linux_ioctl_TCGETA(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCGETA(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termio lio; int error; - error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td); + error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, cred); if (error) return (error); bsd_to_linux_termio(&bios, &lio); @@ -532,40 +532,40 @@ linux_ioctl_TCGETA(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struc } static int -linux_ioctl_TCSETA(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCSETA(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termio lio; bcopy(data, &lio, sizeof(lio)); linux_to_bsd_termio(&lio, &bios); - return (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td)); + return (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, cred)); } static int -linux_ioctl_TCSETAW(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCSETAW(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termio lio; bcopy(data, &lio, sizeof(lio)); linux_to_bsd_termio(&lio, &bios); - return (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td)); + return (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, cred)); } static int -linux_ioctl_TCSETAF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCSETAF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct termios bios; struct linux_termio lio; bcopy(data, &lio, sizeof(lio)); linux_to_bsd_termio(&lio, &bios); - return (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td)); + return (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, cred)); } static int -linux_ioctl_TCXONC(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCXONC(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { switch ((u_long)data) { case LINUX_TCOOFF: @@ -579,7 +579,7 @@ linux_ioctl_TCXONC(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struc struct termios bios; int error, c; - error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td); + error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, cred); if (error) return (error); c = ((u_long)data == LINUX_TCIOFF) ? VSTOP : VSTART; @@ -596,9 +596,9 @@ linux_ioctl_TCXONC(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struc auio.uio_resid = sizeof(*bios.c_cc); auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = td; + auio.uio_td = curthread; - return (fo_write(fp, &auio, fp->f_cred, 0, td)); + return (fo_write(fp, &auio, fp->f_cred, 0)); } return (0); @@ -606,11 +606,11 @@ linux_ioctl_TCXONC(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struc default: return (EINVAL); } - return (fo_ioctl(fp, cmd, 0, td)); + return (fo_ioctl(fp, cmd, 0, cred)); } static int -linux_ioctl_TCFLSH(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TCFLSH(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { switch ((u_long)data) { case LINUX_TCIFLUSH: @@ -625,11 +625,11 @@ linux_ioctl_TCFLSH(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struc default: return (EINVAL); } - return (fo_ioctl(fp, TIOCFLUSH, data, td)); + return (fo_ioctl(fp, TIOCFLUSH, data, cred)); } static int -linux_ioctl_TIOCGSERIAL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TIOCGSERIAL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct linux_serial_struct lss; @@ -641,7 +641,7 @@ linux_ioctl_TIOCGSERIAL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, } static int -linux_ioctl_TIOCSSERIAL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TIOCSSERIAL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { #if 0 struct linux_serial_struct lss; @@ -655,7 +655,7 @@ linux_ioctl_TIOCSSERIAL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, } static int -linux_ioctl_TIOCSETD(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TIOCSETD(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { int line; @@ -672,16 +672,16 @@ linux_ioctl_TIOCSETD(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, str default: return (EINVAL); } - return (fo_ioctl(fp, TIOCSETD, (caddr_t)&line, td)); + return (fo_ioctl(fp, TIOCSETD, (caddr_t)&line, cred)); } static int -linux_ioctl_TIOCGETD(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_TIOCGETD(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { int linux_line, error; int bsd_line = TTYDISC; - error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td); + error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, cred); if (error) return (error); switch (bsd_line) { @@ -780,13 +780,13 @@ set_linux_cdrom_addr(union linux_cdrom_addr *addr, int format, int lba) } static int -linux_ioctl_CDROMREADTOCHDR(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_CDROMREADTOCHDR(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct ioc_toc_header th; struct linux_cdrom_tochdr lth; int error; - error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&th, td); + error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&th, cred); if (error) return (error); lth.cdth_trk0 = th.starting_track; @@ -796,7 +796,7 @@ linux_ioctl_CDROMREADTOCHDR(struct file *fp, u_long cmd, u_long ocmd, caddr_t da } static int -linux_ioctl_CDROMREADTOCENTRY(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_CDROMREADTOCENTRY(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct linux_cdrom_tocentry *ltep = (struct linux_cdrom_tocentry *)data; struct ioc_read_toc_single_entry irtse; @@ -804,7 +804,7 @@ linux_ioctl_CDROMREADTOCENTRY(struct file *fp, u_long cmd, u_long ocmd, caddr_t irtse.address_format = ltep->cdte_format; irtse.track = ltep->cdte_track; - error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse, td); + error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse, cred); if (error) return (error); @@ -816,7 +816,7 @@ linux_ioctl_CDROMREADTOCENTRY(struct file *fp, u_long cmd, u_long ocmd, caddr_t } static int -linux_ioctl_CDROMSUBCHNL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_CDROMSUBCHNL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct linux_cdrom_subchnl *sc = (struct linux_cdrom_subchnl *)data; struct ioc_read_subchannel bsdsc; @@ -830,7 +830,7 @@ linux_ioctl_CDROMSUBCHNL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, bsdsc.track = 0; bsdsc.data_len = sizeof(struct cd_sub_channel_info); bsdsc.data = bsdinfo; - error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, td); + error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, cred); if (error) return (error); sc->cdsc_audiostatus = bsdinfo->header.audio_status; @@ -849,9 +849,9 @@ linux_ioctl_CDROMSUBCHNL(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, */ static int -linux_ioctl_OSS_GETVERSION(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_OSS_GETVERSION(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { - int version = linux_get_oss_version(td); + int version = linux_get_oss_version(curthread); bcopy(&version, data, sizeof(int)); return (0); @@ -865,7 +865,7 @@ linux_ioctl_OSS_GETVERSION(struct file *fp, u_long cmd, u_long ocmd, caddr_t dat #define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) static int -linux_ioctl_KDSKBMODE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_KDSKBMODE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { int kbdmode; @@ -882,17 +882,17 @@ linux_ioctl_KDSKBMODE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, st default: return (EINVAL); } - return (fo_ioctl(fp, KDSKBMODE, (caddr_t)&kbdmode, td)); + return (fo_ioctl(fp, KDSKBMODE, (caddr_t)&kbdmode, cred)); } static int -linux_ioctl_VT_SETMODE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_VT_SETMODE(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct vt_mode *mode = (struct vt_mode *)data; if (!ISSIGVALID(mode->frsig) && ISSIGVALID(mode->acqsig)) mode->frsig = mode->acqsig; - return (fo_ioctl(fp, VT_SETMODE, data, td)); + return (fo_ioctl(fp, VT_SETMODE, data, cred)); } @@ -973,7 +973,7 @@ ifname_linux_to_bsd(const char *lxname, char *bsdname) } static int -linux_ioctl_SIOCGIFCONF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_SIOCGIFCONF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct ifconf *ifc = (struct ifconf *)data; struct l_ifreq ifr; @@ -992,7 +992,7 @@ linux_ioctl_SIOCGIFCONF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, uio.uio_resid = ifc->ifc_len; uio.uio_segflg = UIO_USERSPACE; uio.uio_rw = UIO_READ; - uio.uio_td = td; + uio.uio_td = curthread; /* Keep track of eth interfaces */ ethno = 0; @@ -1035,7 +1035,7 @@ linux_ioctl_SIOCGIFCONF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, } static int -linux_ioctl_SIOCGIFFLAGS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_SIOCGIFFLAGS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct l_ifreq *ifr = (struct l_ifreq *)data; struct ifnet *ifp; @@ -1047,7 +1047,7 @@ linux_ioctl_SIOCGIFFLAGS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, * we don't translate the ifname and * use l_ifreq instead of ifreq */ - return (fo_ioctl(fp, SIOCGIFFLAGS, data, td)); + return (fo_ioctl(fp, SIOCGIFFLAGS, data, cred)); } ifp = ifname_linux_to_bsd(ifr->ifr_name, ifname); @@ -1069,7 +1069,7 @@ linux_ioctl_SIOCGIFFLAGS(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, #define ARPHRD_LOOPBACK 772 static int -linux_ioctl_SIOGIFHWADDR(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_SIOGIFHWADDR(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct l_ifreq *ifr = (struct l_ifreq *)data; struct ifnet *ifp; @@ -1103,7 +1103,7 @@ linux_ioctl_SIOGIFHWADDR(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, } static int -linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct thread *td) +linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, struct ucred *cred) { struct ifnet *ifp; int error; @@ -1121,7 +1121,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s /* not a socket - probably a tap / vmnet device */ if (ocmd == LINUX_SIOCGIFADDR || ocmd == LINUX_SIOCSIFADDR) { cmd = (ocmd == LINUX_SIOCGIFADDR) ? SIOCGIFADDR : SIOCSIFADDR; - return (fo_ioctl(fp, cmd, data, td)); + return (fo_ioctl(fp, cmd, data, cred)); } else return (ENOIOCTL); } @@ -1144,7 +1144,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s lifname, oifname); #endif - error = fo_ioctl(fp, cmd, data, td); + error = fo_ioctl(fp, cmd, data, cred); clean_ifname: bcopy(lifname, oifname, LINUX_IFNAMSIZ); diff --git a/sys/emulation/linux/linux_misc.c b/sys/emulation/linux/linux_misc.c index a0a101a10e..353ebfb29b 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.26 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.27 2006/05/06 02:43:11 dillon Exp $ */ #include "opt_compat.h" @@ -280,7 +280,7 @@ linux_uselib(struct linux_uselib_args *args) } /* Executable? */ - error = VOP_GETATTR(vp, &attr, td); + error = VOP_GETATTR(vp, &attr); if (error) goto cleanup; @@ -297,11 +297,11 @@ linux_uselib(struct linux_uselib_args *args) } /* Can we access it? */ - error = VOP_ACCESS(vp, VEXEC, p->p_ucred, td); + error = VOP_ACCESS(vp, VEXEC, p->p_ucred); if (error) goto cleanup; - error = VOP_OPEN(vp, FREAD, p->p_ucred, NULL, td); + error = VOP_OPEN(vp, FREAD, p->p_ucred, NULL); if (error) goto cleanup; diff --git a/sys/emulation/linux/linux_socket.c b/sys/emulation/linux/linux_socket.c index 3d4bdb46dd..8930321b82 100644 --- a/sys/emulation/linux/linux_socket.c +++ b/sys/emulation/linux/linux_socket.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.19.2.8 2001/11/07 20:33:55 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/linux_socket.c,v 1.20 2006/04/26 17:42:52 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_socket.c,v 1.21 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -461,7 +461,7 @@ linux_accept(struct linux_accept_args *args, int *res) * accepted one, so we must clear the flags in the new descriptor. * Ignore any errors, because we already have an open fd. */ - kern_fcntl(*res, F_SETFL, &dat); + kern_fcntl(*res, F_SETFL, &dat, curproc->p_ucred); return (0); } diff --git a/sys/emulation/linux/linux_util.c b/sys/emulation/linux/linux_util.c index 5ce6fdbf28..ef0a79866e 100644 --- a/sys/emulation/linux/linux_util.c +++ b/sys/emulation/linux/linux_util.c @@ -28,7 +28,7 @@ * * from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp * $FreeBSD: src/sys/compat/linux/linux_util.c,v 1.12.2.2 2001/11/05 19:08:23 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/linux_util.c,v 1.10 2004/11/12 00:09:18 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_util.c,v 1.11 2006/05/06 02:43:11 dillon Exp $ */ #include @@ -52,7 +52,6 @@ const char linux_emul_path[] = "/compat/linux"; int linux_copyin_path(char *uname, char **kname, int flags) { - struct thread *td = curthread; struct nlookupdata nd, ndroot; struct vattr vat, vatroot; struct vnode *vp, *vproot; @@ -141,9 +140,9 @@ linux_copyin_path(char *uname, char **kname, int flags) goto dont_translate; } - error = VOP_GETATTR(vp, &vat, td); + error = VOP_GETATTR(vp, &vat); if (error == 0) { - error = VOP_GETATTR(vproot, &vatroot, td); + error = VOP_GETATTR(vproot, &vatroot); if (error == 0) { if (vat.va_fsid == vatroot.va_fsid && vat.va_fileid == vatroot.va_fileid) diff --git a/sys/emulation/ndis/subr_ndis.c b/sys/emulation/ndis/subr_ndis.c index 16ab8838e6..65ccfa8933 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.12 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.13 2006/05/06 02:43:11 dillon Exp $ */ /* @@ -2283,7 +2283,6 @@ ndis_open_file(ndis_status *status, ndis_handle *filehandle, uint32_t *filelengt ndis_unicode_string *filename, ndis_physaddr highestaddr) { char *afilename = NULL; - struct thread *td = curthread; struct nlookupdata nd; int error; struct vattr vat; @@ -2314,7 +2313,7 @@ ndis_open_file(ndis_status *status, ndis_handle *filehandle, uint32_t *filelengt nd.nl_open_vp = NULL; /* Get the file size. */ - VOP_GETATTR(vp, vap, td); + VOP_GETATTR(vp, vap); VOP_UNLOCK(vp, 0); fh->nf_vp = vp; @@ -2332,7 +2331,6 @@ __stdcall static void ndis_map_file(ndis_status *status, void **mappedbuffer, ndis_handle filehandle) { ndis_fh *fh; - struct thread *td = curthread; int error, resid; if (filehandle == NULL) { @@ -2355,7 +2353,7 @@ ndis_map_file(ndis_status *status, void **mappedbuffer, ndis_handle filehandle) fh->nf_map = malloc(fh->nf_maplen, M_DEVBUF, M_WAITOK); error = vn_rdwr(UIO_READ, fh->nf_vp, fh->nf_map, fh->nf_maplen, 0, - UIO_SYSSPACE, 0, proc0.p_ucred, &resid, td); + UIO_SYSSPACE, 0, proc0.p_ucred, &resid); if (error) *status = NDIS_STATUS_FAILURE; @@ -2384,7 +2382,6 @@ ndis_unmap_file(ndis_handle filehandle) __stdcall static void ndis_close_file(ndis_handle filehandle) { - struct thread *td = curthread; ndis_fh *fh; if (filehandle == NULL) @@ -2399,7 +2396,7 @@ ndis_close_file(ndis_handle filehandle) if (fh->nf_vp == NULL) return; - vn_close(fh->nf_vp, FREAD, td); + vn_close(fh->nf_vp, FREAD); fh->nf_vp = NULL; free(fh, M_DEVBUF); diff --git a/sys/emulation/svr4/svr4_fcntl.c b/sys/emulation/svr4/svr4_fcntl.c index f247dd9f50..e5849664d8 100644 --- a/sys/emulation/svr4/svr4_fcntl.c +++ b/sys/emulation/svr4/svr4_fcntl.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_fcntl.c,v 1.7 1999/12/12 10:27:04 newton Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_fcntl.c,v 1.17 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_fcntl.c,v 1.18 2006/05/06 02:43:12 dillon Exp $ */ #include #include @@ -260,7 +260,7 @@ fd_revoke(struct thread *td, int fd) goto out; } - if ((error = VOP_GETATTR(vp, &vattr, td)) != 0) + if ((error = VOP_GETATTR(vp, &vattr)) != 0) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && @@ -300,7 +300,7 @@ fd_truncate(struct thread *td, int fd, struct flock *flp, int *retval) if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) return ESPIPE; - if ((error = VOP_GETATTR(vp, &vattr, td)) != 0) + if ((error = VOP_GETATTR(vp, &vattr)) != 0) return error; length = vattr.va_size; @@ -368,7 +368,7 @@ svr4_sys_open(struct svr4_sys_open_args *uap) /* ignore any error, just give it a try */ if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, p); + fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, cred); #endif } return error; diff --git a/sys/emulation/svr4/svr4_filio.c b/sys/emulation/svr4/svr4_filio.c index f1e34bf039..d9e3020bfa 100644 --- a/sys/emulation/svr4/svr4_filio.c +++ b/sys/emulation/svr4/svr4_filio.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_filio.c,v 1.8 2000/01/15 15:30:44 newton Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_filio.c,v 1.9 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_filio.c,v 1.10 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -213,7 +213,7 @@ svr4_fil_ioctl(struct file *fp, struct thread *td, register_t *retval, #ifdef SVR4_DEBUG if (cmd == FIOASYNC) DPRINTF(("FIOASYNC\n")); #endif - error = fo_ioctl(fp, cmd, (caddr_t) &num, td); + error = fo_ioctl(fp, cmd, (caddr_t) &num, p->p_ucred); if (error) return error; diff --git a/sys/emulation/svr4/svr4_misc.c b/sys/emulation/svr4/svr4_misc.c index 4dbf65a63e..333f70b7ce 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.33 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_misc.c,v 1.34 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -271,7 +271,7 @@ svr4_sys_getdents64(struct svr4_sys_getdents64_args *uap) if (vp->v_type != VDIR) return (EINVAL); - if ((error = VOP_GETATTR(vp, &va, td))) { + if ((error = VOP_GETATTR(vp, &va))) { return error; } @@ -615,7 +615,7 @@ svr4_sys_fchroot(struct svr4_sys_fchroot_args *uap) if (vp->v_type != VDIR || fp->f_ncp == NULL) error = ENOTDIR; else - error = VOP_ACCESS(vp, VEXEC, cred, td); + error = VOP_ACCESS(vp, VEXEC, cred); VOP_UNLOCK(vp, 0); if (error) return error; diff --git a/sys/emulation/svr4/svr4_sockio.c b/sys/emulation/svr4/svr4_sockio.c index cdb40f8fbc..7926d52640 100644 --- a/sys/emulation/svr4/svr4_sockio.c +++ b/sys/emulation/svr4/svr4_sockio.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_sockio.c,v 1.7 1999/12/08 12:00:48 newton Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_sockio.c,v 1.8 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_sockio.c,v 1.9 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -75,6 +75,7 @@ int svr4_sock_ioctl(struct file *fp, struct thread *td, register_t *retval, int fd, u_long cmd, caddr_t data) { + struct ucred *cred = curproc->p_ucred; int error; *retval = 0; @@ -120,7 +121,7 @@ svr4_sock_ioctl(struct file *fp, struct thread *td, register_t *retval, (void) strncpy(br.ifr_name, sr.svr4_ifr_name, sizeof(br.ifr_name)); if ((error = fo_ioctl(fp, SIOCGIFFLAGS, - (caddr_t) &br, td)) != 0) { + (caddr_t) &br, cred)) != 0) { DPRINTF(("SIOCGIFFLAGS (%s) %s: error %d\n", br.ifr_name, sr.svr4_ifr_name, error)); return error; @@ -144,7 +145,7 @@ svr4_sock_ioctl(struct file *fp, struct thread *td, register_t *retval, sc.svr4_ifc_len)); if ((error = fo_ioctl(fp, OSIOCGIFCONF, - (caddr_t) &sc, td)) != 0) + (caddr_t) &sc, cred)) != 0) return error; DPRINTF(("SIOCGIFCONF\n")); diff --git a/sys/emulation/svr4/svr4_stream.c b/sys/emulation/svr4/svr4_stream.c index dedd18de16..0d718e95c2 100644 --- a/sys/emulation/svr4/svr4_stream.c +++ b/sys/emulation/svr4/svr4_stream.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_stream.c,v 1.12.2.2 2000/11/26 04:42:27 dillon Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_stream.c,v 1.15 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_stream.c,v 1.16 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -1209,6 +1209,7 @@ i_nread(struct file *fp, struct thread *td, register_t *retval, { int error; int nread = 0; + struct ucred *cred = curproc->p_ucred; /* * We are supposed to return the message length in nread, and the @@ -1217,7 +1218,7 @@ i_nread(struct file *fp, struct thread *td, register_t *retval, * for us, and if we do, then we assume that we have at least one * message waiting for us. */ - if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td)) != 0) + if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, cred)) != 0) return error; if (nread != 0) diff --git a/sys/emulation/svr4/svr4_sysvec.c b/sys/emulation/svr4/svr4_sysvec.c index fbecbfb4d2..b51291b627 100644 --- a/sys/emulation/svr4/svr4_sysvec.c +++ b/sys/emulation/svr4/svr4_sysvec.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_sysvec.c,v 1.10.2.2 2002/07/09 14:12:43 robert Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_sysvec.c,v 1.14 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_sysvec.c,v 1.15 2006/05/06 02:43:12 dillon Exp $ */ /* XXX we use functions that might not exist. */ @@ -323,7 +323,7 @@ svr4_emul_find(caddr_t *sgp, const char *prefix, char *path, char **pbuf, free(buf, M_TEMP); return (error); } - error = VOP_GETATTR(vp, &vat, td); + error = VOP_GETATTR(vp, &vat); vrele(vp); if (error) goto done; @@ -348,7 +348,7 @@ svr4_emul_find(caddr_t *sgp, const char *prefix, char *path, char **pbuf, free(buf, M_TEMP); return (error); } - error = VOP_GETATTR(vp, &vatroot, td); + error = VOP_GETATTR(vp, &vatroot); vrele(vp); if (error) goto done; diff --git a/sys/emulation/svr4/svr4_termios.c b/sys/emulation/svr4/svr4_termios.c index 70d316475b..20b57b6dfb 100644 --- a/sys/emulation/svr4/svr4_termios.c +++ b/sys/emulation/svr4/svr4_termios.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_termios.c,v 1.5 1999/12/08 12:00:48 newton Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_termios.c,v 1.6 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_termios.c,v 1.7 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -475,6 +475,7 @@ svr4_term_ioctl(struct file *fp, struct thread *td, register_t *retval, struct svr4_termios st; struct svr4_termio t; int error, new; + struct ucred *cred = curproc->p_ucred; *retval = 0; @@ -484,7 +485,7 @@ svr4_term_ioctl(struct file *fp, struct thread *td, register_t *retval, case SVR4_TCGETA: case SVR4_TCGETS: DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S')); - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, cred)) != 0) return error; memset(&st, 0, sizeof(st)); @@ -511,7 +512,7 @@ svr4_term_ioctl(struct file *fp, struct thread *td, register_t *retval, case SVR4_TCSETSF: DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n")); /* get full BSD termios so we don't lose information */ - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, cred)) != 0) return error; switch (cmd) { @@ -562,14 +563,14 @@ svr4_term_ioctl(struct file *fp, struct thread *td, register_t *retval, print_svr4_termios(&st); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, cmd, (caddr_t) &bt, td); + return fo_ioctl(fp, cmd, (caddr_t) &bt, cred); case SVR4_TIOCGWINSZ: DPRINTF(("TIOCGWINSZ\n")); { struct svr4_winsize ws; - error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, td); + error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, cred); if (error) return error; return copyout(&ws, data, sizeof(ws)); @@ -582,7 +583,7 @@ svr4_term_ioctl(struct file *fp, struct thread *td, register_t *retval, if ((error = copyin(data, &ws, sizeof(ws))) != 0) return error; - return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, td); + return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, cred); } default: diff --git a/sys/emulation/svr4/svr4_ttold.c b/sys/emulation/svr4/svr4_ttold.c index 156622f9ab..4a1f2fc15d 100644 --- a/sys/emulation/svr4/svr4_ttold.c +++ b/sys/emulation/svr4/svr4_ttold.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_ttold.c,v 1.7 1999/12/08 12:00:49 newton Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_ttold.c,v 1.6 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_ttold.c,v 1.7 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -168,7 +168,8 @@ int svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, int fd, u_long cmd, caddr_t data) { - int error; + struct ucred *cred = curproc->p_ucred; + int error; *retval = 0; @@ -177,7 +178,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, { pid_t pid; - if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, cred)) != 0) return error; DPRINTF(("TIOCGPGRP %d\n", pid)); @@ -196,14 +197,14 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, DPRINTF(("TIOCSPGRP %d\n", pid)); - return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, td); + return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, cred); } case SVR4_TIOCGSID: { #if defined(TIOCGSID) pid_t pid; - if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, cred)) != 0) return error; DPRINTF(("TIOCGSID %d\n", pid)); @@ -220,7 +221,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, struct sgttyb bs; struct svr4_sgttyb ss; - error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, td); + error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, cred); if (error) return error; @@ -245,7 +246,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, print_svr4_sgttyb("SVR4_TIOCSET{P,N}", &ss); #endif /* DEBUG_SVR4 */ cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN; - return fo_ioctl(fp, cmd, (caddr_t) &bs, td); + return fo_ioctl(fp, cmd, (caddr_t) &bs, cred); } case SVR4_TIOCGETC: @@ -253,7 +254,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, struct tchars bt; struct svr4_tchars st; - error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, td); + error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, cred); if (error) return error; @@ -276,7 +277,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, #ifdef DEBUG_SVR4 print_svr4_tchars("SVR4_TIOCSETC", &st); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, td); + return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, cred); } case SVR4_TIOCGLTC: @@ -284,7 +285,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, struct ltchars bl; struct svr4_ltchars sl; - error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, td); + error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, cred); if (error) return error; @@ -307,13 +308,13 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, #ifdef DEBUG_SVR4 print_svr4_ltchars("SVR4_TIOCSLTC", &sl); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, td); + return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, cred); } case SVR4_TIOCLGET: { int flags; - if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, td)) != 0) + if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, cred)) != 0) return error; DPRINTF(("SVR4_TIOCLGET %o\n", flags)); return copyout(&flags, data, sizeof(flags)); @@ -341,7 +342,7 @@ svr4_ttold_ioctl(struct file *fp, struct thread *td, register_t *retval, } DPRINTF(("SVR4_TIOCL{SET,BIS,BIC} %o\n", flags)); - return fo_ioctl(fp, cmd, (caddr_t) &flags, td); + return fo_ioctl(fp, cmd, (caddr_t) &flags, cred); } default: diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index c2766b5040..89718c4ca7 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -39,7 +39,7 @@ * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ * $FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.132.2.9 2003/01/25 19:02:23 dillon Exp $ - * $DragonFly: src/sys/i386/i386/Attic/vm_machdep.c,v 1.41 2006/04/30 20:23:22 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/vm_machdep.c,v 1.42 2006/05/06 02:43:12 dillon Exp $ */ #include "use_npx.h" @@ -336,7 +336,7 @@ cpu_coredump(struct thread *td, struct vnode *vp, struct ucred *cred) bcopy(p->p_thread->td_pcb, tempuser + ((char *)p->p_thread->td_pcb - (char *)p->p_addr), sizeof(struct pcb)); error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser, ctob(UPAGES), - (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, (int *)NULL, td); + (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, (int *)NULL); free(tempuser, M_TEMP); diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 496ffc720d..c76a7ee1fd 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/imgact_aout.c,v 1.59.2.5 2001/11/03 01:41:08 ps Exp $ - * $DragonFly: src/sys/kern/imgact_aout.c,v 1.10 2006/03/29 18:44:50 dillon Exp $ + * $DragonFly: src/sys/kern/imgact_aout.c,v 1.11 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -262,15 +262,13 @@ aout_coredump(p, vp, limit) if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, vm->vm_daddr, (int)ctob(vm->vm_dsize), (off_t)ctob(UPAGES), UIO_USERSPACE, - IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *) NULL, - p->p_thread); + IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *) NULL); if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), (off_t)ctob(UPAGES) + ctob(vm->vm_dsize), UIO_USERSPACE, - IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *) NULL, - p->p_thread); + IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *) NULL); return (error); } diff --git a/sys/kern/imgact_resident.c b/sys/kern/imgact_resident.c index c803a8804f..ae90b6d292 100644 --- a/sys/kern/imgact_resident.c +++ b/sys/kern/imgact_resident.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/imgact_resident.c,v 1.10 2006/05/05 20:15:01 dillon Exp $ + * $DragonFly: src/sys/kern/imgact_resident.c,v 1.11 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -101,12 +101,12 @@ fill_xresident(struct vmresident *vr, struct xresident *in, struct thread *td) } /* indicate that we are using the vnode */ - error = vget(vrtmp, LK_EXCLUSIVE, td); + error = vget(vrtmp, LK_EXCLUSIVE); if (error) goto done; /* retrieve underlying stat information and release vnode */ - error = vn_stat(vrtmp, &st, td); + error = vn_stat(vrtmp, &st, td->td_proc->p_ucred); vput(vrtmp); if (error) goto done; diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 2981a00711..c3ed14df12 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.21 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/kern/kern_acct.c,v 1.22 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -162,7 +162,7 @@ acct(struct acct_args *uap) if (acctp != NULLVP || savacctp != NULLVP) { callout_stop(&acctwatch_handle); error = vn_close((acctp != NULLVP ? acctp : savacctp), - FWRITE | O_APPEND, td); + FWRITE | O_APPEND); acctp = savacctp = NULLVP; } @@ -197,7 +197,6 @@ acct_process(struct proc *p) struct timeval ut, st, tmp; int t; struct vnode *vp; - struct thread *td = p->p_thread; /* If accounting isn't enabled, don't bother */ vp = acctp; @@ -263,7 +262,7 @@ acct_process(struct proc *p) */ return (vn_rdwr(UIO_WRITE, vp, (caddr_t)&acct, sizeof (acct), (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, p->p_ucred, - (int *)0, td)); + (int *)0)); } /* @@ -318,7 +317,7 @@ acctwatch(void *a) if (savacctp != NULLVP) { if (savacctp->v_type == VBAD) { - (void) vn_close(savacctp, FWRITE | O_APPEND, NULL); + (void) vn_close(savacctp, FWRITE | O_APPEND); savacctp = NULLVP; return; } @@ -332,7 +331,7 @@ acctwatch(void *a) if (acctp == NULLVP) return; if (acctp->v_type == VBAD) { - (void) vn_close(acctp, FWRITE | O_APPEND, NULL); + (void) vn_close(acctp, FWRITE | O_APPEND); acctp = NULLVP; return; } diff --git a/sys/kern/kern_acl.c b/sys/kern/kern_acl.c index 2af8f4de23..488f4895cd 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.11 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/kern/kern_acl.c,v 1.12 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -80,7 +80,7 @@ vacl_set_acl(struct vnode *vp, acl_type_t type, struct acl *aclp) ucred = td->td_proc->p_ucred; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_SETACL(vp, type, &inkernacl, ucred, td); + error = VOP_SETACL(vp, type, &inkernacl, ucred); VOP_UNLOCK(vp, 0); return(error); } @@ -98,7 +98,7 @@ vacl_get_acl(struct vnode *vp, acl_type_t type, struct acl *aclp) KKASSERT(td->td_proc); ucred = td->td_proc->p_ucred; - error = VOP_GETACL(vp, type, &inkernelacl, ucred, td); + error = VOP_GETACL(vp, type, &inkernelacl, ucred); if (error == 0) error = copyout(&inkernelacl, aclp, sizeof(struct acl)); return (error); @@ -117,7 +117,7 @@ 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); - error = VOP_SETACL(vp, ACL_TYPE_DEFAULT, 0, ucred, td); + error = VOP_SETACL(vp, ACL_TYPE_DEFAULT, 0, ucred); VOP_UNLOCK(vp, 0); return (error); } @@ -138,7 +138,7 @@ vacl_aclcheck(struct vnode *vp, acl_type_t type, struct acl *aclp) error = copyin(aclp, &inkernelacl, sizeof(struct acl)); if (error) return(error); - error = VOP_ACLCHECK(vp, type, &inkernelacl, ucred, td); + error = VOP_ACLCHECK(vp, type, &inkernelacl, ucred); return (error); } diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 4542442e48..c98982e918 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -70,7 +70,7 @@ * * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 * $FreeBSD: src/sys/kern/kern_descrip.c,v 1.81.2.19 2004/02/28 00:43:31 tegge Exp $ - * $DragonFly: src/sys/kern/kern_descrip.c,v 1.52 2006/05/02 21:30:43 dillon Exp $ + * $DragonFly: src/sys/kern/kern_descrip.c,v 1.53 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_compat.h" @@ -132,15 +132,14 @@ static struct cdevsw fildesc_cdevsw = { }; static int badfo_readwrite (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); static int badfo_ioctl (struct file *fp, u_long com, caddr_t data, - struct thread *td); -static int badfo_poll (struct file *fp, int events, - struct ucred *cred, struct thread *td); + struct ucred *cred); +static int badfo_poll (struct file *fp, int events, struct ucred *cred); static int badfo_kqfilter (struct file *fp, struct knote *kn); -static int badfo_stat (struct file *fp, struct stat *sb, struct thread *td); -static int badfo_close (struct file *fp, struct thread *td); -static int badfo_shutdown (struct file *fp, int how, struct thread *td); +static int badfo_stat (struct file *fp, struct stat *sb, struct ucred *cred); +static int badfo_close (struct file *fp); +static int badfo_shutdown (struct file *fp, int how); /* * Descriptor management. @@ -195,7 +194,7 @@ dup(struct dup_args *uap) } int -kern_fcntl(int fd, int cmd, union fcntl_dat *dat) +kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred) { struct thread *td = curthread; struct proc *p = td->td_proc; @@ -240,32 +239,32 @@ kern_fcntl(int fd, int cmd, union fcntl_dat *dat) fp->f_flag &= ~FCNTLFLAGS; fp->f_flag |= FFLAGS(dat->fc_flags & ~O_ACCMODE) & FCNTLFLAGS; tmp = fp->f_flag & FNONBLOCK; - error = fo_ioctl(fp, FIONBIO, (caddr_t)&tmp, td); + error = fo_ioctl(fp, FIONBIO, (caddr_t)&tmp, cred); if (error) { fdrop(fp, td); return (error); } tmp = fp->f_flag & FASYNC; - error = fo_ioctl(fp, FIOASYNC, (caddr_t)&tmp, td); + error = fo_ioctl(fp, FIOASYNC, (caddr_t)&tmp, cred); if (!error) { fdrop(fp, td); return (0); } fp->f_flag &= ~FNONBLOCK; tmp = 0; - fo_ioctl(fp, FIONBIO, (caddr_t)&tmp, td); + fo_ioctl(fp, FIONBIO, (caddr_t)&tmp, cred); fdrop(fp, td); return (error); case F_GETOWN: fhold(fp); - error = fo_ioctl(fp, FIOGETOWN, (caddr_t)&dat->fc_owner, td); + error = fo_ioctl(fp, FIOGETOWN, (caddr_t)&dat->fc_owner, cred); fdrop(fp, td); return(error); case F_SETOWN: fhold(fp); - error = fo_ioctl(fp, FIOSETOWN, (caddr_t)&dat->fc_owner, td); + error = fo_ioctl(fp, FIOSETOWN, (caddr_t)&dat->fc_owner, cred); fdrop(fp, td); return(error); @@ -383,7 +382,7 @@ fcntl(struct fcntl_args *uap) break; } - error = kern_fcntl(uap->fd, uap->cmd, &dat); + error = kern_fcntl(uap->fd, uap->cmd, &dat, curproc->p_ucred); if (error == 0) { switch (uap->cmd) { @@ -760,7 +759,7 @@ kern_shutdown(int fd, int how) (fp = fdp->fd_files[fd].fp) == NULL) return (EBADF); fhold(fp); - error = fo_shutdown(fp, how, td); + error = fo_shutdown(fp, how); fdrop(fp, td); return (error); @@ -792,7 +791,7 @@ kern_fstat(int fd, struct stat *ub) (fp = fdp->fd_files[fd].fp) == NULL) return (EBADF); fhold(fp); - error = fo_stat(fp, ub, td); + error = fo_stat(fp, ub, p->p_ucred); fdrop(fp, td); return (error); @@ -1656,7 +1655,7 @@ fdrop(struct file *fp, struct thread *td) (void) VOP_ADVLOCK(vp, (caddr_t)fp, F_UNLCK, &lf, F_FLOCK); } if (fp->f_ops != &badfileops) - error = fo_close(fp, td); + error = fo_close(fp); else error = 0; ffree(fp); @@ -1975,20 +1974,19 @@ badfo_readwrite( struct file *fp, struct uio *uio, struct ucred *cred, - int flags, - struct thread *td + int flags ) { return (EBADF); } static int -badfo_ioctl(struct file *fp, u_long com, caddr_t data, struct thread *td) +badfo_ioctl(struct file *fp, u_long com, caddr_t data, struct ucred *cred) { return (EBADF); } static int -badfo_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) +badfo_poll(struct file *fp, int events, struct ucred *cred) { return (0); } @@ -2000,25 +1998,25 @@ badfo_kqfilter(struct file *fp, struct knote *kn) } static int -badfo_stat(struct file *fp, struct stat *sb, struct thread *td) +badfo_stat(struct file *fp, struct stat *sb, struct ucred *cred) { return (EBADF); } static int -badfo_close(struct file *fp, struct thread *td) +badfo_close(struct file *fp) { return (EBADF); } static int -badfo_shutdown(struct file *fp, int how, struct thread *td) +badfo_shutdown(struct file *fp, int how) { return (EBADF); } int -nofo_shutdown(struct file *fp, int how, struct thread *td) +nofo_shutdown(struct file *fp, int how) { return (EOPNOTSUPP); } diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index d0353ab52c..7fe562f273 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_event.c,v 1.2.2.10 2004/04/04 07:03:14 cperciva Exp $ - * $DragonFly: src/sys/kern/kern_event.c,v 1.20 2006/03/25 18:32:35 dillon Exp $ + * $DragonFly: src/sys/kern/kern_event.c,v 1.21 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -58,16 +58,16 @@ static int kqueue_scan(struct file *fp, int maxevents, struct kevent *ulistp, const struct timespec *timeout, struct thread *td, int *res); static int kqueue_read(struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); static int kqueue_write(struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); static int kqueue_ioctl(struct file *fp, u_long com, caddr_t data, - struct thread *td); -static int kqueue_poll(struct file *fp, int events, struct ucred *cred, - struct thread *td); + struct ucred *cred); +static int kqueue_poll(struct file *fp, int events, struct ucred *cred); static int kqueue_kqfilter(struct file *fp, struct knote *kn); -static int kqueue_stat(struct file *fp, struct stat *st, struct thread *td); -static int kqueue_close(struct file *fp, struct thread *td); +static int kqueue_stat(struct file *fp, struct stat *st, + struct ucred *cred); +static int kqueue_close(struct file *fp); static void kqueue_wakeup(struct kqueue *kq); static struct fileops kqueueops = { @@ -723,30 +723,28 @@ done: */ /*ARGSUSED*/ static int -kqueue_read(struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td) +kqueue_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { return (ENXIO); } /*ARGSUSED*/ static int -kqueue_write(struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td) +kqueue_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { return (ENXIO); } /*ARGSUSED*/ static int -kqueue_ioctl(struct file *fp, u_long com, caddr_t data, struct thread *td) +kqueue_ioctl(struct file *fp, u_long com, caddr_t data, struct ucred *cred) { return (ENOTTY); } /*ARGSUSED*/ static int -kqueue_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) +kqueue_poll(struct file *fp, int events, struct ucred *cred) { struct kqueue *kq = (struct kqueue *)fp->f_data; int revents = 0; @@ -756,7 +754,7 @@ kqueue_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) if (kq->kq_count) { revents |= events & (POLLIN | POLLRDNORM); } else { - selrecord(td, &kq->kq_sel); + selrecord(curthread, &kq->kq_sel); kq->kq_state |= KQ_SEL; } } @@ -766,7 +764,7 @@ kqueue_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) /*ARGSUSED*/ static int -kqueue_stat(struct file *fp, struct stat *st, struct thread *td) +kqueue_stat(struct file *fp, struct stat *st, struct ucred *cred) { struct kqueue *kq = (struct kqueue *)fp->f_data; @@ -779,8 +777,9 @@ kqueue_stat(struct file *fp, struct stat *st, struct thread *td) /*ARGSUSED*/ static int -kqueue_close(struct file *fp, struct thread *td) +kqueue_close(struct file *fp) { + struct thread *td = curthread; struct proc *p = td->td_proc; struct kqueue *kq = (struct kqueue *)fp->f_data; struct filedesc *fdp; diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2c4c32ae3f..a8c355f86f 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.37 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/kern/kern_exec.c,v 1.38 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -898,11 +898,10 @@ exec_check_permissions(struct image_params *imgp) struct proc *p = imgp->proc; struct vnode *vp = imgp->vp; struct vattr *attr = imgp->attr; - struct thread *td = p->p_thread; int error; /* Get file attributes */ - error = VOP_GETATTR(vp, attr, td); + error = VOP_GETATTR(vp, attr); if (error) return (error); @@ -929,7 +928,7 @@ exec_check_permissions(struct image_params *imgp) /* * Check for execute permission to file based on current credentials. */ - error = VOP_ACCESS(vp, VEXEC, p->p_ucred, td); + error = VOP_ACCESS(vp, VEXEC, p->p_ucred); if (error) return (error); @@ -945,7 +944,7 @@ exec_check_permissions(struct image_params *imgp) * write, and mmap the file. Without the VOP_OPEN we can only * stat the file. */ - error = VOP_OPEN(vp, FREAD, p->p_ucred, NULL, td); + error = VOP_OPEN(vp, FREAD, p->p_ucred, NULL); if (error) return (error); diff --git a/sys/kern/kern_fp.c b/sys/kern/kern_fp.c index d406d081a5..eeac8ac9ad 100644 --- a/sys/kern/kern_fp.c +++ b/sys/kern/kern_fp.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_fp.c,v 1.14 2006/04/01 20:46:47 dillon Exp $ + * $DragonFly: src/sys/kern/kern_fp.c,v 1.15 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -168,7 +168,7 @@ fp_vpopen(struct vnode *vp, int flags, file_t *fpp) if (flags & FREAD) vmode |= VREAD; if (vmode) { - error = VOP_ACCESS(vp, vmode, td->td_proc->p_ucred, td); + error = VOP_ACCESS(vp, vmode, td->td_proc->p_ucred); if (error) goto bad2; } @@ -182,7 +182,7 @@ fp_vpopen(struct vnode *vp, int flags, file_t *fpp) if ((flags & O_ROOTCRED) == 0 && td->td_proc) fsetcred(fp, td->td_proc->p_ucred); - error = VOP_OPEN(vp, flags, td->td_proc->p_ucred, fp, td); + error = VOP_OPEN(vp, flags, td->td_proc->p_ucred, fp); if (error) goto bad1; @@ -230,7 +230,7 @@ fp_pread(file_t fp, void *buf, size_t nbytes, off_t offset, ssize_t *res) auio.uio_td = curthread; count = nbytes; - error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET, auio.uio_td); + error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET); if (error) { if (auio.uio_resid != nbytes && (error == ERESTART || error == EINTR || error == EWOULDBLOCK) @@ -277,7 +277,7 @@ fp_read(file_t fp, void *buf, size_t nbytes, ssize_t *res, int all) */ do { lastresid = auio.uio_resid; - error = fo_read(fp, &auio, fp->f_cred, 0, auio.uio_td); + error = fo_read(fp, &auio, fp->f_cred, 0); } while (all && auio.uio_resid && ((error == 0 && auio.uio_resid != lastresid) || error == ERESTART || error == EINTR)); @@ -331,7 +331,7 @@ fp_pwrite(file_t fp, void *buf, size_t nbytes, off_t offset, ssize_t *res) auio.uio_td = curthread; count = nbytes; - error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET, auio.uio_td); + error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET); if (error) { if (auio.uio_resid != nbytes && (error == ERESTART || error == EINTR || error == EWOULDBLOCK) @@ -373,7 +373,7 @@ fp_write(file_t fp, void *buf, size_t nbytes, ssize_t *res) auio.uio_td = curthread; count = nbytes; - error = fo_write(fp, &auio, fp->f_cred, 0, auio.uio_td); + error = fo_write(fp, &auio, fp->f_cred, 0); if (error) { if (auio.uio_resid != nbytes && (error == ERESTART || error == EINTR || error == EWOULDBLOCK) @@ -392,7 +392,7 @@ fp_stat(file_t fp, struct stat *ub) { int error; - error = fo_stat(fp, ub, curthread); + error = fo_stat(fp, ub, fp->f_cred); return(error); } @@ -559,7 +559,7 @@ fp_mmap(void *addr_arg, size_t size, int prot, int flags, struct file *fp, ) { if ((fp->f_flag & FWRITE) != 0) { struct vattr va; - if ((error = VOP_GETATTR(vp, &va, td))) { + if ((error = VOP_GETATTR(vp, &va))) { goto done; } if ((va.va_flags & (IMMUTABLE|APPEND)) == 0) { @@ -594,6 +594,6 @@ fp_close(file_t fp) int fp_shutdown(file_t fp, int how) { - return(fo_shutdown(fp, how, curthread)); + return(fo_shutdown(fp, how)); } diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 55b93bd14c..5adea7d586 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/kern/kern_jail.c,v 1.6.2.3 2001/08/17 01:00:26 rwatson Exp $ - * $DragonFly: src/sys/kern/kern_jail.c,v 1.9 2005/10/08 11:43:02 corecode Exp $ + * $DragonFly: src/sys/kern/kern_jail.c,v 1.10 2006/05/06 02:43:12 dillon Exp $ * */ @@ -232,15 +232,13 @@ prison_remote_ip(struct thread *td, int flag, u_int32_t *ip) } int -prison_if(struct thread *td, struct sockaddr *sa) +prison_if(struct ucred *cred, struct sockaddr *sa) { struct prison *pr; struct sockaddr_in *sai = (struct sockaddr_in*) sa; int ok; - if (td->td_proc == NULL) - return(0); - pr = td->td_proc->p_ucred->cr_prison; + pr = cred->cr_prison; if ((sai->sin_family != AF_INET) && jail_socket_unixiproute_only) ok = 1; diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 1454ced698..0b43720821 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.21 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/kern/kern_ktrace.c,v 1.22 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_ktrace.h" @@ -286,7 +286,7 @@ ktrace(struct ktrace_args *uap) if (ktrcanset(curp, p) && p->p_tracep == vp) { p->p_tracep = NULL; p->p_traceflag = 0; - vn_close(vp, FREAD|FWRITE, td); + vn_close(vp, FREAD|FWRITE); } else { error = EPERM; } @@ -337,7 +337,7 @@ ktrace(struct ktrace_args *uap) error = EPERM; done: if (vp != NULL) - vn_close(vp, FWRITE, td); + vn_close(vp, FWRITE); curp->p_traceflag &= ~KTRFAC_ACTIVE; return (error); #else diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 1ea00291ca..39f1067803 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.45 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/kern/kern_sig.c,v 1.46 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_ktrace.h" @@ -1628,7 +1628,6 @@ coredump(struct proc *p) { struct vnode *vp; struct ucred *cred = p->p_ucred; - struct thread *td = p->p_thread; struct flock lf; struct nlookupdata nd; struct vattr vattr; @@ -1679,7 +1678,7 @@ coredump(struct proc *p) /* Don't dump to non-regular files or files with links. */ if (vp->v_type != VREG || - VOP_GETATTR(vp, &vattr, td) || vattr.va_nlink != 1) { + VOP_GETATTR(vp, &vattr) || vattr.va_nlink != 1) { error = EFAULT; goto out1; } @@ -1687,7 +1686,7 @@ coredump(struct proc *p) VATTR_NULL(&vattr); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vattr.va_size = 0; - VOP_SETATTR(vp, &vattr, cred, td); + VOP_SETATTR(vp, &vattr, cred); p->p_acflag |= ACORE; VOP_UNLOCK(vp, 0); @@ -1698,7 +1697,7 @@ out1: lf.l_type = F_UNLCK; VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &lf, F_FLOCK); out2: - error1 = vn_close(vp, FWRITE, td); + error1 = vn_close(vp, FWRITE); if (error == 0) error = error1; return (error); diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c index 8d9526709a..468b3c6df6 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.16 2006/05/05 21:15:08 dillon Exp $ + * $DragonFly: src/sys/kern/link_aout.c,v 1.17 2006/05/06 02:43:12 dillon Exp $ */ #define FREEBSD_AOUT 1 @@ -232,7 +232,7 @@ link_aout_load_file(const char* filename, linker_file_t* result) * Read the a.out header from the file. */ error = vn_rdwr(UIO_READ, vp, (void*) &header, sizeof header, 0, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); if (error) goto out; @@ -252,7 +252,7 @@ link_aout_load_file(const char* filename, linker_file_t* result) */ error = vn_rdwr(UIO_READ, vp, (void*) af->address, header.a_text + header.a_data, 0, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); if (error) goto out; bzero(af->address + header.a_text + header.a_data, header.a_bss); @@ -290,7 +290,7 @@ link_aout_load_file(const char* filename, linker_file_t* result) out: VOP_UNLOCK(vp, 0); - vn_close(vp, FREAD, td); + vn_close(vp, FREAD); return error; } diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 22e7e3ab88..21cd06dba1 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.18 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/link_elf.c,v 1.19 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -452,7 +452,7 @@ link_elf_load_file(const char* filename, linker_file_t* result) } hdr = (Elf_Ehdr *)firstpage; error = vn_rdwr(UIO_READ, vp, firstpage, PAGE_SIZE, 0, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); nbytes = PAGE_SIZE - resid; if (error) goto out; @@ -576,7 +576,7 @@ link_elf_load_file(const char* filename, linker_file_t* result) caddr_t segbase = mapbase + segs[i]->p_vaddr - base_vaddr; error = vn_rdwr(UIO_READ, vp, segbase, segs[i]->p_filesz, segs[i]->p_offset, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); if (error) { #ifdef SPARSE_MAPPING vm_map_remove(kernel_map, (vm_offset_t) ef->address, @@ -643,7 +643,7 @@ link_elf_load_file(const char* filename, linker_file_t* result) } error = vn_rdwr(UIO_READ, vp, (caddr_t)shdr, nbytes, hdr->e_shoff, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); if (error) goto out; symtabindex = -1; @@ -668,12 +668,12 @@ link_elf_load_file(const char* filename, linker_file_t* result) } error = vn_rdwr(UIO_READ, vp, ef->symbase, symcnt, shdr[symtabindex].sh_offset, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); if (error) goto out; error = vn_rdwr(UIO_READ, vp, ef->strbase, strcnt, shdr[symstrindex].sh_offset, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid); if (error) goto out; @@ -696,7 +696,7 @@ out: if (firstpage) free(firstpage, M_LINKER); VOP_UNLOCK(vp, 0); - vn_close(vp, FREAD, td); + vn_close(vp, FREAD); return error; } diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 18ccfbdda0..bae7677d3c 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -37,7 +37,7 @@ * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/sys_generic.c,v 1.55.2.10 2001/03/17 10:39:32 peter Exp $ - * $DragonFly: src/sys/kern/sys_generic.c,v 1.25 2006/04/26 17:42:53 dillon Exp $ + * $DragonFly: src/sys/kern/sys_generic.c,v 1.26 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_ktrace.h" @@ -267,7 +267,7 @@ dofileread(int fd, struct file *fp, struct uio *auio, int flags, int *res) } #endif len = auio->uio_resid; - error = fo_read(fp, auio, fp->f_cred, flags, td); + error = fo_read(fp, auio, fp->f_cred, flags); if (error) { if (auio->uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -456,7 +456,7 @@ dofilewrite(int fd, struct file *fp, struct uio *auio, int flags, int *res) len = auio->uio_resid; if (fp->f_type == DTYPE_VNODE) bwillwrite(); - error = fo_write(fp, auio, fp->f_cred, flags, td); + error = fo_write(fp, auio, fp->f_cred, flags); if (error) { if (auio->uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -507,6 +507,7 @@ mapped_ioctl(int fd, u_long com, caddr_t uspc_data, struct ioctl_map *map) { struct thread *td = curthread; struct proc *p = td->td_proc; + struct ucred *cred; struct file *fp; struct filedesc *fdp; struct ioctl_map_range *iomc = NULL; @@ -522,6 +523,7 @@ mapped_ioctl(int fd, u_long com, caddr_t uspc_data, struct ioctl_map *map) } ubuf; KKASSERT(p); + cred = p->p_ucred; fdp = p->p_fd; if ((u_int)fd >= fdp->fd_nfiles || (fp = fdp->fd_files[fd].fp) == NULL) @@ -646,7 +648,7 @@ mapped_ioctl(int fd, u_long com, caddr_t uspc_data, struct ioctl_map *map) fp->f_flag |= FNONBLOCK; else fp->f_flag &= ~FNONBLOCK; - error = fo_ioctl(fp, FIONBIO, (caddr_t)&tmp, td); + error = fo_ioctl(fp, FIONBIO, (caddr_t)&tmp, cred); break; case FIOASYNC: @@ -654,7 +656,7 @@ mapped_ioctl(int fd, u_long com, caddr_t uspc_data, struct ioctl_map *map) fp->f_flag |= FASYNC; else fp->f_flag &= ~FASYNC; - error = fo_ioctl(fp, FIOASYNC, (caddr_t)&tmp, td); + error = fo_ioctl(fp, FIOASYNC, (caddr_t)&tmp, cred); break; default: @@ -663,9 +665,9 @@ mapped_ioctl(int fd, u_long com, caddr_t uspc_data, struct ioctl_map *map) * call it instead of directly routing the call */ if (map != NULL && iomc->wrapfunc != NULL) - error = iomc->wrapfunc(fp, com, ocom, data, td); + error = iomc->wrapfunc(fp, com, ocom, data, cred); else - error = fo_ioctl(fp, com, data, td); + error = fo_ioctl(fp, com, data, cred); /* * Copy any data to user, size was * already set and checked above. @@ -857,7 +859,6 @@ done: static int selscan(struct proc *p, fd_mask **ibits, fd_mask **obits, int nfd, int *res) { - struct thread *td = p->p_thread; struct filedesc *fdp = p->p_fd; int msk, i, fd; fd_mask bits; @@ -878,7 +879,7 @@ selscan(struct proc *p, fd_mask **ibits, fd_mask **obits, int nfd, int *res) fp = fdp->fd_files[fd].fp; if (fp == NULL) return (EBADF); - if (fo_poll(fp, flag[msk], fp->f_cred, td)) { + if (fo_poll(fp, flag[msk], fp->f_cred)) { obits[msk][(fd)/NFDBITS] |= ((fd_mask)1 << ((fd) % NFDBITS)); n++; @@ -982,7 +983,6 @@ out: static int pollscan(struct proc *p, struct pollfd *fds, u_int nfd, int *res) { - struct thread *td = p->p_thread; struct filedesc *fdp = p->p_fd; int i; struct file *fp; @@ -1005,7 +1005,7 @@ pollscan(struct proc *p, struct pollfd *fds, u_int nfd, int *res) * POLLERR if appropriate. */ fds->revents = fo_poll(fp, fds->events, - fp->f_cred, td); + fp->f_cred); if (fds->revents != 0) n++; } diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index f99176b1a0..95facb8897 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -17,7 +17,7 @@ * are met. * * $FreeBSD: src/sys/kern/sys_pipe.c,v 1.60.2.13 2002/08/05 15:05:15 des Exp $ - * $DragonFly: src/sys/kern/sys_pipe.c,v 1.32 2005/09/02 07:16:58 hsu Exp $ + * $DragonFly: src/sys/kern/sys_pipe.c,v 1.33 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -93,16 +93,15 @@ * interfaces to the outside world */ static int pipe_read (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); static int pipe_write (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); -static int pipe_close (struct file *fp, struct thread *td); -static int pipe_shutdown (struct file *fp, int how, struct thread *td); -static int pipe_poll (struct file *fp, int events, struct ucred *cred, - struct thread *td); + struct ucred *cred, int flags); +static int pipe_close (struct file *fp); +static int pipe_shutdown (struct file *fp, int how); +static int pipe_poll (struct file *fp, int events, struct ucred *cred); static int pipe_kqfilter (struct file *fp, struct knote *kn); -static int pipe_stat (struct file *fp, struct stat *sb, struct thread *td); -static int pipe_ioctl (struct file *fp, u_long cmd, caddr_t data, struct thread *td); +static int pipe_stat (struct file *fp, struct stat *sb, struct ucred *cred); +static int pipe_ioctl (struct file *fp, u_long cmd, caddr_t data, struct ucred *cred); static struct fileops pipeops = { NULL, /* port */ @@ -419,8 +418,7 @@ pipeselwakeup(cpipe) /* ARGSUSED */ static int -pipe_read(struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td) +pipe_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct pipe *rpipe = (struct pipe *) fp->f_data; int error; @@ -854,8 +852,7 @@ error2: #endif static int -pipe_write(struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td) +pipe_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { int error = 0; int orig_resid; @@ -1131,7 +1128,7 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *cred, * we implement a very minimal set of ioctls for compatibility with sockets. */ int -pipe_ioctl(struct file *fp, u_long cmd, caddr_t data, struct thread *td) +pipe_ioctl(struct file *fp, u_long cmd, caddr_t data, struct ucred *cred) { struct pipe *mpipe = (struct pipe *)fp->f_data; @@ -1178,7 +1175,7 @@ pipe_ioctl(struct file *fp, u_long cmd, caddr_t data, struct thread *td) } int -pipe_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) +pipe_poll(struct file *fp, int events, struct ucred *cred) { struct pipe *rpipe = (struct pipe *)fp->f_data; struct pipe *wpipe; @@ -1204,12 +1201,12 @@ pipe_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) if (revents == 0) { if (events & (POLLIN | POLLRDNORM)) { - selrecord(td, &rpipe->pipe_sel); + selrecord(curthread, &rpipe->pipe_sel); rpipe->pipe_state |= PIPE_SEL; } if (events & (POLLOUT | POLLWRNORM)) { - selrecord(td, &wpipe->pipe_sel); + selrecord(curthread, &wpipe->pipe_sel); wpipe->pipe_state |= PIPE_SEL; } } @@ -1218,7 +1215,7 @@ pipe_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) } static int -pipe_stat(struct file *fp, struct stat *ub, struct thread *td) +pipe_stat(struct file *fp, struct stat *ub, struct ucred *cred) { struct pipe *pipe = (struct pipe *)fp->f_data; @@ -1244,7 +1241,7 @@ pipe_stat(struct file *fp, struct stat *ub, struct thread *td) /* ARGSUSED */ static int -pipe_close(struct file *fp, struct thread *td) +pipe_close(struct file *fp) { struct pipe *cpipe = (struct pipe *)fp->f_data; @@ -1260,7 +1257,7 @@ pipe_close(struct file *fp, struct thread *td) */ /* ARGSUSED */ static int -pipe_shutdown(struct file *fp, int how, struct thread *td) +pipe_shutdown(struct file *fp, int how) { struct pipe *rpipe = (struct pipe *)fp->f_data; struct pipe *wpipe; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 8d1ff9d88e..0a2b66a5e8 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -32,7 +32,7 @@ * * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/kern/sys_socket.c,v 1.28.2.2 2001/02/26 04:23:16 jlemon Exp $ - * $DragonFly: src/sys/kern/sys_socket.c,v 1.8 2005/07/13 01:38:50 dillon Exp $ + * $DragonFly: src/sys/kern/sys_socket.c,v 1.9 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -61,8 +61,7 @@ struct fileops socketops = { /* ARGSUSED */ int -soo_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags, - struct thread *td) +soo_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct socket *so = (struct socket *)fp->f_data; @@ -71,8 +70,7 @@ soo_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags, /* ARGSUSED */ int -soo_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags, - struct thread *td) +soo_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct socket *so = (struct socket *)fp->f_data; @@ -80,7 +78,7 @@ soo_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags, } int -soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct thread *td) +soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct ucred *cred) { struct socket *so = (struct socket *)fp->f_data; @@ -133,21 +131,21 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct thread *td) * different entry since a socket's unnecessary */ if (IOCGROUP(cmd) == 'i') - return (ifioctl(so, cmd, data, td)); + return (ifioctl(so, cmd, data, cred)); if (IOCGROUP(cmd) == 'r') - return (rtioctl(cmd, data, td)); - return (so_pru_control(so, cmd, data, NULL, td)); + return (rtioctl(cmd, data, cred)); + return (so_pru_control(so, cmd, data, NULL)); } int -soo_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) +soo_poll(struct file *fp, int events, struct ucred *cred) { struct socket *so = (struct socket *)fp->f_data; - return (so_pru_sopoll(so, events, cred, td)); + return (so_pru_sopoll(so, events, cred)); } int -soo_stat(struct file *fp, struct stat *ub, struct thread *td) +soo_stat(struct file *fp, struct stat *ub, struct ucred *cred) { struct socket *so = (struct socket *)fp->f_data; @@ -170,7 +168,7 @@ soo_stat(struct file *fp, struct stat *ub, struct thread *td) /* ARGSUSED */ int -soo_close(struct file *fp, struct thread *td) +soo_close(struct file *fp) { int error = 0; @@ -183,7 +181,7 @@ soo_close(struct file *fp, struct thread *td) /* ARGSUSED */ int -soo_shutdown(struct file *fp, int how, struct thread *td) +soo_shutdown(struct file *fp, int how) { int error = 0; diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 56a5dc90ba..01506b07ef 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.22 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/tty.c,v 1.23 2006/05/06 02:43:12 dillon Exp $ */ /*- @@ -303,7 +303,6 @@ void ttyclosesession(struct session *sp, int dorele) { struct vnode *vp; - struct thread *td = curthread; if ((vp = sp->s_ttyvp) == NULL) return; @@ -311,7 +310,7 @@ ttyclosesession(struct session *sp, int dorele) if (vp->v_flag & VCTTYISOPEN) { if (vn_lock(vp, LK_EXCLUSIVE|LK_RETRY) == 0) { vclrflags(vp, VCTTYISOPEN); - VOP_CLOSE(vp, FREAD|FWRITE, td); + VOP_CLOSE(vp, FREAD|FWRITE); VOP_UNLOCK(vp, 0); } } diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index a2db5a63be..1c8b62f4f9 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.14 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/tty_tty.c,v 1.15 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -99,7 +99,7 @@ cttyopen(dev_t dev, int flag, int mode, struct thread *td) } else { vsetflags(ttyvp, VCTTYISOPEN); vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(ttyvp, FREAD|FWRITE, NOCRED, NULL, td); + error = VOP_OPEN(ttyvp, FREAD|FWRITE, NOCRED, NULL); if (error) vclrflags(ttyvp, VCTTYISOPEN); VOP_UNLOCK(ttyvp, 0); @@ -135,7 +135,7 @@ cttyclose(dev_t dev, int fflag, int devtype, struct thread *td) vclrflags(ttyvp, VCTTYISOPEN); error = vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); if (error == 0) { - error = VOP_CLOSE(ttyvp, FREAD|FWRITE, td); + error = VOP_CLOSE(ttyvp, FREAD|FWRITE); VOP_UNLOCK(ttyvp, 0); } } else { @@ -165,7 +165,7 @@ cttyread(dev, uio, flag) ttyvp = cttyvp(p); if (ttyvp == NULL) return (EIO); - if ((error = vget(ttyvp, LK_EXCLUSIVE | LK_RETRY, td)) == 0) { + if ((error = vget(ttyvp, LK_EXCLUSIVE | LK_RETRY)) == 0) { error = VOP_READ(ttyvp, uio, flag, NOCRED); vput(ttyvp); } @@ -193,7 +193,7 @@ cttywrite(dev, uio, flag) ttyvp = cttyvp(p); if (ttyvp == NULL) return (EIO); - if ((error = vget(ttyvp, LK_EXCLUSIVE | LK_RETRY, td)) == 0) { + if ((error = vget(ttyvp, LK_EXCLUSIVE | LK_RETRY)) == 0) { error = VOP_WRITE(ttyvp, uio, flag, NOCRED); vput(ttyvp); } @@ -225,7 +225,7 @@ cttyioctl(dev, cmd, addr, flag, td) } else return (EINVAL); } - return (VOP_IOCTL(ttyvp, cmd, addr, flag, NOCRED, td)); + return (VOP_IOCTL(ttyvp, cmd, addr, flag, NOCRED)); } /*ARGSUSED*/ @@ -240,7 +240,7 @@ cttypoll(dev_t dev, int events, struct thread *td) if (ttyvp == NULL) /* try operation to get EOF/failure */ return (seltrue(dev, events, td)); - return (VOP_POLL(ttyvp, events, p->p_ucred, td)); + return (VOP_POLL(ttyvp, events, p->p_ucred)); } static void ctty_drvinit (void *unused); diff --git a/sys/kern/uipc_msg.c b/sys/kern/uipc_msg.c index 464c223250..fb68a1f8b8 100644 --- a/sys/kern/uipc_msg.c +++ b/sys/kern/uipc_msg.c @@ -30,7 +30,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/uipc_msg.c,v 1.13 2004/07/08 22:07:34 hsu Exp $ + * $DragonFly: src/sys/kern/uipc_msg.c,v 1.14 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -175,11 +175,10 @@ so_pru_connect2(struct socket *so1, struct socket *so2) } int -so_pru_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, - struct thread *td) +so_pru_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) { return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd, data, ifp, - td)); + curthread)); #ifdef gag /* does copyin and copyout deep inside stack XXX JH */ int error; struct netmsg_pru_control msg; @@ -373,8 +372,7 @@ so_pru_sockaddr(struct socket *so, struct sockaddr **nam) } int -so_pru_sopoll(struct socket *so, int events, struct ucred *cred, - struct thread *td) +so_pru_sopoll(struct socket *so, int events, struct ucred *cred) { int error; struct netmsg_pru_sopoll msg; @@ -387,7 +385,7 @@ so_pru_sopoll(struct socket *so, int events, struct ucred *cred, msg.nm_so = so; msg.nm_events = events; msg.nm_cred = cred; - msg.nm_td = td; + msg.nm_td = curthread; error = lwkt_domsg(port, &msg.nm_lmsg); return (error); } diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 118b119fab..8c37ad6aa2 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -33,7 +33,7 @@ * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/kern/uipc_socket2.c,v 1.55.2.17 2002/08/31 19:04:55 dwmalone Exp $ - * $DragonFly: src/sys/kern/uipc_socket2.c,v 1.22 2005/07/23 07:28:34 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_socket2.c,v 1.23 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_param.h" @@ -182,9 +182,9 @@ sonewconn(struct socket *head, int connstatus) if (head->so_qlen > 3 * head->so_qlimit / 2) return ((struct socket *)0); - so = soalloc(0); + so = soalloc(1); if (so == NULL) - return ((struct socket *)0); + return (NULL); if ((head->so_options & SO_ACCEPTFILTER) != 0) connstatus = 0; so->so_head = head; diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index da6a303597..a58c67352b 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.63 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_syscalls.c,v 1.64 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_ktrace.h" @@ -319,9 +319,9 @@ kern_accept(int s, struct sockaddr **name, int *namelen, int *res) nfp->f_data = so; /* Sync socket nonblocking/async state with file flags */ tmp = fflag & FNONBLOCK; - (void) fo_ioctl(nfp, FIONBIO, (caddr_t)&tmp, td); + (void) fo_ioctl(nfp, FIONBIO, (caddr_t)&tmp, p->p_ucred); tmp = fflag & FASYNC; - (void) fo_ioctl(nfp, FIOASYNC, (caddr_t)&tmp, td); + (void) fo_ioctl(nfp, FIOASYNC, (caddr_t)&tmp, p->p_ucred); sa = NULL; error = soaccept(so, &sa); diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 245e2e0223..b2c7e74388 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.23 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_usrreq.c,v 1.24 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -654,7 +654,7 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) error = ENOTSOCK; goto bad; } - error = VOP_ACCESS(vp, VWRITE, p->p_ucred, td); + error = VOP_ACCESS(vp, VWRITE, p->p_ucred); if (error) goto bad; so2 = vp->v_socket; diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 59e88dd5b6..5ee0b85280 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -14,7 +14,7 @@ * of the author. This software is distributed AS-IS. * * $FreeBSD: src/sys/kern/vfs_aio.c,v 1.70.2.28 2003/05/29 06:15:35 alc Exp $ - * $DragonFly: src/sys/kern/vfs_aio.c,v 1.25 2006/04/30 20:23:24 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_aio.c,v 1.26 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -580,10 +580,10 @@ aio_process(struct aiocblist *aiocbe) */ if (cb->aio_lio_opcode == LIO_READ) { auio.uio_rw = UIO_READ; - error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET, mytd); + error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET); } else { auio.uio_rw = UIO_WRITE; - error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET, mytd); + error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET); } inblock_end = mytd->td_proc->p_stats->p_ru.ru_inblock; oublock_end = mytd->td_proc->p_stats->p_ru.ru_oublock; diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index d823ba8d3c..af2b689c23 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.66 2006/05/05 21:27:53 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_cache.c,v 1.67 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -825,7 +825,7 @@ again: cache_unlock(ncp); goto again; } - error = vget(vp, lk_type, curthread); + error = vget(vp, lk_type); if (error) { if (vp != ncp->nc_vp) goto again; @@ -1211,7 +1211,7 @@ cache_inefficient_scan(struct namecache *ncp, struct ucred *cred, int error; vat.va_blocksize = 0; - if ((error = VOP_GETATTR(dvp, &vat, curthread)) != 0) + if ((error = VOP_GETATTR(dvp, &vat)) != 0) return (error); if ((error = cache_vget(ncp, cred, LK_SHARED, &pvp)) != 0) return (error); diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 75913eb07f..93d96fa393 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.38 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_default.c,v 1.39 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -208,7 +208,7 @@ vop_compat_nresolve(struct vop_nresolve_args *ap) * variable, in the directory inode. That needs to be fixed and the * other VFS's audited before we can switch to LK_SHARED. */ - if ((error = vget(dvp, LK_EXCLUSIVE, curthread)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -279,7 +279,7 @@ vop_compat_nlookupdotdot(struct vop_nlookupdotdot_args *ap) * other VFS's audited before we can switch to LK_SHARED. */ *ap->a_vpp = NULL; - if ((error = vget(ap->a_dvp, LK_EXCLUSIVE, curthread)) != 0) + if ((error = vget(ap->a_dvp, LK_EXCLUSIVE)) != 0) return (error); if (ap->a_dvp->v_type != VDIR) { vput(ap->a_dvp); @@ -338,7 +338,7 @@ vop_compat_ncreate(struct vop_ncreate_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -420,7 +420,7 @@ vop_compat_nmkdir(struct vop_nmkdir_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -502,7 +502,7 @@ vop_compat_nmknod(struct vop_nmknod_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -583,7 +583,7 @@ vop_compat_nlink(struct vop_nlink_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -655,7 +655,7 @@ vop_compat_nsymlink(struct vop_nsymlink_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -740,7 +740,7 @@ vop_compat_nwhiteout(struct vop_nwhiteout_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -829,7 +829,7 @@ vop_compat_nremove(struct vop_nremove_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -903,7 +903,7 @@ vop_compat_nrmdir(struct vop_nrmdir_args *ap) if ((dvp = ncp->nc_parent->nc_vp) == NULL) return(EPERM); - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", ncp, ncp->nc_name); return(EAGAIN); @@ -1004,7 +1004,7 @@ vop_compat_nrename(struct vop_nrename_args *ap) * the source, it is believed that the only side effect that matters * is the permissions check. */ - if ((error = vget(fdvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(fdvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", fncp, fncp->nc_name); return(EAGAIN); @@ -1057,7 +1057,7 @@ vop_compat_nrename(struct vop_nrename_args *ap) vrele(fvp); return (error); } - if ((error = vget(tdvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(tdvp, LK_EXCLUSIVE)) != 0) { printf("[diagnostic] vop_compat_resolve: EAGAIN on ncp %p %s\n", tncp, tncp->nc_name); vrele(fdvp); @@ -1322,11 +1322,10 @@ vop_stdpoll(ap) struct vnode *a_vp; int a_events; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { if (ap->a_events & ~POLLSTANDARD) - return (vn_pollrecord(ap->a_vp, ap->a_td, ap->a_events)); + return (vn_pollrecord(ap->a_vp, ap->a_events)); return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); } @@ -1378,13 +1377,13 @@ vfs_stdquotactl(struct mount *mp, int cmds, uid_t uid, } int -vfs_stdsync(struct mount *mp, int waitfor, struct thread *td) +vfs_stdsync(struct mount *mp, int waitfor) { return (0); } int -vfs_stdnosync(struct mount *mp, int waitfor, struct thread *td) +vfs_stdnosync(struct mount *mp, int waitfor) { return (EOPNOTSUPP); } diff --git a/sys/kern/vfs_jops.c b/sys/kern/vfs_jops.c index 9efc3466a9..420331b933 100644 --- a/sys/kern/vfs_jops.c +++ b/sys/kern/vfs_jops.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_jops.c,v 1.23 2005/09/17 07:43:00 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_jops.c,v 1.24 2006/05/06 02:43:12 dillon Exp $ */ /* * Each mount point may have zero or more independantly configured journals @@ -1289,7 +1289,7 @@ jreclist_undo_file(struct jrecord_list *jreclist, struct vnode *vp, error = 0; if (jrflags & JRUNDO_GETVP) - error = vget(vp, LK_SHARED, curthread); + error = vget(vp, LK_SHARED); if (error == 0) { TAILQ_FOREACH(jrec, jreclist, user_entry) { if (jrec->jo->flags & MC_JOURNAL_WANT_REVERSABLE) { @@ -1962,7 +1962,7 @@ jrecord_file_data(struct jrecord *jrec, struct vnode *vp, while (bytes) { n = (bytes > bufsize) ? bufsize : (int)bytes; error = vn_rdwr(UIO_READ, vp, buf, n, off, UIO_SYSSPACE, IO_NODELOCKED, - proc0.p_ucred, NULL, curthread); + proc0.p_ucred, NULL); if (error) { jrecord_leaf(jrec, JLEAF_ERROR, &error, sizeof(error)); break; @@ -1997,7 +1997,7 @@ jrecord_undo_file(struct jrecord *jrec, struct vnode *vp, int jrflags, * and retrieve attribute info. */ save1 = jrecord_push(jrec, JTYPE_UNDO); - error = VOP_GETATTR(vp, &attr, curthread); + error = VOP_GETATTR(vp, &attr); if (error) goto done; @@ -2138,7 +2138,7 @@ journal_setattr(struct vop_setattr_args *ap) error = vop_journal_operate_ap(&ap->a_head); if (error == 0) { TAILQ_FOREACH(jrec, &jreclist, user_entry) { - jrecord_write_cred(jrec, ap->a_td, ap->a_cred); + jrecord_write_cred(jrec, curthread, ap->a_cred); jrecord_write_vnode_ref(jrec, ap->a_vp); save = jrecord_push(jrec, JTYPE_REDO); jrecord_write_vattr(jrec, ap->a_vap); @@ -2314,7 +2314,7 @@ journal_setacl(struct vop_setacl_args *ap) if ((jo->flags & MC_JOURNAL_WANT_REVERSABLE)) jrecord_undo_file(jrec, ap->a_vp, JRUNDO_XXX, 0, 0); #endif - jrecord_write_cred(jrec, ap->a_td, ap->a_cred); + jrecord_write_cred(jrec, curthread, ap->a_cred); jrecord_write_vnode_ref(jrec, ap->a_vp); #if 0 save = jrecord_push(jrec, JTYPE_REDO); @@ -2350,7 +2350,7 @@ journal_setextattr(struct vop_setextattr_args *ap) if ((jo->flags & MC_JOURNAL_WANT_REVERSABLE)) jrecord_undo_file(jrec, ap->a_vp, JRUNDO_XXX, 0, 0); #endif - jrecord_write_cred(jrec, ap->a_td, ap->a_cred); + jrecord_write_cred(jrec, curthread, ap->a_cred); jrecord_write_vnode_ref(jrec, ap->a_vp); jrecord_leaf(jrec, JLEAF_ATTRNAME, ap->a_name, strlen(ap->a_name)); save = jrecord_push(jrec, JTYPE_REDO); diff --git a/sys/kern/vfs_journal.c b/sys/kern/vfs_journal.c index 5d63c8402e..5ffe0ebd06 100644 --- a/sys/kern/vfs_journal.c +++ b/sys/kern/vfs_journal.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_journal.c,v 1.23 2005/09/17 07:43:00 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_journal.c,v 1.24 2006/05/06 02:43:12 dillon Exp $ */ /* * Each mount point may have zero or more independantly configured journals @@ -1289,7 +1289,7 @@ jreclist_undo_file(struct jrecord_list *jreclist, struct vnode *vp, error = 0; if (jrflags & JRUNDO_GETVP) - error = vget(vp, LK_SHARED, curthread); + error = vget(vp, LK_SHARED); if (error == 0) { TAILQ_FOREACH(jrec, jreclist, user_entry) { if (jrec->jo->flags & MC_JOURNAL_WANT_REVERSABLE) { @@ -1962,7 +1962,7 @@ jrecord_file_data(struct jrecord *jrec, struct vnode *vp, while (bytes) { n = (bytes > bufsize) ? bufsize : (int)bytes; error = vn_rdwr(UIO_READ, vp, buf, n, off, UIO_SYSSPACE, IO_NODELOCKED, - proc0.p_ucred, NULL, curthread); + proc0.p_ucred, NULL); if (error) { jrecord_leaf(jrec, JLEAF_ERROR, &error, sizeof(error)); break; @@ -1997,7 +1997,7 @@ jrecord_undo_file(struct jrecord *jrec, struct vnode *vp, int jrflags, * and retrieve attribute info. */ save1 = jrecord_push(jrec, JTYPE_UNDO); - error = VOP_GETATTR(vp, &attr, curthread); + error = VOP_GETATTR(vp, &attr); if (error) goto done; @@ -2138,7 +2138,7 @@ journal_setattr(struct vop_setattr_args *ap) error = vop_journal_operate_ap(&ap->a_head); if (error == 0) { TAILQ_FOREACH(jrec, &jreclist, user_entry) { - jrecord_write_cred(jrec, ap->a_td, ap->a_cred); + jrecord_write_cred(jrec, curthread, ap->a_cred); jrecord_write_vnode_ref(jrec, ap->a_vp); save = jrecord_push(jrec, JTYPE_REDO); jrecord_write_vattr(jrec, ap->a_vap); @@ -2314,7 +2314,7 @@ journal_setacl(struct vop_setacl_args *ap) if ((jo->flags & MC_JOURNAL_WANT_REVERSABLE)) jrecord_undo_file(jrec, ap->a_vp, JRUNDO_XXX, 0, 0); #endif - jrecord_write_cred(jrec, ap->a_td, ap->a_cred); + jrecord_write_cred(jrec, curthread, ap->a_cred); jrecord_write_vnode_ref(jrec, ap->a_vp); #if 0 save = jrecord_push(jrec, JTYPE_REDO); @@ -2350,7 +2350,7 @@ journal_setextattr(struct vop_setextattr_args *ap) if ((jo->flags & MC_JOURNAL_WANT_REVERSABLE)) jrecord_undo_file(jrec, ap->a_vp, JRUNDO_XXX, 0, 0); #endif - jrecord_write_cred(jrec, ap->a_td, ap->a_cred); + jrecord_write_cred(jrec, curthread, ap->a_cred); jrecord_write_vnode_ref(jrec, ap->a_vp); jrecord_leaf(jrec, JLEAF_ATTRNAME, ap->a_name, strlen(ap->a_name)); save = jrecord_push(jrec, JTYPE_REDO); diff --git a/sys/kern/vfs_lock.c b/sys/kern/vfs_lock.c index f18424e95a..35d3365623 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.16 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_lock.c,v 1.17 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -155,8 +155,6 @@ vref(struct vnode *vp) void vrele(struct vnode *vp) { - thread_t td = curthread; - crit_enter(); if (vp->v_usecount == 1) { KASSERT(lockcountnb(&vp->v_lock) == 0, ("last vrele vp %p still locked", vp)); @@ -170,7 +168,7 @@ vrele(struct vnode *vp) if ((vp->v_flag & VINACTIVE) == 0 && vp->v_usecount == 1) { vp->v_flag |= VINACTIVE; - VOP_INACTIVE(vp, td); + VOP_INACTIVE(vp); } vx_unlock(vp); } @@ -309,7 +307,7 @@ vx_put(struct vnode *vp) * VX lock after the normal unlock. XXX make it more efficient. */ int -vget(struct vnode *vp, int flags, thread_t td) +vget(struct vnode *vp, int flags) { int error; diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 22ab345516..be70fccfca 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -67,7 +67,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/vfs_mount.c,v 1.16 2006/05/05 21:27:53 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_mount.c,v 1.17 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -461,7 +461,7 @@ vtrytomakegoneable(struct vnode *vp, int page_count) if (vp->v_object && vp->v_object->resident_page_count >= page_count) return (0); if (vp->v_holdcnt && visleaf(vp)) { - vinvalbuf(vp, V_SAVE, NULL, 0, 0); + vinvalbuf(vp, V_SAVE, 0, 0); #if 0 /* DEBUG */ printf((vp->v_holdcnt ? "vrecycle: vp %p failed: %s\n" : "vrecycle: vp %p succeeded: %s\n"), vp, @@ -909,11 +909,10 @@ vmntvnodescan( switch(flags) { case VMSC_GETVP: - error = vget(vp, LK_EXCLUSIVE, curthread); + error = vget(vp, LK_EXCLUSIVE); break; case VMSC_GETVP|VMSC_NOWAIT: - error = vget(vp, LK_EXCLUSIVE|LK_NOWAIT, - curthread); + error = vget(vp, LK_EXCLUSIVE|LK_NOWAIT); break; case VMSC_GETVX: error = vx_get(vp); @@ -1073,7 +1072,7 @@ vflush_scan(struct mount *mp, struct vnode *vp, void *data) */ if ((info->flags & WRITECLOSE) && (vp->v_type == VNON || - (VOP_GETATTR(vp, &vattr, info->td) == 0 && + (VOP_GETATTR(vp, &vattr) == 0 && vattr.va_nlink > 0)) && (vp->v_writecount == 0 || vp->v_type != VREG)) { return(0); @@ -1097,7 +1096,7 @@ vflush_scan(struct mount *mp, struct vnode *vp, void *data) if (vp->v_type != VBLK && vp->v_type != VCHR) { vgone(vp); } else { - vclean(vp, 0, info->td); + vclean(vp, 0); vp->v_ops = &spec_vnode_vops; insmntque(vp, NULL); } diff --git a/sys/kern/vfs_nlookup.c b/sys/kern/vfs_nlookup.c index 76729a7104..4d9412e5ba 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.14 2006/05/05 21:27:53 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_nlookup.c,v 1.15 2006/05/06 02:43:12 dillon Exp $ */ /* * nlookup() is the 'new' namei interface. Rather then return directory and @@ -227,7 +227,7 @@ nlookup_done(struct nlookupdata *nd) 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); + vn_close(nd->nl_open_vp, nd->nl_vp_fmode); nd->nl_open_vp = NULL; } nd->nl_flags = 0; /* clear remaining flags (just clear everything) */ @@ -743,7 +743,7 @@ naccess(struct namecache *ncp, int vmode, struct ucred *cred) error = 0; } else if (error == 0) { /* XXX cache the va in the namecache or in the vnode */ - if ((error = VOP_GETATTR(vp, &va, curthread)) == 0) { + if ((error = VOP_GETATTR(vp, &va)) == 0) { if ((vmode & VWRITE) && vp->v_mount) { if (vp->v_mount->mnt_flag & MNT_RDONLY) error = EROFS; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index d2615303b0..a9eeb81c60 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.82 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_subr.c,v 1.83 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -281,8 +281,7 @@ vupdatefsmid(struct vnode *vp) } int -vinvalbuf(struct vnode *vp, int flags, struct thread *td, - int slpflag, int slptimeo) +vinvalbuf(struct vnode *vp, int flags, int slpflag, int slptimeo) { struct vinvalbuf_bp_info info; int error; @@ -305,7 +304,7 @@ vinvalbuf(struct vnode *vp, int flags, struct thread *td, } if (!RB_EMPTY(&vp->v_rbdirty_tree)) { crit_exit(); - if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) != 0) + if ((error = VOP_FSYNC(vp, MNT_WAIT)) != 0) return (error); crit_enter(); if (vp->v_track_write.bk_active > 0 || @@ -432,7 +431,7 @@ static int vtruncbuf_bp_metasync_cmp(struct buf *bp, void *data); static int vtruncbuf_bp_metasync(struct buf *bp, void *data); int -vtruncbuf(struct vnode *vp, struct thread *td, off_t length, int blksize) +vtruncbuf(struct vnode *vp, off_t length, int blksize) { off_t truncloffset; int count; @@ -1006,7 +1005,7 @@ addaliasu(struct vnode *nvp, udev_t nvp_udev) * to VOP_CLOSE the vnode before we can deactivate and reclaim it. */ void -vclean(struct vnode *vp, int flags, struct thread *td) +vclean(struct vnode *vp, int flags) { int active; int n; @@ -1038,7 +1037,7 @@ vclean(struct vnode *vp, int flags, struct thread *td) * Clean out any buffers associated with the vnode and destroy its * object, if it has one. */ - vinvalbuf(vp, V_SAVE, td, 0, 0); + vinvalbuf(vp, V_SAVE, 0, 0); if ((object = vp->v_object) != NULL) { if (object->ref_count == 0) { @@ -1062,9 +1061,9 @@ vclean(struct vnode *vp, int flags, struct thread *td) if (active && (flags & DOCLOSE)) { while ((n = vp->v_opencount) != 0) { if (vp->v_writecount) - VOP_CLOSE(vp, FWRITE|FNONBLOCK, td); + VOP_CLOSE(vp, FWRITE|FNONBLOCK); else - VOP_CLOSE(vp, FNONBLOCK, td); + VOP_CLOSE(vp, FNONBLOCK); if (vp->v_opencount == n) { printf("Warning: unable to force-close" " vnode %p\n", vp); @@ -1078,13 +1077,13 @@ vclean(struct vnode *vp, int flags, struct thread *td) */ if ((vp->v_flag & VINACTIVE) == 0) { vp->v_flag |= VINACTIVE; - VOP_INACTIVE(vp, td); + VOP_INACTIVE(vp); } /* * Reclaim the vnode. */ - if (VOP_RECLAIM(vp, td)) + if (VOP_RECLAIM(vp)) panic("vclean: cannot reclaim"); /* @@ -1156,7 +1155,7 @@ vop_stdrevoke(struct vop_revoke_args *ap) * 0 otherwise. */ int -vrecycle(struct vnode *vp, struct thread *td) +vrecycle(struct vnode *vp) { if (vp->v_usecount == 1) { vgone(vp); @@ -1195,7 +1194,7 @@ vgone(struct vnode *vp) * Clean out the filesystem specific data and set the VRECLAIMED * bit. Also deactivate the vnode if necessary. */ - vclean(vp, DOCLOSE, curthread); + vclean(vp, DOCLOSE); /* * Delete from old mount point vnode list, if on one. @@ -1854,10 +1853,12 @@ vfs_msync_scan2(struct mount *mp, struct vnode *vp, void *data) * to avoid race conditions.) */ int -vn_pollrecord(struct vnode *vp, struct thread *td, int events) +vn_pollrecord(struct vnode *vp, int events) { lwkt_tokref ilock; + KKASSERT(curthread->td_proc != NULL); + lwkt_gettoken(&ilock, &vp->v_pollinfo.vpi_token); if (vp->v_pollinfo.vpi_revents & events) { /* @@ -1874,7 +1875,7 @@ vn_pollrecord(struct vnode *vp, struct thread *td, int events) return events; } vp->v_pollinfo.vpi_events |= events; - selrecord(td, &vp->v_pollinfo.vpi_selinfo); + selrecord(curthread, &vp->v_pollinfo.vpi_selinfo); lwkt_reltoken(&ilock); return 0; } diff --git a/sys/kern/vfs_sync.c b/sys/kern/vfs_sync.c index f9d21ae449..c931e67961 100644 --- a/sys/kern/vfs_sync.c +++ b/sys/kern/vfs_sync.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_sync.c,v 1.9 2006/05/05 21:27:53 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_sync.c,v 1.10 2006/05/06 02:43:12 dillon Exp $ */ /* @@ -210,8 +210,8 @@ sched_sync(void) crit_exit(); while ((vp = LIST_FIRST(slp)) != NULL) { - if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT, td) == 0) { - VOP_FSYNC(vp, MNT_LAZY, td); + if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { + VOP_FSYNC(vp, MNT_LAZY); vput(vp); } crit_enter(); @@ -379,7 +379,6 @@ sync_fsync(struct vop_fsync_args *ap) { struct vnode *syncvp = ap->a_vp; struct mount *mp = syncvp->v_mount; - struct thread *td = ap->a_td; int asyncflag; /* @@ -408,7 +407,7 @@ sync_fsync(struct vop_fsync_args *ap) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; /* ZZZ hack */ vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_LAZY, td); + VFS_SYNC(mp, MNT_LAZY); if (asyncflag) mp->mnt_flag |= MNT_ASYNC; } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 04dde51ec7..553a41f5c9 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.85 2006/05/05 21:27:53 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_syscalls.c,v 1.86 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -160,7 +160,7 @@ mount(struct mount_args *uap) * now we have the locked ref'd ncp and unreferenced vnode. */ vp = ncp->nc_vp; - if ((error = vget(vp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(vp, LK_EXCLUSIVE)) != 0) { cache_put(ncp); return (error); } @@ -220,14 +220,14 @@ mount(struct mount_args *uap) * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. */ - if ((error = VOP_GETATTR(vp, &va, td)) || + if ((error = VOP_GETATTR(vp, &va)) || (va.va_uid != p->p_ucred->cr_uid && (error = suser(td)))) { cache_drop(ncp); vput(vp); return (error); } - if ((error = vinvalbuf(vp, V_SAVE, td, 0, 0)) != 0) { + if ((error = vinvalbuf(vp, V_SAVE, 0, 0)) != 0) { cache_drop(ncp); vput(vp); return (error); @@ -552,7 +552,7 @@ dounmount(struct mount *mp, int flags, struct thread *td) if (mp->mnt_syncer != NULL) vrele(mp->mnt_syncer); if (((mp->mnt_flag & MNT_RDONLY) || - (error = VFS_SYNC(mp, MNT_WAIT, td)) == 0) || + (error = VFS_SYNC(mp, MNT_WAIT)) == 0) || (flags & MNT_FORCE)) error = VFS_UNMOUNT(mp, flags, td); if (error) { @@ -636,7 +636,7 @@ sync_callback(struct mount *mp, void *data __unused) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_NOWAIT, curthread); + VFS_SYNC(mp, MNT_NOWAIT); mp->mnt_flag |= asyncflag; } return(0); @@ -1042,7 +1042,7 @@ fchdir(struct fchdir_args *uap) if (vp->v_type != VDIR || fp->f_ncp == NULL) error = ENOTDIR; else - error = VOP_ACCESS(vp, VEXEC, p->p_ucred, td); + error = VOP_ACCESS(vp, VEXEC, p->p_ucred); if (error) { vput(vp); return (error); @@ -1054,7 +1054,7 @@ fchdir(struct fchdir_args *uap) cache_unlock(nct); /* leave ref intact */ vput(vp); vp = nct->nc_vp; - error = vget(vp, LK_SHARED, td); + error = vget(vp, LK_SHARED); KKASSERT(error == 0); cache_drop(ncp); ncp = nct; @@ -1089,7 +1089,7 @@ kern_chdir(struct nlookupdata *nd) return (error); if ((vp = nd->nl_ncp->nc_vp) == NULL) return (ENOENT); - if ((error = vget(vp, LK_SHARED, td)) != 0) + if ((error = vget(vp, LK_SHARED)) != 0) return (error); error = checkvp_chdir(vp, td); @@ -1196,7 +1196,7 @@ kern_chroot(struct namecache *ncp) if ((vp = ncp->nc_vp) == NULL) return (ENOENT); - if ((error = vget(vp, LK_SHARED, td)) != 0) + if ((error = vget(vp, LK_SHARED)) != 0) return (error); /* @@ -1260,7 +1260,7 @@ checkvp_chdir(struct vnode *vp, struct thread *td) if (vp->v_type != VDIR) error = ENOTDIR; else - error = VOP_ACCESS(vp, VEXEC, td->td_proc->p_ucred, td); + error = VOP_ACCESS(vp, VEXEC, td->td_proc->p_ucred); return (error); } @@ -1364,7 +1364,7 @@ kern_open(struct nlookupdata *nd, int oflags, int mode, int *res) KASSERT(fdp->fd_files[indx].fp != fp, ("Open file descriptor lost all refs")); vrele(vp); - fo_close(fp, td); + fo_close(fp); fdrop(fp, td); *res = indx; return 0; @@ -1607,7 +1607,7 @@ can_hardlink(struct vnode *vp, struct thread *td, struct ucred *cred) * same user or group. Note that any group is allowed if * the file is owned by the caller. */ - error = VOP_GETATTR(vp, &va, td); + error = VOP_GETATTR(vp, &va); if (error != 0) return (error); @@ -1643,7 +1643,7 @@ kern_link(struct nlookupdata *nd, struct nlookupdata *linknd) KKASSERT(vp != NULL); if (vp->v_type == VDIR) return (EPERM); /* POSIX */ - if ((error = vget(vp, LK_EXCLUSIVE, td)) != 0) + if ((error = vget(vp, LK_EXCLUSIVE)) != 0) return (error); /* @@ -1825,7 +1825,7 @@ kern_lseek(int fd, off_t offset, int whence, off_t *res) fp->f_offset += offset; break; case L_XTND: - error=VOP_GETATTR((struct vnode *)fp->f_data, &vattr, td); + error=VOP_GETATTR((struct vnode *)fp->f_data, &vattr); if (error) return (error); fp->f_offset = offset + vattr.va_size; @@ -1859,7 +1859,6 @@ lseek(struct lseek_args *uap) int kern_access(struct nlookupdata *nd, int aflags) { - struct thread *td = curthread; struct vnode *vp; int error, flags; @@ -1880,7 +1879,7 @@ retry: if (aflags & X_OK) flags |= VEXEC; if ((flags & VWRITE) == 0 || (error = vn_writechk(vp)) == 0) - error = VOP_ACCESS(vp, flags, nd->nl_cred, td); + error = VOP_ACCESS(vp, flags, nd->nl_cred); /* * If the file handle is stale we have to re-resolve the @@ -1932,9 +1931,9 @@ again: return (ENOENT); td = curthread; - if ((error = vget(vp, LK_SHARED, td)) != 0) + if ((error = vget(vp, LK_SHARED)) != 0) return (error); - error = vn_stat(vp, st, td); + error = vn_stat(vp, st, nd->nl_cred); /* * If the file handle is stale we have to re-resolve the entry. This @@ -2104,10 +2103,10 @@ setfflags(struct vnode *vp, int flags) * note: vget is required for any operation that might mod the vnode * so VINACTIVE is properly cleared. */ - if ((error = vget(vp, LK_EXCLUSIVE, td)) == 0) { + if ((error = vget(vp, LK_EXCLUSIVE)) == 0) { VATTR_NULL(&vattr); vattr.va_flags = flags; - error = VOP_SETATTR(vp, &vattr, p->p_ucred, td); + error = VOP_SETATTR(vp, &vattr, p->p_ucred); vput(vp); } return (error); @@ -2172,10 +2171,10 @@ setfmode(struct vnode *vp, int mode) * note: vget is required for any operation that might mod the vnode * so VINACTIVE is properly cleared. */ - if ((error = vget(vp, LK_EXCLUSIVE, td)) == 0) { + if ((error = vget(vp, LK_EXCLUSIVE)) == 0) { VATTR_NULL(&vattr); vattr.va_mode = mode & ALLPERMS; - error = VOP_SETATTR(vp, &vattr, p->p_ucred, td); + error = VOP_SETATTR(vp, &vattr, p->p_ucred); vput(vp); } return error; @@ -2266,11 +2265,11 @@ setfown(struct vnode *vp, uid_t uid, gid_t gid) * note: vget is required for any operation that might mod the vnode * so VINACTIVE is properly cleared. */ - if ((error = vget(vp, LK_EXCLUSIVE, td)) == 0) { + if ((error = vget(vp, LK_EXCLUSIVE)) == 0) { VATTR_NULL(&vattr); vattr.va_uid = uid; vattr.va_gid = gid; - error = VOP_SETATTR(vp, &vattr, p->p_ucred, td); + error = VOP_SETATTR(vp, &vattr, p->p_ucred); vput(vp); } return error; @@ -2376,13 +2375,13 @@ setutimes(struct vnode *vp, const struct timespec *ts, int nullflag) * note: vget is required for any operation that might mod the vnode * so VINACTIVE is properly cleared. */ - if ((error = vget(vp, LK_EXCLUSIVE, td)) == 0) { + if ((error = vget(vp, LK_EXCLUSIVE)) == 0) { VATTR_NULL(&vattr); vattr.va_atime = ts[0]; vattr.va_mtime = ts[1]; if (nullflag) vattr.va_vaflags |= VA_UTIMES_NULL; - error = VOP_SETATTR(vp, &vattr, p->p_ucred, td); + error = VOP_SETATTR(vp, &vattr, p->p_ucred); vput(vp); } return error; @@ -2517,10 +2516,10 @@ kern_truncate(struct nlookupdata *nd, off_t length) if (vp->v_type == VDIR) { error = EISDIR; } else if ((error = vn_writechk(vp)) == 0 && - (error = VOP_ACCESS(vp, VWRITE, nd->nl_cred, nd->nl_td)) == 0) { + (error = VOP_ACCESS(vp, VWRITE, nd->nl_cred)) == 0) { VATTR_NULL(&vattr); vattr.va_size = length; - error = VOP_SETATTR(vp, &vattr, nd->nl_cred, nd->nl_td); + error = VOP_SETATTR(vp, &vattr, nd->nl_cred); } vput(vp); return (error); @@ -2567,7 +2566,7 @@ kern_ftruncate(int fd, off_t length) else if ((error = vn_writechk(vp)) == 0) { VATTR_NULL(&vattr); vattr.va_size = length; - error = VOP_SETATTR(vp, &vattr, fp->f_cred, td); + error = VOP_SETATTR(vp, &vattr, fp->f_cred); } VOP_UNLOCK(vp, 0); return (error); @@ -2610,7 +2609,7 @@ fsync(struct fsync_args *uap) 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 && + if ((error = VOP_FSYNC(vp, MNT_WAIT)) == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) && bioops.io_fsync) error = (*bioops.io_fsync)(vp); @@ -2996,7 +2995,6 @@ umask(struct umask_args *uap) int revoke(struct revoke_args *uap) { - struct thread *td = curthread; struct nlookupdata nd; struct vattr vattr; struct vnode *vp; @@ -3015,7 +3013,7 @@ revoke(struct revoke_args *uap) if (vp->v_type != VCHR && vp->v_type != VBLK) error = EINVAL; if (error == 0) - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error == 0 && cred->cr_uid != vattr.va_uid) error = suser_cred(cred, PRISON_ROOT); if (error == 0 && count_udev(vp->v_udev) > 0) { @@ -3165,7 +3163,7 @@ fhopen(struct fhopen_args *uap) if (fmode & FREAD) mode |= VREAD; if (mode) { - error = VOP_ACCESS(vp, mode, p->p_ucred, td); + error = VOP_ACCESS(vp, mode, p->p_ucred); if (error) goto bad; } @@ -3174,7 +3172,7 @@ fhopen(struct fhopen_args *uap) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */ VATTR_NULL(vap); vap->va_size = 0; - error = VOP_SETATTR(vp, vap, p->p_ucred, td); + error = VOP_SETATTR(vp, vap, p->p_ucred); if (error) goto bad; } @@ -3190,7 +3188,7 @@ fhopen(struct fhopen_args *uap) goto bad; fp = nfp; - error = VOP_OPEN(vp, fmode, p->p_ucred, fp, td); + error = VOP_OPEN(vp, fmode, p->p_ucred, fp); if (error) { /* * setting f_ops this way prevents VOP_CLOSE from being @@ -3294,7 +3292,7 @@ fhstat(struct fhstat_args *uap) return (ESTALE); if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp))) return (error); - error = vn_stat(vp, &sb, td); + error = vn_stat(vp, &sb, td->td_proc->p_ucred); vput(vp); if (error) return (error); @@ -3457,7 +3455,7 @@ extattr_set_file(struct extattr_set_file_args *uap) iov++; } cnt = auio.uio_resid; - error = VOP_SETEXTATTR(vp, attrname, &auio, nd.nl_cred, nd.nl_td); + error = VOP_SETEXTATTR(vp, attrname, &auio, nd.nl_cred); cnt -= auio.uio_resid; uap->sysmsg_result = cnt; done: @@ -3534,7 +3532,7 @@ extattr_get_file(struct extattr_get_file_args *uap) iov++; } cnt = auio.uio_resid; - error = VOP_GETEXTATTR(vp, attrname, &auio, nd.nl_cred, nd.nl_td); + error = VOP_GETEXTATTR(vp, attrname, &auio, nd.nl_cred); cnt -= auio.uio_resid; uap->sysmsg_result = cnt; done: @@ -3572,7 +3570,7 @@ extattr_delete_file(struct extattr_delete_file_args *uap) return (error); } - error = VOP_SETEXTATTR(vp, attrname, NULL, nd.nl_cred, nd.nl_td); + error = VOP_SETEXTATTR(vp, attrname, NULL, nd.nl_cred); vput(vp); nlookup_done(&nd); return(error); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 497a622fd0..7cc4d6c11b 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.38 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_vnops.c,v 1.39 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -55,21 +55,20 @@ #include #include -static int vn_closefile (struct file *fp, struct thread *td); -static int vn_ioctl (struct file *fp, u_long com, caddr_t data, - struct thread *td); +static int vn_closefile (struct file *fp); +static int vn_ioctl (struct file *fp, u_long com, caddr_t data, + struct ucred *cred); static int vn_read (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); static int svn_read (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); -static int vn_poll (struct file *fp, int events, struct ucred *cred, - struct thread *td); + struct ucred *cred, int flags); +static int vn_poll (struct file *fp, int events, struct ucred *cred); static int vn_kqfilter (struct file *fp, struct knote *kn); -static int vn_statfile (struct file *fp, struct stat *sb, struct thread *td); +static int vn_statfile (struct file *fp, struct stat *sb, struct ucred *cred); static int vn_write (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); static int svn_write (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td); + struct ucred *cred, int flags); struct fileops vnode_fileops = { NULL, /* port */ @@ -120,7 +119,6 @@ int vn_open(struct nlookupdata *nd, struct file *fp, int fmode, int cmode) { struct vnode *vp; - struct thread *td = nd->nl_td; struct ucred *cred = nd->nl_cred; struct vattr vat; struct vattr *vap = &vat; @@ -238,7 +236,7 @@ again: if (fmode & FREAD) mode |= VREAD; if (mode) { - error = VOP_ACCESS(vp, mode, cred, td); + error = VOP_ACCESS(vp, mode, cred); if (error) { /* * Special stale handling, re-resolve the @@ -261,7 +259,7 @@ again: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */ VATTR_NULL(vap); vap->va_size = 0; - error = VOP_SETATTR(vp, vap, cred, td); + error = VOP_SETATTR(vp, vap, cred); if (error) goto bad; } @@ -290,7 +288,7 @@ again: nd->nl_ncp = NULL; } - error = VOP_OPEN(vp, fmode, cred, fp, td); + error = VOP_OPEN(vp, fmode, cred, fp); if (error) { /* * setting f_ops to &badfileops will prevent the descriptor @@ -354,12 +352,12 @@ vn_writechk(vp) * Vnode close call */ int -vn_close(struct vnode *vp, int flags, struct thread *td) +vn_close(struct vnode *vp, int flags) { int error; if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) == 0) { - error = VOP_CLOSE(vp, flags, td); + error = VOP_CLOSE(vp, flags); VOP_UNLOCK(vp, 0); } vrele(vp); @@ -403,17 +401,9 @@ sequential_heuristic(struct uio *uio, struct file *fp) * Package up an I/O request on a vnode into a uio and do it. */ int -vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) - enum uio_rw rw; - struct vnode *vp; - caddr_t base; - int len; - off_t offset; - enum uio_seg segflg; - int ioflg; - struct ucred *cred; - int *aresid; - struct thread *td; +vn_rdwr(enum uio_rw rw, struct vnode *vp, caddr_t base, int len, + off_t offset, enum uio_seg segflg, int ioflg, + struct ucred *cred, int *aresid) { struct uio auio; struct iovec aiov; @@ -429,7 +419,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) auio.uio_offset = offset; auio.uio_segflg = segflg; auio.uio_rw = rw; - auio.uio_td = td; + auio.uio_td = curthread; if (rw == UIO_READ) { error = VOP_READ(vp, &auio, ioflg, cred); } else { @@ -454,17 +444,9 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) * core'ing the same binary, or unrelated processes scanning the directory). */ int -vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) - enum uio_rw rw; - struct vnode *vp; - caddr_t base; - int len; - off_t offset; - enum uio_seg segflg; - int ioflg; - struct ucred *cred; - int *aresid; - struct thread *td; +vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, caddr_t base, int len, + off_t offset, enum uio_seg segflg, int ioflg, + struct ucred *cred, int *aresid) { int error = 0; @@ -484,7 +466,7 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) if (rw != UIO_READ && vp->v_type == VREG) bwillwrite(); error = vn_rdwr(rw, vp, base, chunk, offset, segflg, - ioflg, cred, aresid, td); + ioflg, cred, aresid); len -= chunk; /* aresid calc already includes length */ if (error) break; @@ -501,17 +483,13 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, td) * File table vnode read routine. */ static int -vn_read(fp, uio, cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *cred; - struct thread *td; - int flags; +vn_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct vnode *vp; int error, ioflag; - KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); + KASSERT(uio->uio_td == curthread, + ("uio_td %p is not td %p", uio->uio_td, curthread)); vp = (struct vnode *)fp->f_data; ioflag = 0; if (fp->f_flag & FNONBLOCK) @@ -539,19 +517,15 @@ vn_read(fp, uio, cred, flags, td) * filesystems just route to specfs and can make this optimization. */ static int -svn_read(fp, uio, cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *cred; - struct thread *td; - int flags; +svn_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct vnode *vp; int ioflag; int error; dev_t dev; - KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); + KASSERT(uio->uio_td == curthread, + ("uio_td %p is not td %p", uio->uio_td, curthread)); vp = (struct vnode *)fp->f_data; if (vp == NULL || vp->v_type == VBAD) @@ -586,18 +560,13 @@ svn_read(fp, uio, cred, flags, td) * File table vnode write routine. */ static int -vn_write(fp, uio, cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *cred; - struct thread *td; - int flags; +vn_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct vnode *vp; int error, ioflag; - KASSERT(uio->uio_td == td, ("uio_procp %p is not p %p", - uio->uio_td, td)); + KASSERT(uio->uio_td == curthread, + ("uio_procp %p is not p %p", uio->uio_td, curthread)); vp = (struct vnode *)fp->f_data; if (vp->v_type == VREG) bwillwrite(); @@ -631,20 +600,15 @@ vn_write(fp, uio, cred, flags, td) * filesystems just route to specfs and can make this optimization. */ static int -svn_write(fp, uio, cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *cred; - struct thread *td; - int flags; +svn_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags) { struct vnode *vp; int ioflag; int error; dev_t dev; - KASSERT(uio->uio_td == td, ("uio_procp %p is not p %p", - uio->uio_td, td)); + KASSERT(uio->uio_td == curthread, + ("uio_procp %p is not p %p", uio->uio_td, curthread)); vp = (struct vnode *)fp->f_data; if (vp == NULL || vp->v_type == VBAD) @@ -686,15 +650,15 @@ svn_write(fp, uio, cred, flags, td) * File table vnode stat routine. */ static int -vn_statfile(struct file *fp, struct stat *sb, struct thread *td) +vn_statfile(struct file *fp, struct stat *sb, struct ucred *cred) { struct vnode *vp = (struct vnode *)fp->f_data; - return vn_stat(vp, sb, td); + return vn_stat(vp, sb, cred); } int -vn_stat(struct vnode *vp, struct stat *sb, struct thread *td) +vn_stat(struct vnode *vp, struct stat *sb, struct ucred *cred) { struct vattr vattr; struct vattr *vap; @@ -703,7 +667,7 @@ vn_stat(struct vnode *vp, struct stat *sb, struct thread *td) dev_t dev; vap = &vattr; - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); if (error) return (error); @@ -810,7 +774,7 @@ vn_stat(struct vnode *vp, struct stat *sb, struct thread *td) } sb->st_flags = vap->va_flags; - if (suser(td)) + if (suser_cred(cred, 0)) sb->st_gen = 0; else sb->st_gen = vap->va_gen; @@ -829,22 +793,18 @@ vn_stat(struct vnode *vp, struct stat *sb, struct thread *td) * File table vnode ioctl routine. */ static int -vn_ioctl(struct file *fp, u_long com, caddr_t data, struct thread *td) +vn_ioctl(struct file *fp, u_long com, caddr_t data, struct ucred *ucred) { struct vnode *vp = ((struct vnode *)fp->f_data); struct vnode *ovp; - struct ucred *ucred; struct vattr vattr; int error; - KKASSERT(td->td_proc != NULL); - ucred = td->td_proc->p_ucred; - switch (vp->v_type) { case VREG: case VDIR: if (com == FIONREAD) { - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); *(int *)data = vattr.va_size - fp->f_offset; @@ -866,10 +826,15 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct thread *td) *(int *)data = dev_dflags(vp->v_rdev) & D_TYPEMASK; return (0); } - error = VOP_IOCTL(vp, com, data, fp->f_flag, ucred, td); + error = VOP_IOCTL(vp, com, data, fp->f_flag, ucred); if (error == 0 && com == TIOCSCTTY) { - struct session *sess = td->td_proc->p_session; + struct proc *p = curthread->td_proc; + struct session *sess; + + if (p == NULL) + return (ENOTTY); + sess = p->p_session; /* Do nothing if reassigning same control tty */ if (sess->s_ttyvp == vp) return (0); @@ -889,9 +854,9 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct thread *td) * File table vnode poll routine. */ static int -vn_poll(struct file *fp, int events, struct ucred *cred, struct thread *td) +vn_poll(struct file *fp, int events, struct ucred *cred) { - return (VOP_POLL(((struct vnode *)fp->f_data), events, cred, td)); + return (VOP_POLL(((struct vnode *)fp->f_data), events, cred)); } /* @@ -933,12 +898,12 @@ debug_vn_lock(struct vnode *vp, int flags, const char *filename, int line) * File table vnode close routine. */ static int -vn_closefile(struct file *fp, struct thread *td) +vn_closefile(struct file *fp) { int err; fp->f_ops = &badfileops; - err = vn_close(((struct vnode *)fp->f_data), fp->f_flag, td); + err = vn_close(((struct vnode *)fp->f_data), fp->f_flag); return(err); } diff --git a/sys/kern/vfs_vopops.c b/sys/kern/vfs_vopops.c index 36e14dfb7e..0afbec0db7 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.24 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.25 2006/05/06 02:43:12 dillon Exp $ */ #include @@ -390,7 +390,7 @@ vop_old_mknod(struct vop_ops *ops, struct vnode *dvp, int vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred, - struct file *fp, struct thread *td) + struct file *fp) { struct vop_open_args ap; int error; @@ -401,14 +401,13 @@ vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred, ap.a_fp = fp; ap.a_mode = mode; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_open); return(error); } int -vop_close(struct vop_ops *ops, struct vnode *vp, int fflag, struct thread *td) +vop_close(struct vop_ops *ops, struct vnode *vp, int fflag) { struct vop_close_args ap; int error; @@ -417,15 +416,13 @@ vop_close(struct vop_ops *ops, struct vnode *vp, int fflag, struct thread *td) ap.a_head.a_ops = ops; ap.a_vp = vp; ap.a_fflag = fflag; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_close); return(error); } int -vop_access(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred, - struct thread *td) +vop_access(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred) { struct vop_access_args ap; int error; @@ -435,15 +432,13 @@ vop_access(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred, ap.a_vp = vp; ap.a_mode = mode; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_access); return(error); } int -vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, - struct thread *td) +vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap) { struct vop_getattr_args ap; struct namecache *ncp; @@ -453,7 +448,6 @@ vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, ap.a_head.a_ops = ops; ap.a_vp = vp; ap.a_vap = vap; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_getattr); if ((ops->vv_flags & VVF_SUPPORTS_FSMID) == 0) { @@ -470,7 +464,7 @@ vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, int vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, - struct ucred *cred, struct thread *td) + struct ucred *cred) { struct vop_setattr_args ap; int error; @@ -480,7 +474,6 @@ vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, ap.a_vp = vp; ap.a_vap = vap; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_setattr); if (error == 0) @@ -528,8 +521,7 @@ vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag, int vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, caddr_t data, - int fflag, struct ucred *cred, - struct thread *td) + int fflag, struct ucred *cred) { struct vop_ioctl_args ap; int error; @@ -541,15 +533,13 @@ vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, caddr_t data, ap.a_data = data; ap.a_fflag = fflag; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_ioctl); return(error); } int -vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred, - struct thread *td) +vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred) { struct vop_poll_args ap; int error; @@ -559,7 +549,6 @@ vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred, ap.a_vp = vp; ap.a_events = events; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_poll); return(error); @@ -596,8 +585,7 @@ vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags) } int -vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred, - struct thread *td) +vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred) { struct vop_mmap_args ap; int error; @@ -607,14 +595,13 @@ vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred, ap.a_vp = vp; ap.a_fflags = fflags; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_mmap); return(error); } int -vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, struct thread *td) +vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor) { struct vop_fsync_args ap; int error; @@ -623,7 +610,6 @@ vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, struct thread *td) ap.a_head.a_ops = ops; ap.a_vp = vp; ap.a_waitfor = waitfor; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_fsync); return(error); @@ -777,7 +763,7 @@ vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio, } int -vop_inactive(struct vop_ops *ops, struct vnode *vp, struct thread *td) +vop_inactive(struct vop_ops *ops, struct vnode *vp) { struct vop_inactive_args ap; int error; @@ -785,14 +771,13 @@ vop_inactive(struct vop_ops *ops, struct vnode *vp, struct thread *td) ap.a_head.a_desc = &vop_inactive_desc; ap.a_head.a_ops = ops; ap.a_vp = vp; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_inactive); return(error); } int -vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td) +vop_reclaim(struct vop_ops *ops, struct vnode *vp) { struct vop_reclaim_args ap; int error; @@ -800,7 +785,6 @@ vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td) ap.a_head.a_desc = &vop_reclaim_desc; ap.a_head.a_ops = ops; ap.a_vp = vp; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_reclaim); return(error); @@ -1019,7 +1003,7 @@ vop_freeblks(struct vop_ops *ops, struct vnode *vp, off_t offset, int length) int vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, - struct acl *aclp, struct ucred *cred, struct thread *td) + struct acl *aclp, struct ucred *cred) { struct vop_getacl_args ap; int error; @@ -1030,7 +1014,6 @@ vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, ap.a_type = type; ap.a_aclp = aclp; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_getacl); return(error); @@ -1038,7 +1021,7 @@ vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, int vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, - struct acl *aclp, struct ucred *cred, struct thread *td) + struct acl *aclp, struct ucred *cred) { struct vop_setacl_args ap; int error; @@ -1049,7 +1032,6 @@ vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, ap.a_type = type; ap.a_aclp = aclp; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_setacl); if (error == 0) @@ -1059,7 +1041,7 @@ vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, int vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type, - struct acl *aclp, struct ucred *cred, struct thread *td) + struct acl *aclp, struct ucred *cred) { struct vop_aclcheck_args ap; int error; @@ -1070,7 +1052,6 @@ vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type, ap.a_type = type; ap.a_aclp = aclp; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_aclcheck); return(error); @@ -1078,7 +1059,7 @@ vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type, int vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name, - struct uio *uio, struct ucred *cred, struct thread *td) + struct uio *uio, struct ucred *cred) { struct vop_getextattr_args ap; int error; @@ -1089,7 +1070,6 @@ vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name, ap.a_name = name; ap.a_uio = uio; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_getextattr); return(error); @@ -1097,7 +1077,7 @@ vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name, int vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name, - struct uio *uio, struct ucred *cred, struct thread *td) + struct uio *uio, struct ucred *cred) { struct vop_setextattr_args ap; int error; @@ -1108,7 +1088,6 @@ vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name, ap.a_name = name; ap.a_uio = uio; ap.a_cred = cred; - ap.a_td = td; DO_OPS(ops, error, &ap, vop_setextattr); if (error == 0) diff --git a/sys/net/if.c b/sys/net/if.c index 5cb809ee34..3f253f467e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -32,7 +32,7 @@ * * @(#)if.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/net/if.c,v 1.185 2004/03/13 02:35:03 brooks Exp $ - * $DragonFly: src/sys/net/if.c,v 1.44 2006/01/31 19:05:35 dillon Exp $ + * $DragonFly: src/sys/net/if.c,v 1.45 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_compat.h" @@ -101,7 +101,7 @@ static int ifq_classic_request(struct ifaltq *, int, void *); static void if_attachdomain(void *); static void if_attachdomain1(struct ifnet *); -static int ifconf (u_long, caddr_t, struct thread *); +static int ifconf (u_long, caddr_t, struct ucred *); static void ifinit (void *); static void if_slowtimo (void *); static void link_rtrequest (int, struct rtentry *, struct rt_addrinfo *); @@ -1060,7 +1060,7 @@ if_withname(struct sockaddr *sa) * Interface ioctls. */ int -ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) +ifioctl(struct socket *so, u_long cmd, caddr_t data, struct ucred *cred) { struct ifnet *ifp; struct ifreq *ifr; @@ -1077,14 +1077,14 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) case SIOCGIFCONF: case OSIOCGIFCONF: - return (ifconf(cmd, data, td)); + return (ifconf(cmd, data, cred)); } ifr = (struct ifreq *)data; switch (cmd) { case SIOCIFCREATE: case SIOCIFDESTROY: - if ((error = suser(td)) != 0) + if ((error = suser_cred(cred, 0)) != 0) return (error); return ((cmd == SIOCIFCREATE) ? if_clone_create(ifr->ifr_name, sizeof(ifr->ifr_name)) : @@ -1122,7 +1122,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) break; case SIOCSIFFLAGS: - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); new_flags = (ifr->ifr_flags & 0xffff) | @@ -1161,25 +1161,25 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) } if (ifp->if_ioctl) { lwkt_serialize_enter(ifp->if_serializer); - ifp->if_ioctl(ifp, cmd, data, td->td_proc->p_ucred); + ifp->if_ioctl(ifp, cmd, data, cred); lwkt_serialize_exit(ifp->if_serializer); } getmicrotime(&ifp->if_lastchange); break; case SIOCSIFCAP: - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); if (ifr->ifr_reqcap & ~ifp->if_capabilities) return (EINVAL); lwkt_serialize_enter(ifp->if_serializer); - ifp->if_ioctl(ifp, cmd, data, td->td_proc->p_ucred); + ifp->if_ioctl(ifp, cmd, data, cred); lwkt_serialize_exit(ifp->if_serializer); break; case SIOCSIFNAME: - error = suser(td); + error = suser_cred(cred, 0); if (error != 0) return (error); error = copyinstr(ifr->ifr_data, new_name, IFNAMSIZ, NULL); @@ -1225,7 +1225,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) break; case SIOCSIFMETRIC: - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); ifp->if_metric = ifr->ifr_metric; @@ -1233,13 +1233,13 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) break; case SIOCSIFPHYS: - error = suser(td); + error = suser_cred(cred, 0); if (error) return error; if (!ifp->if_ioctl) return EOPNOTSUPP; lwkt_serialize_enter(ifp->if_serializer); - error = ifp->if_ioctl(ifp, cmd, data, td->td_proc->p_ucred); + error = ifp->if_ioctl(ifp, cmd, data, cred); lwkt_serialize_exit(ifp->if_serializer); if (error == 0) getmicrotime(&ifp->if_lastchange); @@ -1249,7 +1249,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) { u_long oldmtu = ifp->if_mtu; - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); if (ifp->if_ioctl == NULL) @@ -1257,7 +1257,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) if (ifr->ifr_mtu < IF_MINMTU || ifr->ifr_mtu > IF_MAXMTU) return (EINVAL); lwkt_serialize_enter(ifp->if_serializer); - error = ifp->if_ioctl(ifp, cmd, data, td->td_proc->p_ucred); + error = ifp->if_ioctl(ifp, cmd, data, cred); lwkt_serialize_exit(ifp->if_serializer); if (error == 0) { getmicrotime(&ifp->if_lastchange); @@ -1276,7 +1276,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) case SIOCADDMULTI: case SIOCDELMULTI: - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); @@ -1306,13 +1306,13 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) case SIOCSLIFPHYADDR: case SIOCSIFMEDIA: case SIOCSIFGENERIC: - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); if (ifp->if_ioctl == 0) return (EOPNOTSUPP); lwkt_serialize_enter(ifp->if_serializer); - error = ifp->if_ioctl(ifp, cmd, data, td->td_proc->p_ucred); + error = ifp->if_ioctl(ifp, cmd, data, cred); lwkt_serialize_exit(ifp->if_serializer); if (error == 0) getmicrotime(&ifp->if_lastchange); @@ -1330,12 +1330,12 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); lwkt_serialize_enter(ifp->if_serializer); - error = ifp->if_ioctl(ifp, cmd, data, td->td_proc->p_ucred); + error = ifp->if_ioctl(ifp, cmd, data, cred); lwkt_serialize_exit(ifp->if_serializer); return (error); case SIOCSIFLLADDR: - error = suser(td); + error = suser_cred(cred, 0); if (error) return (error); return if_setlladdr(ifp, @@ -1346,7 +1346,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) if (so->so_proto == 0) return (EOPNOTSUPP); #ifndef COMPAT_43 - error = so_pru_control(so, cmd, data, ifp, td); + error = so_pru_control(so, cmd, data, ifp); #else { int ocmd = cmd; @@ -1384,7 +1384,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) case OSIOCGIFNETMASK: cmd = SIOCGIFNETMASK; } - error = so_pru_control(so, cmd, data, ifp, td); + error = so_pru_control(so, cmd, data, ifp); switch (ocmd) { case OSIOCGIFADDR: @@ -1471,7 +1471,7 @@ ifpromisc(struct ifnet *ifp, int pswitch) * other information. */ static int -ifconf(u_long cmd, caddr_t data, struct thread *td) +ifconf(u_long cmd, caddr_t data, struct ucred *cred) { struct ifconf *ifc = (struct ifconf *)data; struct ifnet *ifp; @@ -1503,8 +1503,8 @@ ifconf(u_long cmd, caddr_t data, struct thread *td) if (space <= sizeof ifr) break; sa = ifa->ifa_addr; - if (td->td_proc->p_ucred->cr_prison && - prison_if(td, sa)) + if (cred->cr_prison && + prison_if(cred, sa)) continue; addrs++; #ifdef COMPAT_43 diff --git a/sys/net/if.h b/sys/net/if.h index c4b48337f5..aca250ec95 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -32,7 +32,7 @@ * * @(#)if.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if.h,v 1.58.2.9 2002/08/30 14:23:38 sobomax Exp $ - * $DragonFly: src/sys/net/if.h,v 1.14 2005/12/21 16:37:15 corecode Exp $ + * $DragonFly: src/sys/net/if.h,v 1.15 2006/05/06 02:43:12 dillon Exp $ */ #ifndef _NET_IF_H_ @@ -346,8 +346,9 @@ __END_DECLS #ifdef _KERNEL struct thread; +struct ucred; -int prison_if (struct thread *td, struct sockaddr *sa); +int prison_if (struct ucred *cred, struct sockaddr *sa); /* XXX - this should go away soon. */ #include diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 3ad3aba4f2..04a4b9a309 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -32,7 +32,7 @@ * * From: @(#)if.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_var.h,v 1.18.2.16 2003/04/15 18:11:19 fjoe Exp $ - * $DragonFly: src/sys/net/if_var.h,v 1.33 2005/12/21 16:37:15 corecode Exp $ + * $DragonFly: src/sys/net/if_var.h,v 1.34 2006/05/06 02:43:12 dillon Exp $ */ #ifndef _NET_IF_VAR_H_ @@ -466,7 +466,7 @@ int if_setlladdr(struct ifnet *, const u_char *, int); void if_unroute(struct ifnet *, int flag, int fam); void if_up(struct ifnet *); /*void ifinit(void);*/ /* declared in systm.h for main() */ -int ifioctl(struct socket *, u_long, caddr_t, struct thread *); +int ifioctl(struct socket *, u_long, caddr_t, struct ucred *); int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); struct ifnet *if_withname(struct sockaddr *); diff --git a/sys/net/route.c b/sys/net/route.c index 0ca91a39bf..2833364bcc 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -82,7 +82,7 @@ * * @(#)route.c 8.3 (Berkeley) 1/9/95 * $FreeBSD: src/sys/net/route.c,v 1.59.2.10 2003/01/17 08:04:00 ru Exp $ - * $DragonFly: src/sys/net/route.c,v 1.25 2006/04/11 06:59:36 dillon Exp $ + * $DragonFly: src/sys/net/route.c,v 1.26 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_inet.h" @@ -514,7 +514,7 @@ rtredirect_msghandler(struct lwkt_msg *lmsg) * Routing table ioctl interface. */ int -rtioctl(u_long req, caddr_t data, struct thread *td) +rtioctl(u_long req, caddr_t data, struct ucred *cred) { #ifdef INET /* Multicast goop, grrr... */ diff --git a/sys/net/route.h b/sys/net/route.h index 77117a78d6..e005fb49eb 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -82,7 +82,7 @@ * * @(#)route.h 8.4 (Berkeley) 1/9/95 * $FreeBSD: src/sys/net/route.h,v 1.36.2.5 2002/02/01 11:48:01 ru Exp $ - * $DragonFly: src/sys/net/route.h,v 1.16 2006/04/11 06:59:36 dillon Exp $ + * $DragonFly: src/sys/net/route.h,v 1.17 2006/05/06 02:43:12 dillon Exp $ */ #ifndef _NET_ROUTE_H_ @@ -324,6 +324,7 @@ extern struct lwkt_port *rt_ports[MAXCPU]; struct ifmultiaddr; struct proc; +struct ucred; void route_init (void); void rt_dstmsg(int type, struct sockaddr *dst, int error); @@ -373,7 +374,7 @@ typedef void (*rtrequest1_callback_func_t)(int, int, struct rt_addrinfo *, void rtfree (struct rtentry *); int rtinit (struct ifaddr *, int, int); -int rtioctl (u_long, caddr_t, struct thread *); +int rtioctl (u_long, caddr_t, struct ucred *); void rtredirect (struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct sockaddr *); int rtrequest (int, struct sockaddr *, diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 4036bd1423..8d5d69c3c4 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -82,7 +82,7 @@ * * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 * $FreeBSD: src/sys/net/rtsock.c,v 1.44.2.11 2002/12/04 14:05:41 ru Exp $ - * $DragonFly: src/sys/net/rtsock.c,v 1.30 2006/01/31 19:05:35 dillon Exp $ + * $DragonFly: src/sys/net/rtsock.c,v 1.31 2006/05/06 02:43:12 dillon Exp $ */ #include "opt_sctp.h" @@ -1175,7 +1175,7 @@ sysctl_iflist(int af, struct walkarg *w) if (af && af != ifa->ifa_addr->sa_family) continue; if (curproc->p_ucred->cr_prison && - prison_if(curthread, ifa->ifa_addr)) + prison_if(curproc->p_ucred, ifa->ifa_addr)) continue; rtinfo.rti_ifaaddr = ifa->ifa_addr; rtinfo.rti_netmask = ifa->ifa_netmask; diff --git a/sys/netproto/ncp/ncp_sock.c b/sys/netproto/ncp/ncp_sock.c index 0e50ca16a0..776937e31d 100644 --- a/sys/netproto/ncp/ncp_sock.c +++ b/sys/netproto/ncp/ncp_sock.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netncp/ncp_sock.c,v 1.2 1999/10/12 10:36:59 bp Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_sock.c,v 1.12 2006/01/14 13:36:40 swildner Exp $ + * $DragonFly: src/sys/netproto/ncp/ncp_sock.c,v 1.13 2006/05/06 02:43:13 dillon Exp $ * * Low level socket routines */ @@ -191,10 +191,9 @@ ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp) } int -ncp_poll(struct socket *so, int events){ - struct thread *td = curthread; /* XXX */ - struct ucred *cred=NULL; - return so_pru_sopoll(so, events, cred, td); +ncp_poll(struct socket *so, int events) +{ + return (so_pru_sopoll(so, events, NULL)); } int diff --git a/sys/netproto/smb/smb_trantcp.c b/sys/netproto/smb/smb_trantcp.c index 54978d28be..bda11da454 100644 --- a/sys/netproto/smb/smb_trantcp.c +++ b/sys/netproto/smb/smb_trantcp.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_trantcp.c,v 1.3.2.1 2001/05/22 08:32:34 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_trantcp.c,v 1.13 2005/12/08 20:20:34 dillon Exp $ + * $DragonFly: src/sys/netproto/smb/smb_trantcp.c,v 1.14 2006/05/06 02:43:13 dillon Exp $ */ #include #include @@ -96,7 +96,7 @@ nb_setsockopt_int(struct socket *so, int level, int name, int val) static __inline int nb_poll(struct nbpcb *nbp, int events, struct thread *td) { - return so_pru_sopoll(nbp->nbp_tso, events, NULL, td); + return so_pru_sopoll(nbp->nbp_tso, events, NULL); } static int diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 1fc084e2cf..7f7280bed2 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */ -/* $DragonFly: src/sys/opencrypto/cryptodev.c,v 1.12 2005/09/02 07:16:58 hsu Exp $ */ +/* $DragonFly: src/sys/opencrypto/cryptodev.c,v 1.13 2006/05/06 02:43:13 dillon Exp $ */ /* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */ /* @@ -83,12 +83,12 @@ struct fcrypt { }; static int cryptof_rw(struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *); -static int cryptof_ioctl(struct file *, u_long, caddr_t, struct thread *); -static int cryptof_poll(struct file *, int, struct ucred *, struct thread *); + struct ucred *cred, int flags); +static int cryptof_ioctl(struct file *, u_long, caddr_t, struct ucred *); +static int cryptof_poll(struct file *, int, struct ucred *); static int cryptof_kqfilter(struct file *, struct knote *); -static int cryptof_stat(struct file *, struct stat *, struct thread *); -static int cryptof_close(struct file *, struct thread *); +static int cryptof_stat(struct file *, struct stat *, struct ucred *); +static int cryptof_close(struct file *); static struct fileops cryptofops = { NULL, /* port */ @@ -111,8 +111,7 @@ static struct csession *csecreate(struct fcrypt *, u_int64_t, caddr_t, struct auth_hash *); static int csefree(struct csession *); -static int cryptodev_op(struct csession *, struct crypt_op *, - struct thread *td); +static int cryptodev_op(struct csession *, struct crypt_op *); static int cryptodev_key(struct crypt_kop *); static int @@ -120,8 +119,7 @@ cryptof_rw( struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, - struct thread *td) + int flags) { return (EIO); @@ -133,7 +131,7 @@ cryptof_ioctl( struct file *fp, u_long cmd, caddr_t data, - struct thread *td) + struct ucred *cred) { struct cryptoini cria, crie; struct fcrypt *fcr = (struct fcrypt *)fp->f_data; @@ -291,7 +289,7 @@ bail: cse = csefind(fcr, cop->ses); if (cse == NULL) return (EINVAL); - error = cryptodev_op(cse, cop, td); + error = cryptodev_op(cse, cop); break; case CIOCKEY: error = cryptodev_key((struct crypt_kop *)data); @@ -309,10 +307,7 @@ static int cryptodev_cb(void *); static int -cryptodev_op( - struct csession *cse, - struct crypt_op *cop, - struct thread *td) +cryptodev_op(struct csession *cse, struct crypt_op *cop) { struct cryptop *crp = NULL; struct cryptodesc *crde = NULL, *crda = NULL; @@ -329,7 +324,7 @@ cryptodev_op( cse->uio.uio_resid = 0; cse->uio.uio_segflg = UIO_SYSSPACE; cse->uio.uio_rw = UIO_WRITE; - cse->uio.uio_td = td; + cse->uio.uio_td = curthread; cse->uio.uio_iov = cse->iovec; bzero(&cse->iovec, sizeof(cse->iovec)); cse->uio.uio_iov[0].iov_len = cop->len; @@ -574,13 +569,8 @@ fail: /* ARGSUSED */ static int -cryptof_poll( - struct file *fp, - int events, - struct ucred *active_cred, - struct thread *td) +cryptof_poll(struct file *fp, int events, struct ucred *active_cred) { - return (0); } @@ -594,18 +584,14 @@ cryptof_kqfilter(struct file *fp, struct knote *kn) /* ARGSUSED */ static int -cryptof_stat( - struct file *fp, - struct stat *sb, - struct thread *td) +cryptof_stat(struct file *fp, struct stat *sb, struct ucred *cred) { - return (EOPNOTSUPP); } /* ARGSUSED */ static int -cryptof_close(struct file *fp, struct thread *td) +cryptof_close(struct file *fp) { struct fcrypt *fcr = (struct fcrypt *)fp->f_data; struct csession *cse; diff --git a/sys/platform/pc32/i386/vm_machdep.c b/sys/platform/pc32/i386/vm_machdep.c index 571845fde5..7a6e267a7a 100644 --- a/sys/platform/pc32/i386/vm_machdep.c +++ b/sys/platform/pc32/i386/vm_machdep.c @@ -39,7 +39,7 @@ * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ * $FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.132.2.9 2003/01/25 19:02:23 dillon Exp $ - * $DragonFly: src/sys/platform/pc32/i386/vm_machdep.c,v 1.41 2006/04/30 20:23:22 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/vm_machdep.c,v 1.42 2006/05/06 02:43:12 dillon Exp $ */ #include "use_npx.h" @@ -336,7 +336,7 @@ cpu_coredump(struct thread *td, struct vnode *vp, struct ucred *cred) bcopy(p->p_thread->td_pcb, tempuser + ((char *)p->p_thread->td_pcb - (char *)p->p_addr), sizeof(struct pcb)); error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser, ctob(UPAGES), - (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, (int *)NULL, td); + (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, (int *)NULL); free(tempuser, M_TEMP); diff --git a/sys/sys/file.h b/sys/sys/file.h index 80c4f1a734..d2e4033e22 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -32,7 +32,7 @@ * * @(#)file.h 8.3 (Berkeley) 1/9/95 * $FreeBSD: src/sys/sys/file.h,v 1.22.2.7 2002/11/21 23:39:24 sam Exp $ - * $DragonFly: src/sys/sys/file.h,v 1.15 2005/09/02 07:16:58 hsu Exp $ + * $DragonFly: src/sys/sys/file.h,v 1.16 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_FILE_H_ @@ -60,24 +60,21 @@ struct namecache; struct fileops { struct lwkt_port *fo_port; - int (*fo_clone)(struct file *); /* additional work after dup */ - - int (*fold_read) (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, - struct thread *td); - int (*fold_write) (struct file *fp, struct uio *uio, - struct ucred *cred, int flags, - struct thread *td); - int (*fold_ioctl) (struct file *fp, u_long com, - caddr_t data, struct thread *td); - int (*fold_poll) (struct file *fp, int events, - struct ucred *cred, struct thread *td); - int (*fold_kqfilter) (struct file *fp, - struct knote *kn); - int (*fold_stat) (struct file *fp, struct stat *sb, - struct thread *td); - int (*fold_close) (struct file *fp, struct thread *td); - int (*fold_shutdown) (struct file *fp, int how, struct thread *td); + int (*fo_clone) (struct file *);/* additional work after dup */ + + int (*fold_read) (struct file *fp, struct uio *uio, + struct ucred *cred, int flags); + int (*fold_write) (struct file *fp, struct uio *uio, + struct ucred *cred, int flags); + int (*fold_ioctl) (struct file *fp, u_long com, caddr_t data, + struct ucred *cred); + int (*fold_poll) (struct file *fp, int events, + struct ucred *cred); + int (*fold_kqfilter) (struct file *fp, struct knote *kn); + int (*fold_stat) (struct file *fp, struct stat *sb, + struct ucred *cred); + int (*fold_close) (struct file *fp); + int (*fold_shutdown) (struct file *fp, int how); }; #define FOF_OFFSET 1 /* fo_read(), fo_write() flags */ @@ -134,7 +131,7 @@ extern int fp_write(struct file *fp, void *buf, size_t nbytes, ssize_t *res); extern int fp_stat(struct file *fp, struct stat *ub); extern int fp_mmap(void *addr, size_t size, int prot, int flags, struct file *fp, off_t pos, void **resp); -extern int nofo_shutdown(struct file *fp, int how, struct thread *td); +extern int nofo_shutdown(struct file *fp, int how); extern int fp_close(struct file *fp); extern int fp_shutdown(struct file *fp, int how); diff --git a/sys/sys/file2.h b/sys/sys/file2.h index 8d08da1233..f7c6f4f5c2 100644 --- a/sys/sys/file2.h +++ b/sys/sys/file2.h @@ -32,7 +32,7 @@ * * @(#)file.h 8.3 (Berkeley) 1/9/95 * $FreeBSD: src/sys/sys/file.h,v 1.22.2.7 2002/11/21 23:39:24 sam Exp $ - * $DragonFly: src/sys/sys/file2.h,v 1.3 2005/07/13 01:38:53 dillon Exp $ + * $DragonFly: src/sys/sys/file2.h,v 1.4 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_FILE2_H_ @@ -51,14 +51,13 @@ fo_read( struct file *fp, struct uio *uio, struct ucred *cred, - int flags, - struct thread *td + int flags ) { int error; fhold(fp); - error = (*fp->f_ops->fold_read)(fp, uio, cred, flags, td); - fdrop(fp, td); + error = (*fp->f_ops->fold_read)(fp, uio, cred, flags); + fdrop(fp, curthread); return (error); } @@ -67,14 +66,13 @@ fo_write( struct file *fp, struct uio *uio, struct ucred *cred, - int flags, - struct thread *td + int flags ) { int error; fhold(fp); - error = (*fp->f_ops->fold_write)(fp, uio, cred, flags, td); - fdrop(fp, td); + error = (*fp->f_ops->fold_write)(fp, uio, cred, flags); + fdrop(fp, curthread); return (error); } @@ -83,13 +81,13 @@ fo_ioctl( struct file *fp, u_long com, caddr_t data, - struct thread *td + struct ucred *cred ) { int error; fhold(fp); - error = (*fp->f_ops->fold_ioctl)(fp, com, data, td); - fdrop(fp, td); + error = (*fp->f_ops->fold_ioctl)(fp, com, data, cred); + fdrop(fp, curthread); return (error); } @@ -97,38 +95,37 @@ static __inline int fo_poll( struct file *fp, int events, - struct ucred *cred, - struct thread *td + struct ucred *cred ) { int error; fhold(fp); - error = (*fp->f_ops->fold_poll)(fp, events, cred, td); - fdrop(fp, td); + error = (*fp->f_ops->fold_poll)(fp, events, cred); + fdrop(fp, curthread); return (error); } static __inline int -fo_stat(struct file *fp, struct stat *sb, struct thread *td) +fo_stat(struct file *fp, struct stat *sb, struct ucred *cred) { int error; fhold(fp); - error = (*fp->f_ops->fold_stat)(fp, sb, td); - fdrop(fp, td); + error = (*fp->f_ops->fold_stat)(fp, sb, cred); + fdrop(fp, curthread); return (error); } static __inline int -fo_close(struct file *fp, struct thread *td) +fo_close(struct file *fp) { - return ((*fp->f_ops->fold_close)(fp, td)); + return ((*fp->f_ops->fold_close)(fp)); } static __inline int -fo_shutdown(struct file *fp, int how, struct thread *td) +fo_shutdown(struct file *fp, int how) { - return ((*fp->f_ops->fold_shutdown)(fp, how, td)); + return ((*fp->f_ops->fold_shutdown)(fp, how)); } static __inline int diff --git a/sys/sys/kern_syscall.h b/sys/sys/kern_syscall.h index 5ad863b815..cc66d3a9a8 100644 --- a/sys/sys/kern_syscall.h +++ b/sys/sys/kern_syscall.h @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/kern_syscall.h,v 1.29 2006/04/26 17:17:57 dillon Exp $ + * $DragonFly: src/sys/sys/kern_syscall.h,v 1.30 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_KERN_SYSCALL_H_ @@ -59,12 +59,13 @@ struct timeval; struct uio; struct vnode; struct file; +struct ucred; /* * Prototypes for syscalls in kern/kern_descrip.c */ int kern_dup(enum dup_type type, int old, int new, int *res); -int kern_fcntl(int fd, int cmd, union fcntl_dat *dat); +int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred); int kern_fstat(int fd, struct stat *st); /* diff --git a/sys/sys/mapped_ioctl.h b/sys/sys/mapped_ioctl.h index d1d267bc61..c253cb57fa 100644 --- a/sys/sys/mapped_ioctl.h +++ b/sys/sys/mapped_ioctl.h @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/mapped_ioctl.h,v 1.2 2005/03/01 00:43:02 corecode Exp $ + * $DragonFly: src/sys/sys/mapped_ioctl.h,v 1.3 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_MAPPED_IOCTL_H_ #define _SYS_MAPPED_IOCTL_H_ @@ -40,10 +40,11 @@ struct file; struct thread; +struct ucred; struct ioctl_map_entry; -typedef int (ioctl_wrap_func)(struct file *, u_long, u_long, caddr_t, - struct thread *); +typedef int (ioctl_wrap_func)(struct file *, u_long, u_long, caddr_t, + struct ucred *); typedef u_long (ioctl_map_func)(u_long, u_long, u_long, u_long, u_long, u_long); struct ioctl_map_range { diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 47d3488ade..b60b86a5bd 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -32,7 +32,7 @@ * * @(#)mount.h 8.21 (Berkeley) 5/20/95 * $FreeBSD: src/sys/sys/mount.h,v 1.89.2.7 2003/04/04 20:35:57 tegge Exp $ - * $DragonFly: src/sys/sys/mount.h,v 1.22 2006/05/05 21:27:54 dillon Exp $ + * $DragonFly: src/sys/sys/mount.h,v 1.23 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -383,7 +383,7 @@ typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid, caddr_t arg, struct thread *td); typedef int vfs_statfs_t(struct mount *mp, struct statfs *sbp, struct thread *td); -typedef int vfs_sync_t(struct mount *mp, int waitfor, struct thread *td); +typedef int vfs_sync_t(struct mount *mp, int waitfor); typedef int vfs_vget_t(struct mount *mp, ino_t ino, struct vnode **vpp); typedef int vfs_fhtovp_t(struct mount *mp, struct fid *fhp, struct vnode **vpp); @@ -419,7 +419,7 @@ struct vfsops { #define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP) #define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P) #define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P) -#define VFS_SYNC(MP, WAIT, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, P) +#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) #define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP) #define VFS_FHTOVP(MP, FIDP, VPP) \ (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) diff --git a/sys/sys/socketops.h b/sys/sys/socketops.h index a15ac9c961..e6b176c672 100644 --- a/sys/sys/socketops.h +++ b/sys/sys/socketops.h @@ -30,7 +30,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/socketops.h,v 1.6 2004/12/30 07:01:52 cpressey Exp $ + * $DragonFly: src/sys/sys/socketops.h,v 1.7 2006/05/06 02:43:13 dillon Exp $ */ /* @@ -89,7 +89,7 @@ int so_pru_bind (struct socket *so, struct sockaddr *nam, struct thread *td); int so_pru_connect (struct socket *so, struct sockaddr *nam, struct thread *td); int so_pru_connect2 (struct socket *so1, struct socket *so2); int so_pru_control (struct socket *so, u_long cmd, caddr_t data, - struct ifnet *ifp, struct thread *td); + struct ifnet *ifp); int so_pru_detach (struct socket *so); int so_pru_disconnect (struct socket *so); int so_pru_listen (struct socket *so, struct thread *td); @@ -102,8 +102,7 @@ int so_pru_send (struct socket *so, int flags, struct mbuf *m, int so_pru_sense (struct socket *so, struct stat *sb); int so_pru_shutdown (struct socket *so); int so_pru_sockaddr (struct socket *so, struct sockaddr **nam); -int so_pru_sopoll (struct socket *so, int events, struct ucred *cred, - struct thread *td); +int so_pru_sopoll (struct socket *so, int events, struct ucred *cred); int so_pr_ctloutput(struct socket *so, struct sockopt *sopt); #endif diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 461eb5abf0..889cedc7e1 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -32,7 +32,7 @@ * * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/socketvar.h,v 1.46.2.10 2003/08/24 08:24:39 hsu Exp $ - * $DragonFly: src/sys/sys/socketvar.h,v 1.20 2005/07/23 07:28:36 dillon Exp $ + * $DragonFly: src/sys/sys/socketvar.h,v 1.21 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_SOCKETVAR_H_ @@ -318,16 +318,15 @@ struct knote; * File operations on sockets. */ int soo_read (struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td); + int flags); int soo_write (struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td); -int soo_close (struct file *fp, struct thread *td); -int soo_shutdown (struct file *fp, int how, struct thread *td); + int flags); +int soo_close (struct file *fp); +int soo_shutdown (struct file *fp, int how); int soo_ioctl (struct file *fp, u_long cmd, caddr_t data, - struct thread *td); -int soo_poll (struct file *fp, int events, struct ucred *cred, - struct thread *td); -int soo_stat (struct file *fp, struct stat *ub, struct thread *td); + struct ucred *cred); +int soo_poll (struct file *fp, int events, struct ucred *cred); +int soo_stat (struct file *fp, struct stat *ub, struct ucred *cred); int sokqfilter (struct file *fp, struct knote *kn); /* diff --git a/sys/sys/vfsops.h b/sys/sys/vfsops.h index 96bf349760..0af566d2f3 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.21 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/sys/vfsops.h,v 1.22 2006/05/06 02:43:13 dillon Exp $ */ /* @@ -130,14 +130,12 @@ struct vop_open_args { int a_mode; struct ucred *a_cred; struct file *a_fp; /* optional fp for fileops override */ - struct thread *a_td; }; struct vop_close_args { struct vop_generic_args a_head; struct vnode *a_vp; int a_fflag; - struct thread *a_td; }; struct vop_access_args { @@ -145,14 +143,12 @@ struct vop_access_args { struct vnode *a_vp; int a_mode; struct ucred *a_cred; - struct thread *a_td; }; struct vop_getattr_args { struct vop_generic_args a_head; struct vnode *a_vp; struct vattr *a_vap; - struct thread *a_td; }; struct vop_setattr_args { @@ -160,7 +156,6 @@ struct vop_setattr_args { struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; }; struct vop_read_args { @@ -186,7 +181,6 @@ struct vop_ioctl_args { caddr_t a_data; int a_fflag; struct ucred *a_cred; - struct thread *a_td; }; struct vop_poll_args { @@ -194,7 +188,6 @@ struct vop_poll_args { struct vnode *a_vp; int a_events; struct ucred *a_cred; - struct thread *a_td; }; struct vop_kqfilter_args { @@ -214,14 +207,12 @@ struct vop_mmap_args { struct vnode *a_vp; int a_fflags; struct ucred *a_cred; - struct thread *a_td; }; struct vop_fsync_args { struct vop_generic_args a_head; struct vnode *a_vp; int a_waitfor; - struct thread *a_td; }; struct vop_old_remove_args { @@ -292,13 +283,11 @@ struct vop_readlink_args { struct vop_inactive_args { struct vop_generic_args a_head; struct vnode *a_vp; - struct thread *a_td; }; struct vop_reclaim_args { struct vop_generic_args a_head; struct vnode *a_vp; - struct thread *a_td; }; struct vop_lock_args { @@ -398,7 +387,6 @@ struct vop_getacl_args { acl_type_t a_type; struct acl *a_aclp; struct ucred *a_cred; - struct thread *a_td; }; struct vop_setacl_args { @@ -407,7 +395,6 @@ struct vop_setacl_args { acl_type_t a_type; struct acl *a_aclp; struct ucred *a_cred; - struct thread *a_td; }; struct vop_aclcheck_args { @@ -416,7 +403,6 @@ struct vop_aclcheck_args { acl_type_t a_type; struct acl *a_aclp; struct ucred *a_cred; - struct thread *a_td; }; struct vop_getextattr_args { @@ -425,7 +411,6 @@ struct vop_getextattr_args { char *a_name; struct uio *a_uio; struct ucred *a_cred; - struct thread *a_td; }; struct vop_setextattr_args { @@ -434,7 +419,6 @@ struct vop_setextattr_args { char *a_name; struct uio *a_uio; struct ucred *a_cred; - struct thread *a_td; }; struct vop_mountctl_args { @@ -725,30 +709,26 @@ int vop_old_mknod(struct vop_ops *ops, struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap); int vop_open(struct vop_ops *ops, struct vnode *vp, int mode, - struct ucred *cred, struct file *file, struct thread *td); -int vop_close(struct vop_ops *ops, struct vnode *vp, - int fflag, struct thread *td); + struct ucred *cred, struct file *file); +int vop_close(struct vop_ops *ops, struct vnode *vp, int fflag); int vop_access(struct vop_ops *ops, struct vnode *vp, int mode, - struct ucred *cred, struct thread *td); -int vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, - struct thread *td); + struct ucred *cred); +int vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap); int vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, - struct ucred *cred, struct thread *td); + struct ucred *cred); int vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred); int vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred); int vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, - caddr_t data, int fflag, - struct ucred *cred, struct thread *td); + caddr_t data, int fflag, struct ucred *cred); int vop_poll(struct vop_ops *ops, struct vnode *vp, int events, - struct ucred *cred, struct thread *td); + struct ucred *cred); int vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn); int vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags); int vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, - struct ucred *cred, struct thread *td); -int vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, - struct thread *td); + struct ucred *cred); +int vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor); int vop_old_remove(struct vop_ops *ops, struct vnode *dvp, struct vnode *vp, struct componentname *cnp); int vop_old_link(struct vop_ops *ops, struct vnode *tdvp, @@ -770,8 +750,8 @@ int vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int *ncookies, u_long **cookies); 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_inactive(struct vop_ops *ops, struct vnode *vp); +int vop_reclaim(struct vop_ops *ops, struct vnode *vp); 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, @@ -794,15 +774,15 @@ int vop_putpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m, int vop_freeblks(struct vop_ops *ops, struct vnode *vp, off_t offset, int length); int vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, - struct acl *aclp, struct ucred *cred, struct thread *td); + struct acl *aclp, struct ucred *cred); int vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, - struct acl *aclp, struct ucred *cred, struct thread *td); + struct acl *aclp, struct ucred *cred); int vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type, - struct acl *aclp, struct ucred *cred, struct thread *td); + struct acl *aclp, struct ucred *cred); int vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name, - struct uio *uio, struct ucred *cred, struct thread *td); + struct uio *uio, struct ucred *cred); int vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name, - struct uio *uio, struct ucred *cred, struct thread *td); + struct uio *uio, struct ucred *cred); int vop_mountctl(struct vop_ops *ops, int op, struct file *fp, const void *ctl, int ctllen, void *buf, int buflen, int *res); int vop_nresolve(struct vop_ops *ops, struct namecache *ncp, @@ -973,40 +953,40 @@ extern struct vnodeop_desc vop_nrename_desc; */ #define VOP_ISLOCKED(vp, td) \ vop_islocked(*(vp)->v_ops, vp, td) -#define VOP_OPEN(vp, mode, cred, fp, td) \ - vop_open(*(vp)->v_ops, vp, mode, cred, fp, td) -#define VOP_CLOSE(vp, fflag, td) \ - vop_close(*(vp)->v_ops, vp, fflag, td) -#define VOP_ACCESS(vp, mode, cred, td) \ - vop_access(*(vp)->v_ops, vp, mode, cred, td) -#define VOP_GETATTR(vp, vap, td) \ - vop_getattr(*(vp)->v_ops, vp, vap, td) -#define VOP_SETATTR(vp, vap, cred, td) \ - vop_setattr(*(vp)->v_ops, vp, vap, cred, td) +#define VOP_OPEN(vp, mode, cred, fp) \ + vop_open(*(vp)->v_ops, vp, mode, cred, fp) +#define VOP_CLOSE(vp, fflag) \ + vop_close(*(vp)->v_ops, vp, fflag) +#define VOP_ACCESS(vp, mode, cred) \ + vop_access(*(vp)->v_ops, vp, mode, cred) +#define VOP_GETATTR(vp, vap) \ + vop_getattr(*(vp)->v_ops, vp, vap) +#define VOP_SETATTR(vp, vap, cred) \ + vop_setattr(*(vp)->v_ops, vp, vap, cred) #define VOP_READ(vp, uio, ioflag, cred) \ vop_read(*(vp)->v_ops, vp, uio, ioflag, cred) #define VOP_WRITE(vp, uio, ioflag, cred) \ vop_write(*(vp)->v_ops, vp, uio, ioflag, cred) -#define VOP_IOCTL(vp, command, data, fflag, cred, td) \ - vop_ioctl(*(vp)->v_ops, vp, command, data, fflag, cred, td) -#define VOP_POLL(vp, events, cred, td) \ - vop_poll(*(vp)->v_ops, vp, events, cred, td) +#define VOP_IOCTL(vp, command, data, fflag, cred) \ + vop_ioctl(*(vp)->v_ops, vp, command, data, fflag, cred) +#define VOP_POLL(vp, events, cred) \ + vop_poll(*(vp)->v_ops, vp, events, cred) #define VOP_KQFILTER(vp, kn) \ vop_kqfilter(*(vp)->v_ops, vp, kn) #define VOP_REVOKE(vp, flags) \ vop_revoke(*(vp)->v_ops, vp, flags) -#define VOP_MMAP(vp, fflags, cred, td) \ - vop_mmap(*(vp)->v_ops, vp, fflags, cred, td) -#define VOP_FSYNC(vp, waitfor, td) \ - vop_fsync(*(vp)->v_ops, vp, waitfor, td) +#define VOP_MMAP(vp, fflags, cred) \ + vop_mmap(*(vp)->v_ops, vp, fflags, cred) +#define VOP_FSYNC(vp, waitfor) \ + vop_fsync(*(vp)->v_ops, vp, waitfor) #define VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies) \ vop_readdir(*(vp)->v_ops, vp, uio, cred, eofflag, ncookies, cookies) #define VOP_READLINK(vp, uio, cred) \ vop_readlink(*(vp)->v_ops, vp, uio, cred) -#define VOP_INACTIVE(vp, td) \ - vop_inactive(*(vp)->v_ops, vp, td) -#define VOP_RECLAIM(vp, td) \ - vop_reclaim(*(vp)->v_ops, vp, td) +#define VOP_INACTIVE(vp) \ + vop_inactive(*(vp)->v_ops, vp) +#define VOP_RECLAIM(vp) \ + vop_reclaim(*(vp)->v_ops, vp) #define VOP_LOCK(vp, flags) \ vop_lock(*(vp)->v_ops, vp, flags) #define VOP_UNLOCK(vp, flags) \ @@ -1029,16 +1009,16 @@ extern struct vnodeop_desc vop_nrename_desc; vop_putpages(*(vp)->v_ops, vp, m, count, sync, rtvals, off) #define VOP_FREEBLKS(vp, offset, length) \ vop_freeblks(*(vp)->v_ops, vp, offset, length) -#define VOP_GETACL(vp, type, aclp, cred, td) \ - vop_getacl(*(vp)->v_ops, vp, type, aclp, cred, td) -#define VOP_SETACL(vp, type, aclp, cred, td) \ - vop_setacl(*(vp)->v_ops, vp, type, aclp, cred, td) -#define VOP_ACLCHECK(vp, type, aclp, cred, td) \ - vop_aclcheck(*(vp)->v_ops, vp, type, aclp, cred, td) -#define VOP_GETEXTATTR(vp, name, uio, cred, td) \ - vop_getextattr(*(vp)->v_ops, vp, name, uio, cred, td) -#define VOP_SETEXTATTR(vp, name, uio, cred, td) \ - vop_setextattr(*(vp)->v_ops, vp, name, uio, cred, td) +#define VOP_GETACL(vp, type, aclp, cred) \ + vop_getacl(*(vp)->v_ops, vp, type, aclp, cred) +#define VOP_SETACL(vp, type, aclp, cred) \ + vop_setacl(*(vp)->v_ops, vp, type, aclp, cred) +#define VOP_ACLCHECK(vp, type, aclp, cred) \ + vop_aclcheck(*(vp)->v_ops, vp, type, aclp, cred) +#define VOP_GETEXTATTR(vp, name, uio, cred) \ + vop_getextattr(*(vp)->v_ops, vp, name, uio, cred) +#define VOP_SETEXTATTR(vp, name, uio, cred) \ + vop_setextattr(*(vp)->v_ops, vp, name, uio, cred) /* no VOP_VFSSET() */ /* VOP_STRATEGY - does not exist, use vn_strategy() */ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index b8fc1a0666..fe2f463512 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.51 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/sys/vnode.h,v 1.52 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _SYS_VNODE_H_ @@ -588,21 +588,19 @@ int vmntvnodescan(struct mount *mp, int flags, void *data); void insmntque(struct vnode *vp, struct mount *mp); -void vclean (struct vnode *vp, int flags, struct thread *td); +void vclean (struct vnode *vp, int flags); void vgone (struct vnode *vp); void vupdatefsmid (struct vnode *vp); -int vinvalbuf (struct vnode *vp, int save, - struct thread *td, int slpflag, int slptimeo); -int vtruncbuf (struct vnode *vp, struct thread *td, - off_t length, int blksize); +int vinvalbuf (struct vnode *vp, int save, int slpflag, int slptimeo); +int vtruncbuf (struct vnode *vp, off_t length, int blksize); int vfsync(struct vnode *vp, int waitfor, int passes, int (*checkdef)(struct buf *), int (*waitoutput)(struct vnode *, struct thread *)); int vinitvmio(struct vnode *vp, off_t filesize); void vprint (char *label, struct vnode *vp); -int vrecycle (struct vnode *vp, struct thread *td); +int vrecycle (struct vnode *vp); void vn_strategy(struct vnode *vp, struct bio *bio); -int vn_close (struct vnode *vp, int flags, struct thread *td); +int vn_close (struct vnode *vp, int flags); int vn_isdisk (struct vnode *vp, int *errp); int vn_lock (struct vnode *vp, int flags); #ifdef DEBUG_LOCKS @@ -617,14 +615,14 @@ int vn_fullpath (struct proc *p, struct vnode *vn, char **retbuf, char **freebuf int vn_open (struct nlookupdata *ndp, struct file *fp, int fmode, int cmode); void vn_pollevent (struct vnode *vp, int events); void vn_pollgone (struct vnode *vp); -int vn_pollrecord (struct vnode *vp, struct thread *td, int events); +int vn_pollrecord (struct vnode *vp, int events); int vn_rdwr (enum uio_rw rw, struct vnode *vp, caddr_t base, int len, off_t offset, enum uio_seg segflg, int ioflg, - struct ucred *cred, int *aresid, struct thread *td); + struct ucred *cred, int *aresid); int vn_rdwr_inchunks (enum uio_rw rw, struct vnode *vp, caddr_t base, int len, off_t offset, enum uio_seg segflg, int ioflg, - struct ucred *cred, int *aresid, struct thread *td); -int vn_stat (struct vnode *vp, struct stat *sb, struct thread *td); + struct ucred *cred, int *aresid); +int vn_stat (struct vnode *vp, struct stat *sb, struct ucred *cred); dev_t vn_todev (struct vnode *vp); void vfs_timestamp (struct timespec *); int vn_writechk (struct vnode *vp); @@ -665,7 +663,7 @@ void vx_unlock (struct vnode *vp); int vx_get (struct vnode *vp); int vx_get_nonblock (struct vnode *vp); void vx_put (struct vnode *vp); -int vget (struct vnode *vp, int lockflag, struct thread *td); +int vget (struct vnode *vp, int lockflag); void vput (struct vnode *vp); void vhold (struct vnode *); void vdrop (struct vnode *); diff --git a/sys/vfs/coda/coda_fbsd.c b/sys/vfs/coda/coda_fbsd.c index 65a8507379..c5fefdc1e1 100644 --- a/sys/vfs/coda/coda_fbsd.c +++ b/sys/vfs/coda/coda_fbsd.c @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_fbsd.c,v 1.18 1999/09/25 18:23:43 phk Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_fbsd.c,v 1.10 2006/03/29 18:44:53 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_fbsd.c,v 1.11 2006/05/06 02:43:13 dillon Exp $ * */ @@ -116,67 +116,10 @@ coda_fbsd_getpages(void *v) struct vop_getpages_args *ap = v; int ret = 0; -#if 1 - /* ??? a_offset */ - ret = vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, - ap->a_reqpage); - return ret; -#else - { - struct vnode *vp = ap->a_vp; - struct cnode *cp = VTOC(vp); - struct vnode *cfvp = cp->c_ovp; - int opened_internally = 0; - struct ucred *cred = (struct ucred *) 0; - struct proc *p = curproc; - int error = 0; - - if (IS_CTL_VP(vp)) { - return(EINVAL); - } - - /* Redirect the request to UFS. */ - - if (cfvp == NULL) { - opened_internally = 1; - - error = VOP_OPEN(vp, FREAD, cred, NULL, p); -printf("coda_getp: Internally Opening %p\n", vp); - - if (error) { - printf("coda_getpage: VOP_OPEN on container failed %d\n", error); - return (error); - } - if (vp->v_type == VREG) { - if (vp->v_object == NULL) { - printf("coda_getpage: vp %p has no VM object\n", vp); - vput(vp); - return(EINVAL); - } - } - - cfvp = cp->c_ovp; - } else { -printf("coda_getp: has container %p\n", cfvp); - } - -printf("coda_fbsd_getpages: using container "); -/* - error = vnode_pager_generic_getpages(cfvp, ap->a_m, ap->a_count, - ap->a_reqpage); -*/ - error = VOP_GETPAGES(cfvp, ap->a_m, ap->a_count, - ap->a_reqpage, ap->a_offset); -printf("error = %d\n", error); - - /* Do an internal close if necessary. */ - if (opened_internally) { - VOP_CLOSE(vp, FREAD, cred, p); - } - - return(error); - } -#endif + /* ??? a_offset */ + ret = vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_reqpage); + return ret; } int diff --git a/sys/vfs/coda/coda_vfsops.c b/sys/vfs/coda/coda_vfsops.c index 9658fd5804..244baa64e1 100644 --- a/sys/vfs/coda/coda_vfsops.c +++ b/sys/vfs/coda/coda_vfsops.c @@ -28,7 +28,7 @@ * * @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vfsops.c,v 1.24.2.1 2001/07/26 20:36:45 iedowse Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.22 2005/07/26 15:43:35 hmp Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.23 2006/05/06 02:43:13 dillon Exp $ * */ @@ -310,7 +310,7 @@ coda_root(struct mount *vfsp, struct vnode **vpp) { /* Found valid root. */ *vpp = mi->mi_rootvp; /* On Mach, this is vref. On NetBSD, VOP_LOCK */ - vget(*vpp, LK_EXCLUSIVE, td); + vget(*vpp, LK_EXCLUSIVE); MARK_INT_SAT(CODA_ROOT_STATS); return(0); } @@ -328,7 +328,7 @@ coda_root(struct mount *vfsp, struct vnode **vpp) coda_save(VTOC(mi->mi_rootvp)); *vpp = mi->mi_rootvp; - vget(*vpp, LK_EXCLUSIVE, td); + vget(*vpp, LK_EXCLUSIVE); MARK_INT_SAT(CODA_ROOT_STATS); goto exit; @@ -343,7 +343,7 @@ coda_root(struct mount *vfsp, struct vnode **vpp) * will fail. */ *vpp = mi->mi_rootvp; - vget(*vpp, LK_EXCLUSIVE, td); + vget(*vpp, LK_EXCLUSIVE); MARK_INT_FAIL(CODA_ROOT_STATS); error = 0; @@ -397,7 +397,7 @@ coda_nb_statfs(struct mount *vfsp, struct statfs *sbp, struct thread *td) * Flush any pending I/O. */ int -coda_sync(struct mount *vfsp, int waitfor, struct thread *td) +coda_sync(struct mount *vfsp, int waitfor) { ENTRY; MARK_ENTRY(CODA_SYNC_STATS); diff --git a/sys/vfs/coda/coda_vfsops.h b/sys/vfs/coda/coda_vfsops.h index e60782d56a..d40c27c321 100644 --- a/sys/vfs/coda/coda_vfsops.h +++ b/sys/vfs/coda/coda_vfsops.h @@ -28,7 +28,7 @@ * * @(#) src/sys/cfs/coda_vfsops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vfsops.h,v 1.4 1999/08/28 00:40:57 peter Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.h,v 1.5 2004/09/30 18:59:53 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.h,v 1.6 2006/05/06 02:43:13 dillon Exp $ * */ @@ -53,7 +53,7 @@ int coda_unmount(struct mount *, int, struct thread *); int coda_root(struct mount *, struct vnode **); int coda_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); int coda_nb_statfs(struct mount *, struct statfs *, struct thread *); -int coda_sync(struct mount *, int, struct thread *); +int coda_sync(struct mount *, int); int coda_vget(struct mount *, ino_t, struct vnode **); int coda_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **, int *, struct ucred **); diff --git a/sys/vfs/coda/coda_vnops.c b/sys/vfs/coda/coda_vnops.c index 8958c13f61..6680032261 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.37 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.38 2006/05/06 02:43:13 dillon Exp $ * */ @@ -153,7 +153,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = { #define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) -#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) +#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) #define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) missing @@ -225,7 +225,7 @@ coda_open(void *v) struct cnode *cp = VTOC(*vpp); int flag = ap->a_mode & (~O_EXCL); struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ int error; struct vnode *vp; @@ -289,7 +289,7 @@ coda_open(void *v) cp->c_inode = inode; /* Open the cache file. */ - error = VOP_OPEN(vp, flag, cred, NULL, td); + error = VOP_OPEN(vp, flag, cred, NULL); if (error) { printf("coda_open: VOP_OPEN on container failed %d\n", error); goto done; @@ -319,7 +319,7 @@ coda_close(void *v) struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); int flag = ap->a_fflag; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ int error; @@ -341,7 +341,7 @@ coda_close(void *v) #ifdef hmm vgone(cp->c_ovp); #else - VOP_CLOSE(cp->c_ovp, flag, td); /* Do errors matter here? */ + VOP_CLOSE(cp->c_ovp, flag); /* Do errors matter here? */ vrele(cp->c_ovp); #endif } else { @@ -352,7 +352,7 @@ coda_close(void *v) error = ENODEV; goto done; } else { - VOP_CLOSE(cp->c_ovp, flag, td); /* Do errors matter here? */ + VOP_CLOSE(cp->c_ovp, flag); /* Do errors matter here? */ vrele(cp->c_ovp); } @@ -445,8 +445,7 @@ coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag, else { opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); - error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), - cred, NULL, td); + error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), cred, NULL); printf("coda_rdwr: Internally Opening %p\n", vp); if (error) { printf("coda_rdwr: VOP_OPEN on container failed %d\n", error); @@ -481,7 +480,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); { struct vattr attr; - if (VOP_GETATTR(cfvp, &attr, td) == 0) { + if (VOP_GETATTR(cfvp, &attr) == 0) { vnode_pager_setsize(vp, attr.va_size); } } @@ -495,7 +494,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); /* Do an internal close if necessary. */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), td); + VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE)); } /* Invalidate cached attributes if writing. */ @@ -514,7 +513,7 @@ coda_ioctl(void *v) caddr_t data = ap->a_data; int flag = ap->a_fflag; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ int error; struct vnode *tvp; @@ -600,7 +599,7 @@ coda_getattr(void *v) struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ int error; @@ -666,7 +665,7 @@ coda_setattr(void *v) struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ int error; @@ -705,7 +704,7 @@ coda_access(void *v) struct cnode *cp = VTOC(vp); int mode = ap->a_mode; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ int error; @@ -797,7 +796,7 @@ coda_fsync(void *v) struct vop_fsync_args *ap = v; struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - struct thread *td = ap->a_td; + struct thread *td = curthread; /* locals */ struct vnode *convp = cp->c_ovp; int error; @@ -820,7 +819,7 @@ coda_fsync(void *v) } if (convp) - VOP_FSYNC(convp, MNT_WAIT, td); + VOP_FSYNC(convp, MNT_WAIT); /* * We see fsyncs with usecount == 1 then usecount == 0. @@ -1550,7 +1549,6 @@ coda_readdir(void *v) int *eofflag = ap->a_eofflag; u_long **cookies = ap->a_cookies; int *ncookies = ap->a_ncookies; - struct thread *td = ap->a_uio->uio_td; /* upcall decl */ /* locals */ int error = 0; @@ -1575,7 +1573,7 @@ coda_readdir(void *v) if (cp->c_ovp == NULL) { opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); - error = VOP_OPEN(vp, FREAD, cred, NULL, td); + error = VOP_OPEN(vp, FREAD, cred, NULL); printf("coda_readdir: Internally Opening %p\n", vp); if (error) { printf("coda_readdir: VOP_OPEN on container failed %d\n", error); @@ -1604,7 +1602,7 @@ printf("coda_readdir: Internally Opening %p\n", vp); /* Do an "internal close" if necessary. */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - VOP_CLOSE(vp, FREAD, td); + VOP_CLOSE(vp, FREAD); } } diff --git a/sys/vfs/fdesc/fdesc_vnops.c b/sys/vfs/fdesc/fdesc_vnops.c index e09e2d39a9..f77d1f08f7 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.26 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.27 2006/05/06 02:43:13 dillon Exp $ */ /* @@ -114,7 +114,7 @@ fdesc_allocvp(fdntype ftype, int ix, struct mount *mp, struct vnode **vpp, loop: LIST_FOREACH(fd, fc, fd_hash) { if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) { - if (vget(fd->fd_vnode, LK_EXCLUSIVE|LK_SLEEPFAIL, td)) + if (vget(fd->fd_vnode, LK_EXCLUSIVE|LK_SLEEPFAIL)) goto loop; *vpp = fd->fd_vnode; return (error); @@ -239,14 +239,13 @@ bad: } /* - * fdesc_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred, - * struct thread *a_td) + * fdesc_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred) */ static int fdesc_open(struct vop_open_args *ap) { struct vnode *vp = ap->a_vp; - struct lwp *lp = ap->a_td->td_lwp; + struct lwp *lp = curthread->td_lwp; KKASSERT(lp); @@ -266,13 +265,12 @@ fdesc_open(struct vop_open_args *ap) } /* - * fdesc_getattr(struct vnode *a_vp, struct vattr *a_vap, - * struct ucred *a_cred, struct thread *a_td) + * fdesc_getattr(struct vnode *a_vp, struct vattr *a_vap, struct ucred *a_cred) */ static int fdesc_getattr(struct vop_getattr_args *ap) { - struct proc *p = ap->a_td->td_proc; + struct proc *p = curproc; struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; struct filedesc *fdp; @@ -312,7 +310,7 @@ fdesc_getattr(struct vop_getattr_args *ap) return (EBADF); bzero(&stb, sizeof(stb)); - error = fo_stat(fp, &stb, ap->a_td); + error = fo_stat(fp, &stb, curproc->p_ucred); if (error == 0) { VATTR_NULL(vap); vap->va_type = IFTOVT(stb.st_mode); @@ -369,7 +367,7 @@ fdesc_getattr(struct vop_getattr_args *ap) static int fdesc_setattr(struct vop_setattr_args *ap) { - struct proc *p = ap->a_td->td_proc; + struct proc *p = curproc; struct vattr *vap = ap->a_vap; struct file *fp; unsigned fd; @@ -489,7 +487,7 @@ done: static int fdesc_poll(struct vop_poll_args *ap) { - return seltrue(0, ap->a_events, ap->a_td); + return seltrue(0, ap->a_events, curthread); } /* diff --git a/sys/vfs/fifofs/fifo_vnops.c b/sys/vfs/fifofs/fifo_vnops.c index b544dcfc38..7cb64b2c74 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.27 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/fifofs/fifo_vnops.c,v 1.28 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,9 @@ #include #include #include + +#include + #include "fifo.h" /* @@ -162,6 +166,7 @@ fifo_lookup(struct vop_old_lookup_args *ap) static int fifo_open(struct vop_open_args *ap) { + struct thread *td = curthread; struct vnode *vp = ap->a_vp; struct fifoinfo *fip; struct socket *rso, *wso; @@ -170,14 +175,14 @@ fifo_open(struct vop_open_args *ap) if ((fip = vp->v_fifoinfo) == NULL) { MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_FIFOINFO, M_WAITOK); vp->v_fifoinfo = fip; - error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0, ap->a_td); + error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0, td); if (error) { free(fip, M_FIFOINFO); vp->v_fifoinfo = NULL; return (error); } fip->fi_readsock = rso; - error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, ap->a_td); + error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, td); if (error) { soclose(rso); free(fip, M_FIFOINFO); @@ -257,7 +262,7 @@ fifo_open(struct vop_open_args *ap) return (vop_stdopen(ap)); bad: vop_stdopen(ap); /* bump opencount/writecount as appropriate */ - VOP_CLOSE(vp, ap->a_mode, ap->a_td); + VOP_CLOSE(vp, ap->a_mode); return (error); } @@ -339,13 +344,13 @@ fifo_ioctl(struct vop_ioctl_args *ap) return (0); if (ap->a_fflag & FREAD) { filetmp.f_data = ap->a_vp->v_fifoinfo->fi_readsock; - error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_td); + error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_cred); if (error) return (error); } if (ap->a_fflag & FWRITE) { filetmp.f_data = ap->a_vp->v_fifoinfo->fi_writesock; - error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_td); + error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_cred); if (error) return (error); } @@ -463,8 +468,7 @@ fifo_poll(struct vop_poll_args *ap) filetmp.f_data = ap->a_vp->v_fifoinfo->fi_readsock; if (filetmp.f_data) - revents |= soo_poll(&filetmp, events, ap->a_cred, - ap->a_td); + revents |= soo_poll(&filetmp, events, ap->a_cred); /* Reverse the above conversion. */ if ((revents & POLLINIGNEOF) && @@ -477,8 +481,7 @@ fifo_poll(struct vop_poll_args *ap) if (events) { filetmp.f_data = ap->a_vp->v_fifoinfo->fi_writesock; if (filetmp.f_data) - revents |= soo_poll(&filetmp, events, ap->a_cred, - ap->a_td); + revents |= soo_poll(&filetmp, events, ap->a_cred); } return (revents); } diff --git a/sys/vfs/gnu/ext2fs/ext2_extern.h b/sys/vfs/gnu/ext2fs/ext2_extern.h index 15a9757017..a09e7b7535 100644 --- a/sys/vfs/gnu/ext2fs/ext2_extern.h +++ b/sys/vfs/gnu/ext2fs/ext2_extern.h @@ -38,7 +38,7 @@ * * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_extern.h,v 1.22.6.1 2000/11/05 19:17:40 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_extern.h,v 1.10 2006/04/04 17:34:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_extern.h,v 1.11 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _VFS_GNU_EXT2FS_EXT2_EXTERN_H_ @@ -63,7 +63,7 @@ int ext2_bmap (struct vop_bmap_args *); int ext2_reallocblks (struct vop_reallocblks_args *); int ext2_reclaim (struct vop_reclaim_args *); void ext2_setblock (struct ext2_sb_info *, u_char *, daddr_t); -int ext2_truncate (struct vnode *, off_t, int, struct ucred *, struct thread *); +int ext2_truncate (struct vnode *, off_t, int, struct ucred *); int ext2_update (struct vnode *, int); int ext2_valloc (struct vnode *, int, struct ucred *, struct vnode **); int ext2_vfree (struct vnode *, ino_t, int); diff --git a/sys/vfs/gnu/ext2fs/ext2_ihash.c b/sys/vfs/gnu/ext2fs/ext2_ihash.c index 0fde52a419..2a405fceab 100644 --- a/sys/vfs/gnu/ext2fs/ext2_ihash.c +++ b/sys/vfs/gnu/ext2fs/ext2_ihash.c @@ -32,7 +32,7 @@ * * @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95 * $FreeBSD: src/sys/ufs/ufs/ufs_ihash.c,v 1.20 1999/08/28 00:52:29 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_ihash.c,v 1.1 2006/04/04 17:34:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_ihash.c,v 1.2 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -117,7 +117,6 @@ ext2_ihashlookup(dev_t dev, ino_t inum) struct vnode * ext2_ihashget(dev_t dev, ino_t inum) { - struct thread *td = curthread; /* XXX */ lwkt_tokref ilock; struct inode *ip; struct vnode *vp; @@ -128,7 +127,7 @@ loop: if (inum != ip->i_number || dev != ip->i_dev) continue; vp = ITOV(ip); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* * We must check to see if the inode has been ripped diff --git a/sys/vfs/gnu/ext2fs/ext2_inode.c b/sys/vfs/gnu/ext2fs/ext2_inode.c index 638e0bbef6..bfe6236ca3 100644 --- a/sys/vfs/gnu/ext2fs/ext2_inode.c +++ b/sys/vfs/gnu/ext2fs/ext2_inode.c @@ -38,7 +38,7 @@ * * @(#)ext2_inode.c 8.5 (Berkeley) 12/30/93 * $FreeBSD: src/sys/gnu/ext2fs/ext2_inode.c,v 1.24.2.1 2000/08/03 00:52:57 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode.c,v 1.17 2006/04/30 17:22:18 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode.c,v 1.18 2006/05/06 02:43:13 dillon Exp $ */ #include "opt_quota.h" @@ -119,8 +119,7 @@ ext2_update(struct vnode *vp, int waitfor) * disk blocks. */ int -ext2_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, - struct thread *td) +ext2_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred) { struct vnode *ovp = vp; daddr_t lastblock; @@ -254,7 +253,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks); bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks); oip->i_size = osize; - error = vtruncbuf(ovp, td, length, (int)fs->s_blocksize); + error = vtruncbuf(ovp, length, (int)fs->s_blocksize); if (error && (allerror == 0)) allerror = error; @@ -468,14 +467,13 @@ ext2_indirtrunc(struct inode *ip, daddr_t lbn, off_t doffset, daddr_t lastbn, /* * Last reference to an inode. If necessary, write or delete it. * - * ext2_inactive(struct vnode *a_vp, struct thread *a_td) + * ext2_inactive(struct vnode *a_vp) */ int ext2_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - struct thread *td = ap->a_td; int mode, error = 0; ext2_discard_prealloc(ip); @@ -492,7 +490,7 @@ ext2_inactive(struct vop_inactive_args *ap) if (!ext2_getinoquota(ip)) (void)ext2_chkiq(ip, -1, NOCRED, FORCE); #endif - error = EXT2_TRUNCATE(vp, (off_t)0, 0, NOCRED, td); + error = EXT2_TRUNCATE(vp, (off_t)0, 0, NOCRED); ip->i_rdev = 0; mode = ip->i_mode; ip->i_mode = 0; @@ -507,14 +505,14 @@ out: * so that it can be reused immediately. */ if (ip == NULL || ip->i_mode == 0) - vrecycle(vp, td); + vrecycle(vp); return (error); } /* * Reclaim an inode so that it can be used for other purposes. * - * ext2_reclaim(struct vnode *a_vp, struct thread *a_td) + * ext2_reclaim(struct vnode *a_vp) */ int ext2_reclaim(struct vop_reclaim_args *ap) diff --git a/sys/vfs/gnu/ext2fs/ext2_lookup.c b/sys/vfs/gnu/ext2fs/ext2_lookup.c index 6da31f03c8..fa3ddd0b15 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.21 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_lookup.c,v 1.22 2006/05/06 02:43:13 dillon Exp $ */ /* * Copyright (c) 1989, 1993 @@ -479,7 +479,7 @@ searchloop: * Access for write is interpreted as allowing * creation of files in the directory. */ - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred)) != 0) return (error); /* * Return an indication of where the new directory @@ -555,7 +555,7 @@ found: /* * Write access to directory required to delete files. */ - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred)) != 0) return (error); /* * Return pointer to current entry in dp->i_offset, @@ -600,7 +600,7 @@ found: * regular file, or empty directory. */ if (nameiop == NAMEI_RENAME && wantparent) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred)) != 0) return (error); /* * Careful about locking second inode. @@ -846,7 +846,7 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp) dp->i_flag |= IN_CHANGE | IN_UPDATE; if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = EXT2_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, - cnp->cn_cred, cnp->cn_td); + cnp->cn_cred); return (error); } @@ -942,7 +942,7 @@ ext2_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred) for (off = 0; off < ip->i_size; off += dp->rec_len) { error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off, - UIO_SYSSPACE, IO_NODELOCKED, cred, &count, NULL); + UIO_SYSSPACE, IO_NODELOCKED, cred, &count); /* * Since we read MINDIRSIZ, residual must * be 0 unless we're at end of file. @@ -1003,8 +1003,8 @@ ext2_checkpath(struct inode *source, struct inode *target, struct ucred *cred) break; } error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, - sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED, cred, (int *)0, NULL); + sizeof (struct dirtemplate), (off_t)0, + UIO_SYSSPACE, IO_NODELOCKED, cred, (int *)0); if (error != 0) break; namlen = dirbuf.dotdot_type; /* like ufs little-endian */ diff --git a/sys/vfs/gnu/ext2fs/ext2_quota.c b/sys/vfs/gnu/ext2fs/ext2_quota.c index c5a122f1bb..bb0aa26ccb 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.2 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_quota.c,v 1.3 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -490,7 +490,7 @@ ext2_quotaoff(struct thread *td, struct mount *mp, int type) } ext2_dqflush(qvp); qvp->v_flag &= ~VSYSTEM; - error = vn_close(qvp, FREAD|FWRITE, td); + error = vn_close(qvp, FREAD|FWRITE); ump->um_quotas[type] = NULLVP; crfree(ump->um_cred[type]); ump->um_cred[type] = NOCRED; diff --git a/sys/vfs/gnu/ext2fs/ext2_readwrite.c b/sys/vfs/gnu/ext2fs/ext2_readwrite.c index 54cf2d51d9..d12f0d9254 100644 --- a/sys/vfs/gnu/ext2fs/ext2_readwrite.c +++ b/sys/vfs/gnu/ext2fs/ext2_readwrite.c @@ -38,7 +38,7 @@ * * @(#)ufs_readwrite.c 8.7 (Berkeley) 1/21/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_readwrite.c,v 1.18.2.2 2000/12/22 18:44:33 dillon Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.10 2006/04/04 17:34:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.11 2006/05/06 02:43:13 dillon Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -292,8 +292,7 @@ ext2_write(struct vop_write_args *ap) ip->i_mode &= ~(ISUID | ISGID); if (error) { if (ioflag & IO_UNIT) { - EXT2_TRUNCATE(vp, osize, - ioflag & IO_SYNC, ap->a_cred, uio->uio_td); + EXT2_TRUNCATE(vp, osize, ioflag & IO_SYNC, ap->a_cred); uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index 7b3b27b937..c0af3e2b4c 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.40 2006/05/05 21:27:56 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.41 2006/05/06 02:43:13 dillon Exp $ */ #include "opt_quota.h" @@ -84,7 +84,7 @@ static int ext2_reload (struct mount *mountp, struct ucred *cred, struct thread *p); static int ext2_sbupdate (struct ext2mount *, int); static int ext2_statfs (struct mount *, struct statfs *, struct thread *); -static int ext2_sync (struct mount *, int, struct thread *); +static int ext2_sync (struct mount *, int); static int ext2_unmount (struct mount *, int, struct thread *); static int ext2_vget (struct mount *, ino_t, struct vnode **); static int ext2_init(struct vfsconf *); @@ -285,8 +285,8 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, } fs->s_rd_only = 1; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); - VOP_CLOSE(devvp, FREAD|FWRITE, td); + VOP_OPEN(devvp, FREAD, FSCRED, NULL); + VOP_CLOSE(devvp, FREAD|FWRITE); VOP_UNLOCK(devvp, 0); } if (!error && (mp->mnt_flag & MNT_RELOAD)) @@ -304,7 +304,7 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, if (cred->cr_uid != 0) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_ACCESS(devvp, VREAD | VWRITE, - cred, td)) != 0) { + cred)) != 0) { VOP_UNLOCK(devvp, 0); return (error); } @@ -328,8 +328,8 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, ext2_sbupdate(ump, MNT_WAIT); fs->s_rd_only = 0; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, NULL, td); - VOP_CLOSE(devvp, FREAD, td); + VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, NULL); + VOP_CLOSE(devvp, FREAD); VOP_UNLOCK(devvp, 0); } if (args.fspec == 0) { @@ -367,7 +367,7 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if ((error = VOP_ACCESS(devvp, accessmode, cred, td)) != 0) { + if ((error = VOP_ACCESS(devvp, accessmode, cred)) != 0) { vput(devvp); return (error); } @@ -595,7 +595,6 @@ struct scaninfo { int rescan; int allerror; int waitfor; - thread_t td; struct vnode *devvp; struct ext2_sb_info *fs; }; @@ -616,7 +615,7 @@ ext2_reload(struct mount *mountp, struct ucred *cred, struct thread *td) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOEXT2(mountp)->um_devvp; - if (vinvalbuf(devvp, 0, td, 0, 0)) + if (vinvalbuf(devvp, 0, 0, 0)) panic("ext2_reload: dirty1"); /* * Step 2: re-read superblock from disk. @@ -643,7 +642,6 @@ ext2_reload(struct mount *mountp, struct ucred *cred, struct thread *td) brelse(bp); scaninfo.rescan = 1; - scaninfo.td = td; scaninfo.devvp = devvp; scaninfo.fs = fs; while (error == 0 && scaninfo.rescan) { @@ -673,13 +671,13 @@ ext2_reload_scan2(struct mount *mp, struct vnode *vp, void *data) /* * Try to recycle */ - if (vrecycle(vp, curthread)) + if (vrecycle(vp)) return(0); /* * Step 5: invalidate all cached file data. */ - if (vinvalbuf(vp, 0, info->td, 0, 0)) + if (vinvalbuf(vp, 0, 0, 0)) panic("ext2_reload: dirty2"); /* * Step 6: re-read inode data for all active vnodes. @@ -723,7 +721,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) return (error); if (count_udev(devvp->v_udev) > 0) return (EBUSY); - if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0)) != 0) + if ((error = vinvalbuf(devvp, V_SAVE, 0, 0)) != 0) return (error); #ifdef READONLY /* turn on this to force it to be read-only */ @@ -732,7 +730,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) ronly = (mp->mnt_flag & MNT_RDONLY) != 0; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL); VOP_UNLOCK(devvp, 0); if (error) return (error); @@ -741,7 +739,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) mp->mnt_iosize_max = dev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, td) != 0) + if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED) != 0) size = DEV_BSIZE; else { havepart = 1; @@ -835,7 +833,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) out: if (bp) brelse(bp); - VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); + VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE); if (ump) { bsd_free(ump->um_e2fs->s_es, M_EXT2MNT); bsd_free(ump->um_e2fs, M_EXT2MNT); @@ -887,7 +885,7 @@ ext2_unmount(struct mount *mp, int mntflags, struct thread *td) ULCK_BUF(fs->s_block_bitmap[i]) ump->um_devvp->v_rdev->si_mountpoint = NULL; - error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE, td); + error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE); vrele(ump->um_devvp); bsd_free(fs->s_es, M_EXT2MNT); bsd_free(fs, M_EXT2MNT); @@ -991,7 +989,7 @@ ext2_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) static int ext2_sync_scan(struct mount *mp, struct vnode *vp, void *data); static int -ext2_sync(struct mount *mp, int waitfor, struct thread *td) +ext2_sync(struct mount *mp, int waitfor) { struct ext2mount *ump = VFSTOEXT2(mp); struct ext2_sb_info *fs; @@ -1010,7 +1008,6 @@ ext2_sync(struct mount *mp, int waitfor, struct thread *td) scaninfo.allerror = 0; scaninfo.rescan = 1; scaninfo.waitfor = waitfor; - scaninfo.td = td; while (scaninfo.rescan) { scaninfo.rescan = 0; vmntvnodescan(mp, VMSC_GETVP|VMSC_NOWAIT, @@ -1022,7 +1019,7 @@ ext2_sync(struct mount *mp, int waitfor, struct thread *td) */ if (waitfor != MNT_LAZY) { vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); - if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) + if ((error = VOP_FSYNC(ump->um_devvp, waitfor)) != 0) scaninfo.allerror = error; VOP_UNLOCK(ump->um_devvp, 0); } @@ -1055,7 +1052,7 @@ ext2_sync_scan(struct mount *mp, struct vnode *vp, void *data) (RB_EMPTY(&vp->v_rbdirty_tree) || info->waitfor == MNT_LAZY))) { return(0); } - if ((error = VOP_FSYNC(vp, info->waitfor, info->td)) != 0) + if ((error = VOP_FSYNC(vp, info->waitfor)) != 0) info->allerror = error; return(0); } diff --git a/sys/vfs/gnu/ext2fs/ext2_vnops.c b/sys/vfs/gnu/ext2fs/ext2_vnops.c index 26ad2f6c96..5a0dad7726 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.32 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.33 2006/05/06 02:43:13 dillon Exp $ */ #include "opt_quota.h" @@ -93,8 +93,8 @@ static int ext2_access (struct vop_access_args *); static int ext2_advlock (struct vop_advlock_args *); -static int ext2_chmod (struct vnode *, int, struct ucred *, struct thread *); -static int ext2_chown (struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); +static int ext2_chmod (struct vnode *, int, struct ucred *); +static int ext2_chown (struct vnode *, uid_t, gid_t, struct ucred *); static int ext2_close (struct vop_close_args *); static int ext2_getattr (struct vop_getattr_args *); static int ext2_makeinode (int mode, struct vnode *, struct vnode **, struct componentname *); @@ -517,7 +517,7 @@ abortit: * to namei, as the parent directory is unlocked by the * call to checkpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred); VOP_UNLOCK(fvp, 0); /* @@ -692,7 +692,7 @@ abortit: if (--xp->i_nlink != 0) panic("ext2_rename: linked directory"); error = EXT2_TRUNCATE(tvp, (off_t)0, IO_SYNC, - tcnp->cn_cred, tcnp->cn_td); + tcnp->cn_cred); } xp->i_flag |= IN_CHANGE; vput(tvp); @@ -783,9 +783,9 @@ abortit: dp->i_nlink--; dp->i_flag |= IN_CHANGE; error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf, - sizeof (struct dirtemplate), (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED, - tcnp->cn_cred, (int *)0, NULL); + sizeof (struct dirtemplate), (off_t)0, + UIO_SYSSPACE, IO_NODELOCKED, + tcnp->cn_cred, (int *)0); if (error == 0) { /* Like ext2 little-endian: */ namlen = dirbuf.dotdot_type; @@ -797,12 +797,11 @@ abortit: } else { dirbuf.dotdot_ino = newparent; vn_rdwr(UIO_WRITE, fvp, - (caddr_t)&dirbuf, - sizeof (struct dirtemplate), - (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED|IO_SYNC, - tcnp->cn_cred, (int *)0, - NULL); + (caddr_t)&dirbuf, + sizeof (struct dirtemplate), + (off_t)0, UIO_SYSSPACE, + IO_NODELOCKED|IO_SYNC, + tcnp->cn_cred, (int *)0); } } } @@ -970,8 +969,8 @@ ext2_mkdir(struct vop_old_mkdir_args *ap) #define DIRBLKSIZ VTOI(dvp)->i_e2fs->s_blocksize dirtemplate.dotdot_reclen = DIRBLKSIZ - 12; error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate, - sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0, NULL); + sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE, + IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0); if (error) { dp->i_nlink--; dp->i_flag |= IN_CHANGE; @@ -1019,7 +1018,6 @@ ext2_rmdir(struct vop_old_rmdir_args *ap) struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; struct componentname *cnp = ap->a_cnp; - struct thread *td = cnp->cn_td; struct inode *ip, *dp; int error; @@ -1066,7 +1064,7 @@ ext2_rmdir(struct vop_old_rmdir_args *ap) * worry about them later. */ ip->i_nlink -= 2; - error = EXT2_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred, td); + error = EXT2_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); out: return (error); @@ -1106,8 +1104,8 @@ ext2_symlink(struct vop_old_symlink_args *ap) vinitvmio(vp, 0); error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, (int *)0, - NULL); + UIO_SYSSPACE, IO_NODELOCKED, + ap->a_cnp->cn_cred, (int *)0); if (error) vput(vp); @@ -1300,8 +1298,7 @@ ext2_itimes(struct vnode *vp) * * Nothing to do. * - * ext2_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred, - * struct thread *a_td) + * ext2_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred) */ /* ARGSUSED */ static @@ -1325,8 +1322,7 @@ ext2_open(struct vop_open_args *ap) * * Update the times on the inode. * - * ext2_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred, - * struct thread *a_td) + * ext2_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred) */ /* ARGSUSED */ static @@ -1341,8 +1337,7 @@ ext2_close(struct vop_close_args *ap) } /* - * ext2_access(struct vnode *a_vp, int a_mode, struct ucred *a_cred, - * struct thread *a_td) + * ext2_access(struct vnode *a_vp, int a_mode, struct ucred *a_cred) */ static int @@ -1424,8 +1419,7 @@ ext2_access(struct vop_access_args *ap) } /* - * ext2_getattr(struct vnode *a_vp, struct vattr *a_vap, - * struct thread *a_td) + * ext2_getattr(struct vnode *a_vp, struct vattr *a_vap) */ /* ARGSUSED */ static @@ -1467,8 +1461,7 @@ ext2_getattr(struct vop_getattr_args *ap) /* * Set attribute vnode op. called from several syscalls * - * ext2_setattr(struct vnode *a_vp, struct vattr *a_vap, - * struct ucred *a_cred, struct thread *a_td) + * ext2_setattr(struct vnode *a_vp, struct vattr *a_vap, struct ucred *a_cred) */ static int @@ -1527,7 +1520,7 @@ ext2_setattr(struct vop_setattr_args *ap) if (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - if ((error = ext2_chown(vp, vap->va_uid, vap->va_gid, cred, ap->a_td)) != 0) + if ((error = ext2_chown(vp, vap->va_uid, vap->va_gid, cred)) != 0) return (error); } if (vap->va_size != VNOVAL) { @@ -1547,7 +1540,7 @@ ext2_setattr(struct vop_setattr_args *ap) default: break; } - if ((error = EXT2_TRUNCATE(vp, vap->va_size, 0, cred, ap->a_td)) != 0) + if ((error = EXT2_TRUNCATE(vp, vap->va_size, 0, cred)) != 0) return (error); } ip = VTOI(vp); @@ -1557,7 +1550,7 @@ ext2_setattr(struct vop_setattr_args *ap) if (cred->cr_uid != ip->i_uid && (error = suser_cred(cred, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, cred, ap->a_td)))) + (error = VOP_ACCESS(vp, VWRITE, cred)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) ip->i_flag |= IN_ACCESS; @@ -1580,7 +1573,7 @@ ext2_setattr(struct vop_setattr_args *ap) if (vap->va_mode != (mode_t)VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - error = ext2_chmod(vp, (int)vap->va_mode, cred, ap->a_td); + error = ext2_chmod(vp, (int)vap->va_mode, cred); } VN_KNOTE(vp, NOTE_ATTRIB); return (error); @@ -1591,7 +1584,7 @@ ext2_setattr(struct vop_setattr_args *ap) * Inode must be locked before calling. */ static int -ext2_chmod(struct vnode *vp, int mode, struct ucred *cred, struct thread *td) +ext2_chmod(struct vnode *vp, int mode, struct ucred *cred) { struct inode *ip = VTOI(vp); int error; @@ -1618,8 +1611,7 @@ ext2_chmod(struct vnode *vp, int mode, struct ucred *cred, struct thread *td) * inode must be locked prior to call. */ static int -ext2_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred, - struct thread *td) +ext2_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred) { struct inode *ip = VTOI(vp); uid_t ouid; @@ -1719,8 +1711,7 @@ good: * * NB Currently unsupported. * - * ext2_mmap(struct vnode *a_vp, int a_fflags, struct ucred *a_cred, - * struct thread *a_td) + * ext2_mmap(struct vnode *a_vp, int a_fflags, struct ucred *a_cred) */ /* ARGSUSED */ static @@ -1887,8 +1878,7 @@ ext2spec_write(struct vop_write_args *ap) * * Update the times on the inode then do device close. * - * ext2spec_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred, - * struct thread *a_td) + * ext2spec_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred) */ static int @@ -1953,8 +1943,7 @@ ext2fifo_write(struct vop_write_args *ap) * * Update the times on the inode then do device close. * - * ext2fifo_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred, - * struct thread *a_td) + * ext2fifo_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred) */ static int diff --git a/sys/vfs/gnu/ext2fs/ext2mount.h b/sys/vfs/gnu/ext2fs/ext2mount.h index 9dff6c9ff4..dca1081d3e 100644 --- a/sys/vfs/gnu/ext2fs/ext2mount.h +++ b/sys/vfs/gnu/ext2fs/ext2mount.h @@ -32,7 +32,7 @@ * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 * $FreeBSD: src/sys/ufs/ufs/ufsmount.h,v 1.17 1999/12/29 04:55:06 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2mount.h,v 1.2 2006/04/05 21:06:22 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2mount.h,v 1.3 2006/05/06 02:43:13 dillon Exp $ */ #ifndef _VFS_GNU_EXT2FS_EXT2MOUNT_H_ @@ -90,8 +90,7 @@ struct ext2mount { struct malloc_type *um_malloctype; /* The inodes malloctype */ int um_i_effnlink_valid; /* i_effnlink valid? */ int (*um_blkatoff) (struct vnode *, off_t, char **, struct buf **); - int (*um_truncate) (struct vnode *, off_t, int, struct ucred *, - struct thread *); + int (*um_truncate) (struct vnode *, off_t, int, struct ucred *); int (*um_update) (struct vnode *, int); int (*um_valloc) (struct vnode *, int, struct ucred *, struct vnode **); int (*um_vfree) (struct vnode *, ino_t, int); @@ -100,7 +99,7 @@ struct ext2mount { #define um_e2fsb um_e2fs->s_es #define EXT2_BLKATOFF(aa, bb, cc, dd) VFSTOEXT2((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) -#define EXT2_TRUNCATE(aa, bb, cc, dd, ee) VFSTOEXT2((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) +#define EXT2_TRUNCATE(aa, bb, cc, dd) VFSTOEXT2((aa)->v_mount)->um_truncate(aa, bb, cc, dd) #define EXT2_UPDATE(aa, bb) VFSTOEXT2((aa)->v_mount)->um_update(aa, bb) #define EXT2_VALLOC(aa, bb, cc, dd) VFSTOEXT2((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define EXT2_VFREE(aa, bb, cc) VFSTOEXT2((aa)->v_mount)->um_vfree(aa, bb, cc) diff --git a/sys/vfs/hpfs/hpfs.h b/sys/vfs/hpfs/hpfs.h index 5192070423..e3210da77d 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.18 2006/05/05 21:15:09 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs.h,v 1.19 2006/05/06 02:43:13 dillon Exp $ */ /*#define HPFS_DEBUG 10*/ @@ -401,7 +401,7 @@ typedef int (vop_t) (void *); #define HASHINIT(a, b, c, d) hashinit((a), (b), (d)) #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 VGET(a, b, c) vget((a), (b)) #define VN_LOCK(a, b, c) vn_lock((a), (b)) #define LOCKMGR(a, b, d) lockmgr((a), (b)) #endif @@ -413,7 +413,7 @@ void hpfs_hphashinit (void); int hpfs_hphash_uninit (struct vfsconf *); struct hpfsnode *hpfs_hphashlookup (dev_t, lsn_t); struct hpfsnode *hpfs_hphashget (dev_t, lsn_t); -struct vnode *hpfs_hphashvget (dev_t, lsn_t, struct thread *); +struct vnode *hpfs_hphashvget (dev_t, lsn_t); void hpfs_hphashins (struct hpfsnode *); void hpfs_hphashrem (struct hpfsnode *); extern struct lock hpfs_hphash_lock; diff --git a/sys/vfs/hpfs/hpfs_hash.c b/sys/vfs/hpfs/hpfs_hash.c index 8b2ec5d26e..7734c2019d 100644 --- a/sys/vfs/hpfs/hpfs_hash.c +++ b/sys/vfs/hpfs/hpfs_hash.c @@ -32,7 +32,7 @@ * * @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95 * $FreeBSD: src/sys/fs/hpfs/hpfs_hash.c,v 1.1 1999/12/09 19:09:58 semenu Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_hash.c,v 1.13 2006/03/02 19:08:00 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_hash.c,v 1.14 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -109,7 +109,7 @@ hpfs_hphashlookup(dev_t dev, lsn_t ino) } struct vnode * -hpfs_hphashvget(dev_t dev, lsn_t ino, struct thread *td) +hpfs_hphashvget(dev_t dev, lsn_t ino) { struct hpfsnode *hp; lwkt_tokref ilock; @@ -122,7 +122,7 @@ loop: continue; vp = HPTOV(hp); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* * We must check to see if the inode has been ripped diff --git a/sys/vfs/hpfs/hpfs_vfsops.c b/sys/vfs/hpfs/hpfs_vfsops.c index baf8d97229..97ee37e1a9 100644 --- a/sys/vfs/hpfs/hpfs_vfsops.c +++ b/sys/vfs/hpfs/hpfs_vfsops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.3.2.2 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.33 2006/04/23 03:08:04 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.34 2006/05/06 02:43:13 dillon Exp $ */ @@ -249,14 +249,14 @@ hpfs_mountfs(struct vnode *devvp, struct mount *mp, struct hpfs_args *argsp, return (EBUSY); VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = vinvalbuf(devvp, V_SAVE, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, 0, 0); VOP__UNLOCK(devvp, 0, td); if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL); VOP__UNLOCK(devvp, 0, td); if (error) return (error); @@ -338,7 +338,7 @@ failed: brelse (bp); mp->mnt_data = (qaddr_t)NULL; dev->si_mountpoint = NULL; - VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); + VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE); return (error); } @@ -367,8 +367,8 @@ hpfs_unmount(struct mount *mp, int mntflags, struct thread *td) hpmp->hpm_devvp->v_rdev->si_mountpoint = NULL; - vinvalbuf(hpmp->hpm_devvp, V_SAVE, td, 0, 0); - error = VOP_CLOSE(hpmp->hpm_devvp, ronly ? FREAD : FREAD|FWRITE, td); + vinvalbuf(hpmp->hpm_devvp, V_SAVE, 0, 0); + error = VOP_CLOSE(hpmp->hpm_devvp, ronly ? FREAD : FREAD|FWRITE); vrele(hpmp->hpm_devvp); @@ -463,7 +463,6 @@ hpfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) struct vnode *vp; struct hpfsnode *hp; struct buf *bp; - struct thread *td = curthread; /* XXX */ int error; dprintf(("hpfs_vget(0x%x): ",ino)); @@ -472,7 +471,7 @@ hpfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) hp = NULL; vp = NULL; - if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, td)) != NULL) { + if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino)) != NULL) { dprintf(("hashed\n")); return (0); } @@ -520,7 +519,7 @@ hpfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) vref(hp->h_devvp); do { - if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, td)) != NULL) { + if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino)) != NULL) { dprintf(("hashed2\n")); vx_put(vp); return (0); diff --git a/sys/vfs/hpfs/hpfs_vnops.c b/sys/vfs/hpfs/hpfs_vnops.c index b6d63c4899..906d00c7f5 100644 --- a/sys/vfs/hpfs/hpfs_vnops.c +++ b/sys/vfs/hpfs/hpfs_vnops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs_vnops.c,v 1.2.2.2 2002/01/15 18:35:09 semenu Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_vnops.c,v 1.33 2006/05/05 16:35:06 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_vnops.c,v 1.34 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -496,7 +496,6 @@ hpfs_setattr(struct vop_setattr_args *ap) struct hpfsnode *hp = VTOHP(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; int error; dprintf(("hpfs_setattr(0x%x):\n", hp->h_no)); @@ -537,7 +536,7 @@ hpfs_setattr(struct vop_setattr_args *ap) if (cred->cr_uid != hp->h_uid && (error = suser_cred(cred, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, cred, td)))) + (error = VOP_ACCESS(vp, VWRITE, cred)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) hp->h_atime = vap->va_atime.tv_sec; @@ -562,7 +561,7 @@ hpfs_setattr(struct vop_setattr_args *ap) if (vap->va_size < hp->h_fn.fn_size) { #if defined(__DragonFly__) - error = vtruncbuf(vp, td, vap->va_size, DEV_BSIZE); + error = vtruncbuf(vp, vap->va_size, DEV_BSIZE); if (error) return (error); #else /* defined(__NetBSD__) */ @@ -618,7 +617,7 @@ hpfs_inactive(struct vop_inactive_args *ap) if (hp->h_flag & H_INVAL) { #if defined(__DragonFly__) - vrecycle(vp, ap->a_td); + vrecycle(vp); #else /* defined(__NetBSD__) */ vgone(vp); #endif @@ -1048,7 +1047,7 @@ hpfs_lookup(struct vop_old_lookup_args *ap) return (EOPNOTSUPP); } - error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_td); + error = VOP_ACCESS(dvp, VEXEC, cred); if(error) return (error); @@ -1101,7 +1100,7 @@ hpfs_lookup(struct vop_old_lookup_args *ap) dep->de_fnode, dep->de_cpid)); if (nameiop == NAMEI_DELETE) { - error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_td); + error = VOP_ACCESS(dvp, VWRITE, cred); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/isofs/cd9660/cd9660_node.c b/sys/vfs/isofs/cd9660/cd9660_node.c index c98cf0e079..4f3e1fa7ac 100644 --- a/sys/vfs/isofs/cd9660/cd9660_node.c +++ b/sys/vfs/isofs/cd9660/cd9660_node.c @@ -37,7 +37,7 @@ * * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 * $FreeBSD: src/sys/isofs/cd9660/cd9660_node.c,v 1.29.2.1 2000/07/08 14:35:56 bp Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_node.c,v 1.16 2006/04/01 21:55:13 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_node.c,v 1.17 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -108,7 +108,6 @@ cd9660_uninit(struct vfsconf *vfsp) struct vnode * cd9660_ihashget(dev_t dev, ino_t inum) { - struct thread *td = curthread; /* XXX */ struct iso_node *ip; lwkt_tokref ilock; struct vnode *vp; @@ -119,7 +118,7 @@ loop: if (inum != ip->i_number || dev != ip->i_dev) continue; vp = ITOV(ip); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* * We must check to see if the inode has been ripped @@ -190,13 +189,12 @@ cd9660_ihashrem(struct iso_node *ip) * Last reference to an inode, write the inode out and if necessary, * truncate and deallocate the file. * - * cd9660_inactive(struct vnode *a_vp, struct thread *a_td) + * cd9660_inactive(struct vnode *a_vp) */ int cd9660_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; - struct thread *td = ap->a_td; struct iso_node *ip = VTOI(vp); int error = 0; @@ -210,7 +208,7 @@ cd9660_inactive(struct vop_inactive_args *ap) * so that it can be reused immediately. */ if (ip == NULL || ip->inode.iso_mode == 0) - vrecycle(vp, td); + vrecycle(vp); return error; } diff --git a/sys/vfs/isofs/cd9660/cd9660_vfsops.c b/sys/vfs/isofs/cd9660/cd9660_vfsops.c index fb1aca7c55..f695f20b2a 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.34 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.35 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -152,14 +152,14 @@ iso_mountroot(struct mount *mp, struct thread *td) args.flags = ISOFSMNT_ROOT; vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(rootvp, FREAD, FSCRED, NULL, td); + error = VOP_OPEN(rootvp, FREAD, FSCRED, NULL); VOP_UNLOCK(rootvp, 0); if (error) return (error); args.ssector = iso_get_ssector(rootdev, td); - VOP_CLOSE(rootvp, FREAD, td); + VOP_CLOSE(rootvp, FREAD); if (bootverbose) printf("iso_mountroot(): using session at block %d\n", @@ -232,7 +232,7 @@ cd9660_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) */ accessmode = VREAD; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_ACCESS(devvp, accessmode, td->td_proc->p_ucred, td); + error = VOP_ACCESS(devvp, accessmode, td->td_proc->p_ucred); if (error) error = suser(td); if (error) { @@ -297,11 +297,11 @@ iso_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, return error; if (count_udev(devvp->v_udev) > 0) return EBUSY; - if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0))) + if ((error = vinvalbuf(devvp, V_SAVE, 0, 0))) return (error); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); + error = VOP_OPEN(devvp, FREAD, FSCRED, NULL); VOP_UNLOCK(devvp, 0); if (error) return error; @@ -524,7 +524,7 @@ out: if (supbp) brelse(supbp); if (needclose) - VOP_CLOSE(devvp, FREAD, td); + VOP_CLOSE(devvp, FREAD); if (isomp) { free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; @@ -554,7 +554,7 @@ cd9660_unmount(struct mount *mp, int mntflags, struct thread *td) isomp = VFSTOISOFS(mp); isomp->im_devvp->v_rdev->si_mountpoint = NULL; - error = VOP_CLOSE(isomp->im_devvp, FREAD, td); + error = VOP_CLOSE(isomp->im_devvp, FREAD); vrele(isomp->im_devvp); free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; diff --git a/sys/vfs/isofs/cd9660/cd9660_vnops.c b/sys/vfs/isofs/cd9660/cd9660_vnops.c index dec49ca0e5..ca979fbbbe 100644 --- a/sys/vfs/isofs/cd9660/cd9660_vnops.c +++ b/sys/vfs/isofs/cd9660/cd9660_vnops.c @@ -37,7 +37,7 @@ * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 * $FreeBSD: src/sys/isofs/cd9660/cd9660_vnops.c,v 1.62 1999/12/15 23:01:51 eivind Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.24 2006/04/07 06:38:31 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.25 2006/05/06 02:43:13 dillon Exp $ */ #include @@ -231,7 +231,7 @@ cd9660_getattr(struct vop_getattr_args *ap) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = ap->a_td; + auio.uio_td = curthread; auio.uio_resid = MAXPATHLEN; rdlnk.a_uio = &auio; rdlnk.a_vp = ap->a_vp; diff --git a/sys/vfs/mfs/mfs_vnops.c b/sys/vfs/mfs/mfs_vnops.c index c53fffd5bb..17b467e121 100644 --- a/sys/vfs/mfs/mfs_vnops.c +++ b/sys/vfs/mfs/mfs_vnops.c @@ -32,7 +32,7 @@ * * @(#)mfs_vnops.c 8.11 (Berkeley) 5/22/95 * $FreeBSD: src/sys/ufs/mfs/mfs_vnops.c,v 1.47.2.1 2001/05/22 02:06:43 bp Exp $ - * $DragonFly: src/sys/vfs/mfs/mfs_vnops.c,v 1.26 2006/05/05 16:35:07 dillon Exp $ + * $DragonFly: src/sys/vfs/mfs/mfs_vnops.c,v 1.27 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -347,7 +347,7 @@ mfs_close(struct vop_close_args *ap) /* * Synchronize any remaining buffers and then destroy them. */ - if ((error = vinvalbuf(vp, V_SAVE, ap->a_td, 0, 0)) != 0) + if ((error = vinvalbuf(vp, V_SAVE, 0, 0)) != 0) goto done; /* diff --git a/sys/vfs/msdosfs/denode.h b/sys/vfs/msdosfs/denode.h index b3f8fcdef1..5f1bf71d01 100644 --- a/sys/vfs/msdosfs/denode.h +++ b/sys/vfs/msdosfs/denode.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/denode.h,v 1.20 1999/12/29 04:54:52 peter Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/denode.h,v 1.10 2005/09/14 01:13:38 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/denode.h,v 1.11 2006/05/06 02:43:14 dillon Exp $ */ /* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */ /*- @@ -278,6 +278,6 @@ int dosdirempty (struct denode *dep); int createde (struct denode *dep, struct denode *ddep, struct denode **depp, struct componentname *cnp); int deupdat (struct denode *dep, int waitfor); int removede (struct denode *pdep, struct denode *dep); -int detrunc (struct denode *dep, u_long length, int flags, struct thread *td); +int detrunc (struct denode *dep, u_long length, int flags); int doscheckpath ( struct denode *source, struct denode *target); #endif /* _KERNEL */ diff --git a/sys/vfs/msdosfs/msdosfs_denode.c b/sys/vfs/msdosfs/msdosfs_denode.c index 880bdc9edd..1cb7bc072a 100644 --- a/sys/vfs/msdosfs/msdosfs_denode.c +++ b/sys/vfs/msdosfs/msdosfs_denode.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_denode.c,v 1.47.2.3 2002/08/22 16:20:15 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_denode.c,v 1.23 2006/04/07 06:38:32 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_denode.c,v 1.24 2006/05/06 02:43:14 dillon Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */ /*- @@ -124,7 +124,6 @@ msdosfs_uninit(struct vfsconf *vfsp) static struct denode * msdosfs_hashget(dev_t dev, u_long dirclust, u_long diroff) { - struct thread *td = curthread; /* XXX */ struct denode *dep; lwkt_tokref ilock; struct vnode *vp; @@ -139,7 +138,7 @@ loop: continue; } vp = DETOV(dep); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* @@ -463,7 +462,7 @@ deupdat(struct denode *dep, int waitfor) * Truncate the file described by dep to the length specified by length. */ int -detrunc(struct denode *dep, u_long length, int flags, struct thread *td) +detrunc(struct denode *dep, u_long length, int flags) { int error; int allerror; @@ -562,7 +561,7 @@ detrunc(struct denode *dep, u_long length, int flags, struct thread *td) dep->de_FileSize = length; if (!isadir) dep->de_flag |= DE_UPDATE|DE_MODIFIED; - allerror = vtruncbuf(DETOV(dep), td, length, pmp->pm_bpcluster); + allerror = vtruncbuf(DETOV(dep), length, pmp->pm_bpcluster); #ifdef MSDOSFS_DEBUG if (allerror) printf("detrunc(): vtruncbuf error %d\n", allerror); @@ -637,7 +636,7 @@ deextend(struct denode *dep, u_long length) error = extendfile(dep, count, NULL, NULL, DE_CLEAR); if (error) { /* truncate the added clusters away again */ - detrunc(dep, dep->de_FileSize, 0, NULL); + detrunc(dep, dep->de_FileSize, 0); return (error); } } @@ -710,7 +709,7 @@ msdosfs_inactive(struct vop_inactive_args *ap) dep, dep->de_refcnt, vp->v_mount->mnt_flag, MNT_RDONLY); #endif if (dep->de_refcnt <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { - error = detrunc(dep, (u_long) 0, 0, ap->a_td); + error = detrunc(dep, (u_long) 0, 0); dep->de_flag |= DE_UPDATE; dep->de_Name[0] = SLOT_DELETED; } @@ -726,6 +725,6 @@ out: dep->de_Name[0]); #endif if (dep->de_Name[0] == SLOT_DELETED) - vrecycle(vp, ap->a_td); + vrecycle(vp); return (error); } diff --git a/sys/vfs/msdosfs/msdosfs_lookup.c b/sys/vfs/msdosfs/msdosfs_lookup.c index 32b1824a5a..4e2d861949 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.18 2006/05/05 21:15:10 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.19 2006/05/06 02:43:14 dillon Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */ /*- @@ -337,7 +337,7 @@ notfound: * Access for write is interpreted as allowing * creation of files in the directory. */ - error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_td); + error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred); if (error) return (error); /* @@ -429,7 +429,7 @@ foundroot: /* * Write access to directory required to delete files. */ - error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_td); + error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred); if (error) return (error); @@ -463,7 +463,7 @@ foundroot: if (blkoff == MSDOSFSROOT_OFS) return EROFS; /* really? XXX */ - error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_td); + error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred); if (error) return (error); @@ -575,7 +575,7 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, dirclust = de_clcount(pmp, diroffset); error = extendfile(ddep, dirclust, 0, 0, DE_CLEAR); if (error) { - detrunc(ddep, ddep->de_FileSize, 0, NULL); + detrunc(ddep, ddep->de_FileSize, 0); return error; } diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index 52b91e1aeb..003da516c8 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.32 2006/05/05 21:15:10 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.33 2006/05/06 02:43:14 dillon Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -100,7 +100,7 @@ static int msdosfs_mount (struct mount *, char *, caddr_t, static int msdosfs_root (struct mount *, struct vnode **); static int msdosfs_statfs (struct mount *, struct statfs *, struct thread *); -static int msdosfs_sync (struct mount *, int, struct thread *); +static int msdosfs_sync (struct mount *, int); static int msdosfs_unmount (struct mount *, int, struct thread *); static int msdosfs_vptofh (struct vnode *, struct fid *); @@ -207,7 +207,7 @@ msdosfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) devvp = pmp->pm_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(devvp, VREAD | VWRITE, - p->p_ucred, td); + p->p_ucred); if (error) { VOP_UNLOCK(devvp, 0); return (error); @@ -258,7 +258,7 @@ msdosfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_ACCESS(devvp, accessmode, p->p_ucred, td); + error = VOP_ACCESS(devvp, accessmode, p->p_ucred); if (error) { vput(devvp); return (error); @@ -326,14 +326,14 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td, if (count_udev(devvp->v_udev) > 0) return (EBUSY); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = vinvalbuf(devvp, V_SAVE, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, 0, 0); VOP_UNLOCK(devvp, 0); if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL); VOP_UNLOCK(devvp, 0); if (error) return (error); @@ -353,7 +353,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td, * that the size of a disk block will always be 512 bytes. * Let's check it... */ - error = VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, td); + error = VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD); if (error) goto error_exit; tmp = dpart.part->p_fstype; @@ -669,7 +669,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td, error_exit: if (bp) brelse(bp); - VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, td); + VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE); if (pmp) { if (pmp->pm_inusemap) free(pmp->pm_inusemap, M_MSDOSFSFAT); @@ -719,8 +719,7 @@ msdosfs_unmount(struct mount *mp, int mntflags, struct thread *td) } #endif error = VOP_CLOSE(pmp->pm_devvp, - (pmp->pm_flags&MSDOSFSMNT_RONLY) ? FREAD : FREAD | FWRITE, - td); + (pmp->pm_flags&MSDOSFSMNT_RONLY) ? FREAD : FREAD | FWRITE); vrele(pmp->pm_devvp); free(pmp->pm_inusemap, M_MSDOSFSFAT); free(pmp, M_MSDOSFSMNT); @@ -771,13 +770,12 @@ struct scaninfo { int rescan; int allerror; int waitfor; - thread_t td; }; static int msdosfs_sync_scan(struct mount *mp, struct vnode *vp, void *data); static int -msdosfs_sync(struct mount *mp, int waitfor, struct thread *td) +msdosfs_sync(struct mount *mp, int waitfor) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); struct scaninfo scaninfo; @@ -799,7 +797,6 @@ msdosfs_sync(struct mount *mp, int waitfor, struct thread *td) */ scaninfo.allerror = 0; scaninfo.rescan = 1; - scaninfo.td = td; while (scaninfo.rescan) { scaninfo.rescan = 0; vmntvnodescan(mp, VMSC_GETVP|VMSC_NOWAIT, NULL, msdosfs_sync_scan, &scaninfo); @@ -810,7 +807,7 @@ msdosfs_sync(struct mount *mp, int waitfor, struct thread *td) */ if (waitfor != MNT_LAZY) { vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY); - if ((error = VOP_FSYNC(pmp->pm_devvp, waitfor, td)) != 0) + if ((error = VOP_FSYNC(pmp->pm_devvp, waitfor)) != 0) scaninfo.allerror = error; VOP_UNLOCK(pmp->pm_devvp, 0); } @@ -831,7 +828,7 @@ msdosfs_sync_scan(struct mount *mp, struct vnode *vp, void *data) (RB_EMPTY(&vp->v_rbdirty_tree) || info->waitfor == MNT_LAZY))) { return(0); } - if ((error = VOP_FSYNC(vp, info->waitfor, info->td)) != 0) + if ((error = VOP_FSYNC(vp, info->waitfor)) != 0) info->allerror = error; return(0); } diff --git a/sys/vfs/msdosfs/msdosfs_vnops.c b/sys/vfs/msdosfs/msdosfs_vnops.c index 9496c10774..21eaaf7be6 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.36 2006/05/05 21:15:10 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.37 2006/05/06 02:43:14 dillon Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -485,7 +485,7 @@ msdosfs_setattr(struct vop_setattr_args *ap) default: break; } - error = detrunc(dep, vap->va_size, 0, ap->a_td); + error = detrunc(dep, vap->va_size, 0); if (error) return error; } @@ -495,7 +495,7 @@ msdosfs_setattr(struct vop_setattr_args *ap) if (cred->cr_uid != pmp->pm_uid && (error = suser_cred(cred, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_td)))) + (error = VOP_ACCESS(ap->a_vp, VWRITE, cred)))) return (error); if (vp->v_type != VDIR) { if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && @@ -836,11 +836,11 @@ msdosfs_write(struct vop_write_args *ap) errexit: if (error) { if (ioflag & IO_UNIT) { - detrunc(dep, osize, ioflag & IO_SYNC, NULL); + detrunc(dep, osize, ioflag & IO_SYNC); uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } else { - detrunc(dep, dep->de_FileSize, ioflag & IO_SYNC, NULL); + detrunc(dep, dep->de_FileSize, ioflag & IO_SYNC); if (uio->uio_resid != resid) error = 0; } @@ -1080,7 +1080,7 @@ abortit: * to namei, as the parent directory is unlocked by the * call to doscheckpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred); VOP_UNLOCK(fvp, 0); if (VTODE(fdvp)->de_StartCluster != VTODE(tdvp)->de_StartCluster) newparent = 1; @@ -1481,9 +1481,7 @@ msdosfs_rmdir(struct vop_old_rmdir_args *ap) { struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; - struct componentname *cnp = ap->a_cnp; struct denode *ip, *dp; - struct thread *td = cnp->cn_td; int error; ip = VTODE(vp); @@ -1521,7 +1519,7 @@ msdosfs_rmdir(struct vop_old_rmdir_args *ap) /* * Truncate the directory that is being deleted. */ - error = detrunc(ip, (u_long)0, IO_SYNC, td); + error = detrunc(ip, (u_long)0, IO_SYNC); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); out: diff --git a/sys/vfs/nfs/nfs.h b/sys/vfs/nfs/nfs.h index 0b8fe122f0..205c016043 100644 --- a/sys/vfs/nfs/nfs.h +++ b/sys/vfs/nfs/nfs.h @@ -35,7 +35,7 @@ * * @(#)nfs.h 8.4 (Berkeley) 5/1/95 * $FreeBSD: src/sys/nfs/nfs.h,v 1.53.2.5 2002/02/20 01:35:34 iedowse Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs.h,v 1.17 2006/05/05 16:35:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs.h,v 1.18 2006/05/06 02:43:14 dillon Exp $ */ #ifndef _NFS_NFS_H_ @@ -600,7 +600,7 @@ void nfs_sndunlock (struct nfsreq *); int nfs_slplock (struct nfssvc_sock *, int); void nfs_slpunlock (struct nfssvc_sock *); int nfs_disct (struct mbuf **, caddr_t *, int, int, caddr_t *); -int nfs_vinvalbuf (struct vnode *, int, struct thread *, int); +int nfs_vinvalbuf (struct vnode *, int, int); int nfs_readrpc (struct vnode *, struct uio *); int nfs_writerpc (struct vnode *, struct uio *, int *, int *); int nfs_commit (struct vnode *vp, u_quad_t offset, int cnt, diff --git a/sys/vfs/nfs/nfs_bio.c b/sys/vfs/nfs/nfs_bio.c index dd9d272714..58bc46ab44 100644 --- a/sys/vfs/nfs/nfs_bio.c +++ b/sys/vfs/nfs/nfs_bio.c @@ -35,7 +35,7 @@ * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 * $FreeBSD: /repoman/r/ncvs/src/sys/nfsclient/nfs_bio.c,v 1.130 2004/04/14 23:23:55 peadar Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.35 2006/05/05 16:35:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.36 2006/05/06 02:43:14 dillon Exp $ */ @@ -384,18 +384,18 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag) */ if ((np->n_flag & NLMODIFIED) && vp->v_type == VDIR) { nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); if (error) return (error); np->n_attrstamp = 0; } - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); if (np->n_flag & NRMODIFIED) { if (vp->v_type == VDIR) nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); if (error) return (error); np->n_flag &= ~NRMODIFIED; @@ -559,7 +559,7 @@ again: while (error == NFSERR_BAD_COOKIE) { printf("got bad cookie vp %p bp %p\n", vp, bp); nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, 0, td, 1); + error = nfs_vinvalbuf(vp, 0, 1); /* * Yuck! The directory has been modified on the * server. The only way to get the block is by @@ -785,7 +785,7 @@ nfs_write(struct vop_write_args *ap) if (np->n_flag & NLMODIFIED) { np->n_attrstamp = 0; error = nfs_flush(vp, MNT_WAIT, td, 0); - /* error = nfs_vinvalbuf(vp, V_SAVE, td, 1); */ + /* error = nfs_vinvalbuf(vp, V_SAVE, 1); */ if (error) return (error); } @@ -798,7 +798,7 @@ nfs_write(struct vop_write_args *ap) restart: if (ioflag & IO_APPEND) { np->n_attrstamp = 0; - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); uio->uio_offset = np->n_size; @@ -1055,7 +1055,7 @@ again: if (error) break; if (np->n_flag & NDONTCACHE) { - error = nfs_vinvalbuf(vp, V_SAVE, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); if (error) break; } @@ -1122,12 +1122,12 @@ nfs_getcacheblk(struct vnode *vp, off_t loffset, int size, struct thread *td) * doing the flush, just wait for completion. */ int -nfs_vinvalbuf(struct vnode *vp, int flags, - struct thread *td, int intrflg) +nfs_vinvalbuf(struct vnode *vp, int flags, int intrflg) { struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp = VFSTONFS(vp->v_mount); int error = 0, slpflag, slptimeo; + thread_t td = curthread; if (vp->v_flag & VRECLAIMED) return (0); @@ -1147,7 +1147,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, while (np->n_flag & NFLUSHINPROG) { np->n_flag |= NFLUSHWANT; error = tsleep((caddr_t)&np->n_flag, 0, "nfsvinval", slptimeo); - if (error && intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, td)) + if (error && intrflg && nfs_sigintr(nmp, NULL, td)) return (EINTR); } @@ -1155,9 +1155,9 @@ nfs_vinvalbuf(struct vnode *vp, int flags, * Now, flush as required. */ np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, flags, slpflag, 0); while (error) { - if (intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, td)) { + if (intrflg && nfs_sigintr(nmp, NULL, td)) { np->n_flag &= ~NFLUSHINPROG; if (np->n_flag & NFLUSHWANT) { np->n_flag &= ~NFLUSHWANT; @@ -1165,7 +1165,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, } return (EINTR); } - error = vinvalbuf(vp, flags, td, 0, slptimeo); + error = vinvalbuf(vp, flags, 0, slptimeo); } np->n_flag &= ~(NLMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { @@ -1553,7 +1553,7 @@ nfs_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize) * truncation point. We may have a B_DELWRI and/or B_CACHE * buffer that now needs to be truncated. */ - error = vtruncbuf(vp, td, nsize, biosize); + error = vtruncbuf(vp, nsize, biosize); lbn = nsize / biosize; bufsize = nsize & (biosize - 1); loffset = nsize - bufsize; diff --git a/sys/vfs/nfs/nfs_node.c b/sys/vfs/nfs/nfs_node.c index 13843ee8a7..0566eab487 100644 --- a/sys/vfs/nfs/nfs_node.c +++ b/sys/vfs/nfs/nfs_node.c @@ -35,7 +35,7 @@ * * @(#)nfs_node.c 8.6 (Berkeley) 5/22/95 * $FreeBSD: src/sys/nfs/nfs_node.c,v 1.36.2.3 2002/01/05 22:25:04 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_node.c,v 1.22 2006/03/27 16:18:39 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_node.c,v 1.23 2006/05/06 02:43:14 dillon Exp $ */ @@ -85,7 +85,6 @@ static int nfs_node_hash_lock; int nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp) { - struct thread *td = curthread; /* XXX */ struct nfsnode *np, *np2; struct nfsnodehashhead *nhpp; struct vnode *vp; @@ -113,7 +112,7 @@ loop: continue; } vp = NFSTOV(np); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; for (np = nhpp->lh_first; np; np = np->n_hash.le_next) { if (mntp == NFSTOV(np)->v_mount && @@ -227,7 +226,7 @@ nfs_inactive(struct vop_inactive_args *ap) * associated with discarding the buffers. The vnode * is already locked. */ - nfs_vinvalbuf(ap->a_vp, 0, ap->a_td, 1); + nfs_vinvalbuf(ap->a_vp, 0, 1); /* * Either we have the only ref or we were vgone()'d via diff --git a/sys/vfs/nfs/nfs_serv.c b/sys/vfs/nfs/nfs_serv.c index af4b44df62..e047daf76a 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.34 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_serv.c,v 1.35 2006/05/06 02:43:14 dillon Exp $ */ /* @@ -200,7 +200,7 @@ nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if ((nfsmode & testmode) && nfsrv_access(vp, VEXEC, cred, rdonly, td, 0)) nfsmode &= ~testmode; - getret = VOP_GETATTR(vp, vap, td); + getret = VOP_GETATTR(vp, vap); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED); @@ -247,7 +247,7 @@ nfsrv_getattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = 0; goto nfsmout; } - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); vput(vp); vp = NULL; nfsm_reply(NFSX_FATTR(nfsd->nd_flag & ND_NFSV3)); @@ -352,7 +352,7 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, */ if (v3) { - error = preat_ret = VOP_GETATTR(vp, &preat, td); + error = preat_ret = VOP_GETATTR(vp, &preat); if (!error && gcheck && (preat.va_ctime.tv_sec != guard.tv_sec || preat.va_ctime.tv_nsec != guard.tv_nsec)) @@ -385,8 +385,8 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, goto out; } } - error = VOP_SETATTR(vp, vap, cred, td); - postat_ret = VOP_GETATTR(vp, vap, td); + error = VOP_SETATTR(vp, vap, cred); + postat_ret = VOP_GETATTR(vp, vap); if (!error) error = postat_ret; out: @@ -460,7 +460,7 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if (error) { if (dirp) { if (v3) - dirattr_ret = VOP_GETATTR(dirp, &dirattr, td); + dirattr_ret = VOP_GETATTR(dirp, &dirattr); vrele(dirp); dirp = NULL; } @@ -534,7 +534,7 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if (dirp) { if (v3) - dirattr_ret = VOP_GETATTR(dirp, &dirattr, td); + dirattr_ret = VOP_GETATTR(dirp, &dirattr); vrele(dirp); dirp = NULL; } @@ -567,7 +567,7 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); vput(vp); vp = NULL; @@ -674,7 +674,7 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, } error = VOP_READLINK(vp, uiop, cred); out: - getret = VOP_GETATTR(vp, &attr, td); + getret = VOP_GETATTR(vp, &attr); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_UNSIGNED); @@ -773,7 +773,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if ((error = nfsrv_access(vp, VREAD, cred, rdonly, td, 1)) != 0) error = nfsrv_access(vp, VEXEC, cred, rdonly, td, 1); } - getret = VOP_GETATTR(vp, vap, td); + getret = VOP_GETATTR(vp, vap); if (!error) error = getret; if (error) { @@ -911,7 +911,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, off = uiop->uio_offset; nh->nh_nextr = off; FREE((caddr_t)iv2, M_TEMP); - if (error || (getret = VOP_GETATTR(vp, vap, td))) { + if (error || (getret = VOP_GETATTR(vp, vap))) { if (!error) error = getret; m_freem(mreq); @@ -1050,7 +1050,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, goto nfsmout; } if (v3) - forat_ret = VOP_GETATTR(vp, &forat, td); + forat_ret = VOP_GETATTR(vp, &forat); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1106,7 +1106,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsstats.srvvop_writes++; FREE((caddr_t)iv, M_TEMP); } - aftat_ret = VOP_GETATTR(vp, vap, td); + aftat_ret = VOP_GETATTR(vp, vap); vput(vp); vp = NULL; if (!error) @@ -1332,7 +1332,7 @@ loop1: nfsd->nd_nam, &rdonly, (nfsd->nd_flag & ND_KERBAUTH), TRUE); if (!error) { if (v3) - forat_ret = VOP_GETATTR(vp, &forat, td); + forat_ret = VOP_GETATTR(vp, &forat); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1386,7 +1386,7 @@ loop1: } m_freem(mrep); if (vp) { - aftat_ret = VOP_GETATTR(vp, &va, td); + aftat_ret = VOP_GETATTR(vp, &va); vput(vp); vp = NULL; } @@ -1580,7 +1580,7 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); } else { vrele(dirp); dirp = NULL; @@ -1670,7 +1670,7 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, VATTR_NULL(vap); bcopy(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF); - error = VOP_SETATTR(vp, vap, cred, td); + error = VOP_SETATTR(vp, vap, cred); } } } else if ( @@ -1744,7 +1744,7 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, tempsize = vap->va_size; VATTR_NULL(vap); vap->va_size = tempsize; - error = VOP_SETATTR(vp, vap, cred, td); + error = VOP_SETATTR(vp, vap, cred); } } } @@ -1754,13 +1754,13 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); } if (v3) { if (exclusive_flag && !error && bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF)) error = EEXIST; - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); vrele(dirp); dirp = NULL; } @@ -1847,7 +1847,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhp, len, slp, nam, &md, &dpos, &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); if (error) { nfsm_reply(NFSX_WCCDATA(1)); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -1935,13 +1935,13 @@ out: fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); } if (vp) { vput(vp); vp = NULL; } - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); if (dirp) { vrele(dirp); dirp = NULL; @@ -2009,7 +2009,7 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); } if (error == 0) { if (vp->v_type == VDIR) { @@ -2040,7 +2040,7 @@ out: } } if (dirp && v3) - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); nfsm_reply(NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -2117,7 +2117,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (fdirp) { if (v3) - fdirfor_ret = VOP_GETATTR(fdirp, &fdirfor, td); + fdirfor_ret = VOP_GETATTR(fdirp, &fdirfor); } if (error) { nfsm_reply(2 * NFSX_WCCDATA(v3)); @@ -2143,7 +2143,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (tdirp) { if (v3) - tdirfor_ret = VOP_GETATTR(tdirp, &tdirfor, td); + tdirfor_ret = VOP_GETATTR(tdirp, &tdirfor); } if (error) goto out1; @@ -2248,9 +2248,9 @@ out: out1: if (fdirp) - fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, td); + fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft); if (tdirp) - tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, td); + tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft); nfsm_reply(2 * NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft); @@ -2326,7 +2326,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); } if (error) goto out1; @@ -2345,9 +2345,9 @@ out: out1: if (v3) - getret = VOP_GETATTR(xp, &at, td); + getret = VOP_GETATTR(xp, &at); if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { nfsm_srvpostop_attr(getret, &at); @@ -2414,7 +2414,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); } if (error) goto out; @@ -2452,7 +2452,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); } #if 0 @@ -2482,7 +2482,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(nd.ni_vp, vap, td); + error = VOP_GETATTR(nd.ni_vp, vap); vput(nd.ni_vp); nd.ni_vp = NULL; } @@ -2499,7 +2499,7 @@ out: pathcp = NULL; } if (dirp) { - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); vrele(dirp); dirp = NULL; } @@ -2567,7 +2567,7 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); } if (error) { nfsm_reply(NFSX_WCCDATA(v3)); @@ -2608,11 +2608,11 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (error == 0) - error = VOP_GETATTR(vp, vap, td); + error = VOP_GETATTR(vp, vap); } out: if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); nfsm_reply(NFSX_SRVFH(v3) + NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { if (!error) { @@ -2676,7 +2676,7 @@ nfsrv_rmdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor); } if (error) { nfsm_reply(NFSX_WCCDATA(v3)); @@ -2707,7 +2707,7 @@ out: nlookup_done(&nd); if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, td); + diraft_ret = VOP_GETATTR(dirp, &diraft); nfsm_reply(NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -2833,7 +2833,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, */ if (v3) { - error = getret = VOP_GETATTR(vp, &at, td); + error = getret = VOP_GETATTR(vp, &at); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -2879,7 +2879,7 @@ again: if (!cookies && !error) error = NFSERR_PERM; if (v3) { - getret = VOP_GETATTR(vp, &at, td); + getret = VOP_GETATTR(vp, &at); if (!error) error = getret; } @@ -3114,7 +3114,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = 0; goto nfsmout; } - error = getret = VOP_GETATTR(vp, &at, td); + error = getret = VOP_GETATTR(vp, &at); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3153,7 +3153,7 @@ again: } error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (u_quad_t)io.uio_offset; - getret = VOP_GETATTR(vp, &at, td); + getret = VOP_GETATTR(vp, &at); VOP_UNLOCK(vp, 0); if (!cookies && !error) error = NFSERR_PERM; @@ -3273,7 +3273,7 @@ again: nvp = NULL; goto invalid; } - if (VOP_GETATTR(nvp, vap, td)) { + if (VOP_GETATTR(nvp, vap)) { vput(nvp); nvp = NULL; goto invalid; @@ -3430,7 +3430,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = 0; goto nfsmout; } - for_ret = VOP_GETATTR(vp, &bfor, td); + for_ret = VOP_GETATTR(vp, &bfor); if (cnt > MAX_COMMIT_COUNT) { /* @@ -3440,7 +3440,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) { vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); } - error = VOP_FSYNC(vp, MNT_WAIT, td); + error = VOP_FSYNC(vp, MNT_WAIT); } else { /* * Locate and synchronously write any buffers that fall @@ -3498,7 +3498,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, crit_exit(); } - aft_ret = VOP_GETATTR(vp, &aft, td); + aft_ret = VOP_GETATTR(vp, &aft); vput(vp); vp = NULL; nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF); @@ -3558,7 +3558,7 @@ nfsrv_statfs(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, } sf = &statfs; error = VFS_STATFS(vp->v_mount, sf, td); - getret = VOP_GETATTR(vp, &at, td); + getret = VOP_GETATTR(vp, &at); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_STATFS(v3)); @@ -3640,7 +3640,7 @@ nfsrv_fsinfo(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, VFS_STATFS(vp->v_mount, &sb, td); maxfsize = (u_quad_t)0x80000000 * sb.f_bsize - 1; - getret = VOP_GETATTR(vp, &at, td); + getret = VOP_GETATTR(vp, &at); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3FSINFO); @@ -3717,7 +3717,7 @@ nfsrv_pathconf(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = VOP_PATHCONF(vp, _PC_CHOWN_RESTRICTED, &chownres); if (!error) error = VOP_PATHCONF(vp, _PC_NO_TRUNC, ¬runc); - getret = VOP_GETATTR(vp, &at, td); + getret = VOP_GETATTR(vp, &at); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3PATHCONF); @@ -3833,10 +3833,10 @@ nfsrv_access(struct vnode *vp, int flags, struct ucred *cred, if (vp->v_flag & VTEXT) return (ETXTBSY); } - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); - error = VOP_ACCESS(vp, flags, cred, td); + error = VOP_ACCESS(vp, flags, cred); /* * Allow certain operations for the owner (reads and writes * on files that are already open). diff --git a/sys/vfs/nfs/nfs_vfsops.c b/sys/vfs/nfs/nfs_vfsops.c index 6eccaf35bd..924f1eb2ae 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.40 2006/05/05 21:27:57 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.41 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_bootp.h" @@ -123,8 +123,7 @@ static int nfs_unmount ( struct mount *mp, int mntflags, static int nfs_root ( struct mount *mp, struct vnode **vpp); static int nfs_statfs ( struct mount *mp, struct statfs *sbp, struct thread *td); -static int nfs_sync ( struct mount *mp, int waitfor, - struct thread *td); +static int nfs_sync ( struct mount *mp, int waitfor); /* * nfs vfs operations. @@ -497,7 +496,7 @@ nfs_mountroot(mp) nd->myif.ifra_addr.sa_family, error); } - error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); + error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, proc0.p_ucred); if (error) panic("nfs_mountroot: SIOCAIFADDR: %d", error); @@ -1096,7 +1095,7 @@ nfs_root(mp, vpp) nfs_fsinfo(nmp, vp, curthread); mp->mnt_stat.f_iosize = nfs_iosize(1, nmp->nm_sotype); } else { - if ((error = VOP_GETATTR(vp, &attrs, curthread)) == 0) + if ((error = VOP_GETATTR(vp, &attrs)) == 0) nmp->nm_state |= NFSSTA_GOTFSINFO; } @@ -1112,7 +1111,6 @@ extern int syncprt; struct scaninfo { int rescan; - thread_t td; int waitfor; int allerror; }; @@ -1125,13 +1123,12 @@ static int nfs_sync_scan2(struct mount *mp, struct vnode *vp, void *data); */ /* ARGSUSED */ static int -nfs_sync(struct mount *mp, int waitfor, struct thread *td) +nfs_sync(struct mount *mp, int waitfor) { struct scaninfo scaninfo; int error; scaninfo.rescan = 0; - scaninfo.td = td; scaninfo.waitfor = waitfor; scaninfo.allerror = 0; @@ -1167,7 +1164,7 @@ nfs_sync_scan2(struct mount *mp, struct vnode *vp, void *data) struct scaninfo *info = data; int error; - error = VOP_FSYNC(vp, info->waitfor, info->td); + error = VOP_FSYNC(vp, info->waitfor); if (error) info->allerror = error; return(0); diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index d3b2f497c7..71903c4f7f 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.60 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.61 2006/05/06 02:43:14 dillon Exp $ */ @@ -308,6 +308,7 @@ static int nfs_access(struct vop_access_args *ap) { struct vnode *vp = ap->a_vp; + thread_t td = curthread; int error = 0; u_int32_t mode, wmode; int v3 = NFS_ISV3(vp); @@ -376,7 +377,7 @@ nfs_access(struct vop_access_args *ap) * Either a no, or a don't know. Go to the wire. */ nfsstats.accesscache_misses++; - error = nfs3_access_otw(vp, wmode, ap->a_td,ap->a_cred); + error = nfs3_access_otw(vp, wmode, td, ap->a_cred); if (!error) { if ((np->n_mode & mode) != mode) { error = EACCES; @@ -408,7 +409,7 @@ nfs_access(struct vop_access_args *ap) auio.uio_resid = 1; auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_READ; - auio.uio_td = ap->a_td; + auio.uio_td = td; if (vp->v_type == VREG) { error = nfs_readrpc(vp, &auio); @@ -455,8 +456,7 @@ nfs_access(struct vop_access_args *ap) * For paged in text files, you will need to flush the page cache * if consistency is lost. * - * nfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred, - * struct thread *a_td) + * nfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred) */ /* ARGSUSED */ static int @@ -502,19 +502,19 @@ nfs_open(struct vop_open_args *ap) if (np->n_flag & NLMODIFIED) { np->n_attrstamp = 0; if (vp->v_type == VDIR) { - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); if (error == EINTR) return (error); nfs_invaldir(vp); } } - error = VOP_GETATTR(vp, &vattr, ap->a_td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); if (np->n_flag & NRMODIFIED) { if (vp->v_type == VDIR) nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); if (error == EINTR) return (error); np->n_flag &= ~NRMODIFIED; @@ -563,6 +563,7 @@ nfs_close(struct vop_close_args *ap) struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); int error = 0; + thread_t td = curthread; if (vp->v_type == VREG) { if (np->n_flag & NLMODIFIED) { @@ -581,10 +582,10 @@ nfs_close(struct vop_close_args *ap) * cannot clear it if we don't commit. */ int cm = nfsv3_commit_on_close ? 1 : 0; - error = nfs_flush(vp, MNT_WAIT, ap->a_td, cm); + error = nfs_flush(vp, MNT_WAIT, td, cm); /* np->n_flag &= ~NLMODIFIED; */ } else { - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); } np->n_attrstamp = 0; } @@ -615,6 +616,7 @@ nfs_getattr(struct vop_getattr_args *ap) int error = 0; struct mbuf *mreq, *mrep, *md, *mb, *mb2; int v3 = NFS_ISV3(vp); + thread_t td = curthread; /* * Update local times for special files. @@ -629,7 +631,7 @@ nfs_getattr(struct vop_getattr_args *ap) if (v3 && nfsaccess_cache_timeout > 0) { nfsstats.accesscache_misses++; - nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_td, nfs_vpcred(vp, ND_CHECK)); + nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, nfs_vpcred(vp, ND_CHECK)); if (nfs_getattrcache(vp, ap->a_vap) == 0) return (0); } @@ -637,7 +639,7 @@ nfs_getattr(struct vop_getattr_args *ap) nfsstats.rpccnt[NFSPROC_GETATTR]++; nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3)); nfsm_fhtom(vp, v3); - nfsm_request(vp, NFSPROC_GETATTR, ap->a_td, nfs_vpcred(vp, ND_CHECK)); + nfsm_request(vp, NFSPROC_GETATTR, td, nfs_vpcred(vp, ND_CHECK)); if (!error) { nfsm_loadattr(vp, ap->a_vap); } @@ -650,8 +652,7 @@ nfsmout: * nfs setattr call. * * nfs_setattr(struct vnodeop_desc *a_desc, struct vnode *a_vp, - * struct vattr *a_vap, struct ucred *a_cred, - * struct thread *a_td) + * struct vattr *a_vap, struct ucred *a_cred) */ static int nfs_setattr(struct vop_setattr_args *ap) @@ -661,6 +662,7 @@ nfs_setattr(struct vop_setattr_args *ap) struct vattr *vap = ap->a_vap; int error = 0; u_quad_t tsize; + thread_t td = curthread; #ifndef nolint tsize = (u_quad_t)0; @@ -722,13 +724,13 @@ nfs_setattr(struct vop_setattr_args *ap) */ tsize = np->n_size; again: - error = nfs_meta_setsize(vp, ap->a_td, vap->va_size); + error = nfs_meta_setsize(vp, td, vap->va_size); if (np->n_flag & NLMODIFIED) { if (vap->va_size == 0) - error = nfs_vinvalbuf(vp, 0, ap->a_td, 1); + error = nfs_vinvalbuf(vp, 0, 1); else - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, 1); } /* * note: this loop case almost always happens at @@ -742,11 +744,11 @@ again: } else if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NLMODIFIED) && vp->v_type == VREG && - (error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR + (error = nfs_vinvalbuf(vp, V_SAVE, 1)) == EINTR ) { return (error); } - error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_td); + error = nfs_setattrrpc(vp, vap, ap->a_cred, td); /* * Sanity check if a truncation was issued. This should only occur @@ -850,7 +852,7 @@ nfs_nresolve(struct vop_nresolve_args *ap) KKASSERT(ncp->nc_parent && ncp->nc_parent->nc_vp); dvp = ncp->nc_parent->nc_vp; - if ((error = vget(dvp, LK_SHARED, td)) != 0) + if ((error = vget(dvp, LK_SHARED)) != 0) return (error); nvp = NULL; @@ -1385,7 +1387,7 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, else { return (EOPNOTSUPP); } - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr)) != 0) { return (error); } nfsstats.rpccnt[NFSPROC_MKNOD]++; @@ -1486,7 +1488,7 @@ nfs_create(struct vop_old_create_args *ap) if (vap->va_type == VSOCK) return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap)); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr)) != 0) { return (error); } if (vap->va_vaflags & VA_EXCLUSIVE) @@ -1612,13 +1614,13 @@ nfs_remove(struct vop_old_remove_args *ap) if (vp->v_type == VDIR) error = EPERM; else if (vp->v_usecount == 1 || (np->n_sillyrename && - VOP_GETATTR(vp, &vattr, cnp->cn_td) == 0 && + VOP_GETATTR(vp, &vattr) == 0 && vattr.va_nlink > 1)) { /* * throw away biocache buffers, mainly to avoid * unnecessary delayed writes later. */ - error = nfs_vinvalbuf(vp, 0, cnp->cn_td, 1); + error = nfs_vinvalbuf(vp, 0, 1); /* Do the rpc */ if (error != EINTR) error = nfs_removerpc(dvp, cnp->cn_nameptr, @@ -1713,9 +1715,9 @@ nfs_rename(struct vop_old_rename_args *ap) * often. */ - VOP_FSYNC(fvp, MNT_WAIT, fcnp->cn_td); + VOP_FSYNC(fvp, MNT_WAIT); if (tvp) - VOP_FSYNC(tvp, MNT_WAIT, tcnp->cn_td); + VOP_FSYNC(tvp, MNT_WAIT); /* * If the tvp exists and is in use, sillyrename it before doing the @@ -1836,7 +1838,7 @@ nfs_link(struct vop_old_link_args *ap) * doesn't get "out of sync" with the server. * XXX There should be a better way! */ - VOP_FSYNC(vp, MNT_WAIT, cnp->cn_td); + VOP_FSYNC(vp, MNT_WAIT); v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_LINK]++; @@ -1988,7 +1990,7 @@ nfs_mkdir(struct vop_old_mkdir_args *ap) struct vattr vattr; int v3 = NFS_ISV3(dvp); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr)) != 0) { return (error); } len = cnp->cn_namelen; @@ -2111,7 +2113,7 @@ nfs_readdir(struct vop_readdir_args *ap) */ if (np->n_direofoffset > 0 && uio->uio_offset >= np->n_direofoffset && (np->n_flag & (NLMODIFIED|NRMODIFIED)) == 0) { - if (VOP_GETATTR(vp, &vattr, uio->uio_td) == 0 && + if (VOP_GETATTR(vp, &vattr) == 0 && (np->n_flag & (NLMODIFIED|NRMODIFIED)) == 0 ) { nfsstats.direofcache_hits++; @@ -2884,7 +2886,7 @@ nfs_mmap(struct vop_mmap_args *ap) static int nfs_fsync(struct vop_fsync_args *ap) { - return (nfs_flush(ap->a_vp, ap->a_waitfor, ap->a_td, 1)); + return (nfs_flush(ap->a_vp, ap->a_waitfor, curthread, 1)); } /* @@ -3266,7 +3268,7 @@ nfsspec_access(struct vop_access_args *ap) if (cred->cr_uid == 0) return (0); vap = &vattr; - error = VOP_GETATTR(vp, vap, ap->a_td); + error = VOP_GETATTR(vp, vap); if (error) return (error); /* @@ -3350,7 +3352,7 @@ nfsspec_close(struct vop_close_args *ap) vattr.va_atime = np->n_atim; if (np->n_flag & NUPD) vattr.va_mtime = np->n_mtim; - (void)VOP_SETATTR(vp, &vattr, nfs_vpcred(vp, ND_WRITE), ap->a_td); + (void)VOP_SETATTR(vp, &vattr, nfs_vpcred(vp, ND_WRITE)); } } return (VOCALL(spec_vnode_vops, &ap->a_head)); @@ -3423,7 +3425,7 @@ nfsfifo_close(struct vop_close_args *ap) vattr.va_atime = np->n_atim; if (np->n_flag & NUPD) vattr.va_mtime = np->n_mtim; - (void)VOP_SETATTR(vp, &vattr, nfs_vpcred(vp, ND_WRITE), ap->a_td); + (void)VOP_SETATTR(vp, &vattr, nfs_vpcred(vp, ND_WRITE)); } } return (VOCALL(fifo_vnode_vops, &ap->a_head)); diff --git a/sys/vfs/ntfs/ntfs.h b/sys/vfs/ntfs/ntfs.h index 6cae7ffa91..4214d1cf0c 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.11 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs.h,v 1.12 2006/05/06 02:43:14 dillon Exp $ */ /*#define NTFS_DEBUG 1*/ @@ -325,7 +325,7 @@ typedef int (vop_t) (void *); #else /* !NetBSD */ #define HASHINIT(a, b, c, d) hashinit((a), (b), (d)) #define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b)) -#define VGET(a, b, c) vget((a), (b), (c)) +#define VGET(a, b, c) vget((a), (b)) #define VN_LOCK(a, b, c) vn_lock((a), (b)) #define LOCKMGR(a, b) lockmgr((a), (b)) diff --git a/sys/vfs/ntfs/ntfs_vfsops.c b/sys/vfs/ntfs/ntfs_vfsops.c index 162a000ed8..f0029fbeda 100644 --- a/sys/vfs/ntfs/ntfs_vfsops.c +++ b/sys/vfs/ntfs/ntfs_vfsops.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs_vfsops.c,v 1.20.2.5 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.35 2006/04/23 02:43:19 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.36 2006/05/06 02:43:14 dillon Exp $ */ @@ -427,17 +427,17 @@ ntfs_mountfs(struct vnode *devvp, struct mount *mp, struct ntfs_args *argsp, return (EBUSY); #if defined(__DragonFly__) VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = vinvalbuf(devvp, V_SAVE, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, 0, 0); VOP__UNLOCK(devvp, 0, td); #else - error = vinvalbuf(devvp, V_SAVE, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, 0, 0); #endif if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL); VOP__UNLOCK(devvp, 0, td); if (error) return (error); @@ -608,10 +608,10 @@ out: #if defined __NetBSD__ /* lock the device vnode before calling VOP_CLOSE() */ VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE); VOP__UNLOCK(devvp, 0, td); #else - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE); #endif return (error); @@ -667,15 +667,15 @@ ntfs_unmount(struct mount *mp, int mntflags, struct thread *td) if (ntmp->ntm_devvp->v_type != VBAD) ntmp->ntm_devvp->v_rdev->si_mountpoint = NULL; - vinvalbuf(ntmp->ntm_devvp, V_SAVE, td, 0, 0); + vinvalbuf(ntmp->ntm_devvp, V_SAVE, 0, 0); #if defined(__NetBSD__) /* lock the device vnode before calling VOP_CLOSE() */ VOP_LOCK(ntmp->ntm_devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, td); + error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE); VOP__UNLOCK(ntmp->ntm_devvp, 0, td); #else - error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, td); + error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE); #endif vrele(ntmp->ntm_devvp); diff --git a/sys/vfs/nwfs/nwfs.h b/sys/vfs/nwfs/nwfs.h index 72beebb366..bf678752cf 100644 --- a/sys/vfs/nwfs/nwfs.h +++ b/sys/vfs/nwfs/nwfs.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs.h,v 1.3 1999/12/29 04:54:56 peter Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs.h,v 1.7 2006/02/17 19:18:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs.h,v 1.8 2006/05/06 02:43:14 dillon Exp $ */ #ifndef _NWFS_H_ @@ -77,7 +77,7 @@ struct nwmount { int ncp_conn_logged_in(struct nwmount *); int nwfs_ioctl(struct vop_ioctl_args *ap); int nwfs_doio(struct vnode *vp, struct bio *bio, struct ucred *cr, struct thread *td); -int nwfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg); +int nwfs_vinvalbuf(struct vnode *vp, int flags, int intrflg); #endif /* _KERNEL */ #endif /* _NWFS_H_ */ diff --git a/sys/vfs/nwfs/nwfs_io.c b/sys/vfs/nwfs/nwfs_io.c index 02c3d5c950..81e164461b 100644 --- a/sys/vfs/nwfs/nwfs_io.c +++ b/sys/vfs/nwfs/nwfs_io.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_io.c,v 1.6.2.1 2000/10/25 02:11:10 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.20 2006/04/30 17:22:18 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.21 2006/05/06 02:43:14 dillon Exp $ * */ #include @@ -185,14 +185,14 @@ nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) biosize = NWFSTOCONN(nmp)->buffer_size; if (np->n_flag & NMODIFIED) { nwfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { - error = nwfs_vinvalbuf(vp, V_SAVE, td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, 1); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } @@ -223,7 +223,7 @@ nwfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { nwfs_attr_cacheremove(vp); - error = nwfs_vinvalbuf(vp, V_SAVE, td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, 1); if (error) return (error); } if (ioflag & IO_APPEND) { @@ -232,7 +232,7 @@ nwfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, * the correct size. */ #if notyet nwfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); #endif uiop->uio_offset = np->n_size; @@ -506,10 +506,10 @@ nwfs_putpages(struct vop_putpages_args *ap) #ifndef NWFS_RWCACHE KKASSERT(td->td_proc); cred = td->td_proc->p_ucred; /* XXX */ - VOP_OPEN(vp, FWRITE, cred, NULL, td); + VOP_OPEN(vp, FWRITE, cred, NULL); error = vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_sync, ap->a_rtvals); - VOP_CLOSE(vp, FWRITE, cred, td); + VOP_CLOSE(vp, FWRITE, cred); return error; #else struct uio uio; @@ -525,7 +525,7 @@ nwfs_putpages(struct vop_putpages_args *ap) KKASSERT(td->td_proc); cred = td->td_proc->p_ucred; /* XXX */ -/* VOP_OPEN(vp, FWRITE, cred, td);*/ +/* VOP_OPEN(vp, FWRITE, cred, NULL);*/ np = VTONW(vp); nmp = VFSTONWFS(vp->v_mount); pages = ap->a_m; @@ -553,7 +553,7 @@ nwfs_putpages(struct vop_putpages_args *ap) NCPVNDEBUG("ofs=%d,resid=%d\n",(int)uio.uio_offset, uio.uio_resid); error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, &uio, cred); -/* VOP_CLOSE(vp, FWRITE, cred, td);*/ +/* VOP_CLOSE(vp, FWRITE, cred);*/ NCPVNDEBUG("paged write done: %d\n", error); pmap_qremove(kva, npages); @@ -574,7 +574,7 @@ nwfs_putpages(struct vop_putpages_args *ap) * doing the flush, just wait for completion. */ int -nwfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) +nwfs_vinvalbuf(struct vnode *vp, int flags, int intrflg) { struct nwnode *np = VTONW(vp); /* struct nwmount *nmp = VTONWFS(vp);*/ @@ -593,12 +593,12 @@ nwfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) while (np->n_flag & NFLUSHINPROG) { np->n_flag |= NFLUSHWANT; error = tsleep((caddr_t)&np->n_flag, 0, "nwfsvinv", slptimeo); - error = ncp_chkintr(NWFSTOCONN(VTONWFS(vp)), td); + error = ncp_chkintr(NWFSTOCONN(VTONWFS(vp)), curthread); if (error == EINTR && intrflg) return EINTR; } np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, flags, slpflag, 0); while (error) { if (intrflg && (error == ERESTART || error == EINTR)) { np->n_flag &= ~NFLUSHINPROG; @@ -608,7 +608,7 @@ nwfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) } return EINTR; } - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, flags, slpflag, 0); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { diff --git a/sys/vfs/nwfs/nwfs_ioctl.c b/sys/vfs/nwfs/nwfs_ioctl.c index 483ff521e7..21abd6530d 100644 --- a/sys/vfs/nwfs/nwfs_ioctl.c +++ b/sys/vfs/nwfs/nwfs_ioctl.c @@ -30,18 +30,23 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_ioctl.c,v 1.2.2.1 2001/02/22 09:14:12 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_ioctl.c,v 1.6 2004/04/22 17:56:44 cpressey Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_ioctl.c,v 1.7 2006/05/06 02:43:14 dillon Exp $ */ #include #include +#include #include #include #include +#include +#include #include #include #include +#include + #include "nwfs.h" #include "nwfs_node.h" #include "nwfs_subr.h" @@ -54,7 +59,7 @@ int nwfs_ioctl(struct vop_ioctl_args *ap) { int error; - struct thread *td = ap->a_td; + struct thread *td = curthread; /* XXX */ struct ucred *cred = ap->a_cred; struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); @@ -74,15 +79,15 @@ nwfs_ioctl(struct vop_ioctl_args *ap) *(int*)data = hp->nh_id; break; case NWFSIOC_GETEINFO: - if ((error = VOP_ACCESS(vp, VEXEC, cred, td))) break; + if ((error = VOP_ACCESS(vp, VEXEC, cred))) break; fap = data; error = ncp_obtain_info(nmp, np->n_fid.f_id, 0, NULL, fap, - ap->a_td, ap->a_cred); + td, ap->a_cred); strcpy(fap->entryName, np->n_name); fap->nameLen = np->n_nmlen; break; case NWFSIOC_GETNS: - if ((error = VOP_ACCESS(vp, VEXEC, cred, td))) break; + if ((error = VOP_ACCESS(vp, VEXEC, cred))) break; *(int*)data = nmp->name_space; break; default: diff --git a/sys/vfs/nwfs/nwfs_node.c b/sys/vfs/nwfs/nwfs_node.c index a0b3d32dba..345ee79cc5 100644 --- a/sys/vfs/nwfs/nwfs_node.c +++ b/sys/vfs/nwfs/nwfs_node.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_node.c,v 1.3.2.8 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_node.c,v 1.21 2006/05/05 20:15:02 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_node.c,v 1.22 2006/05/06 02:43:14 dillon Exp $ */ #include #include @@ -136,7 +136,6 @@ nwfs_hashlookup(struct nwmount *nmp, ncpfid fid, struct nwnode **npp) int nwfs_allocvp(struct mount *mp, ncpfid fid, struct vnode **vpp) { - struct thread *td = curthread; /* XXX */ struct nwnode *np; struct nwnode_hash_head *nhpp; struct nwmount *nmp = VFSTONWFS(mp); @@ -149,7 +148,7 @@ rescan: if (nwfs_hashlookup(nmp, fid, &np) == 0) { vp = NWTOV(np); lockmgr(&nwhashlock, LK_RELEASE); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; if (nwfs_hashlookup(nmp, fid, &np) || NWTOV(np) != vp) { vput(vp); @@ -220,7 +219,7 @@ nwfs_reclaim(struct vop_reclaim_args *ap) struct vnode *dvp = NULL, *vp = ap->a_vp; struct nwnode *dnp, *np = VTONW(vp); struct nwmount *nmp = VTONWFS(vp); - struct thread *td = ap->a_td; + struct thread *td = curthread; /* XXX */ NCPVNDEBUG("%s,%d\n", (np ? np->n_name : "?"), vp->v_usecount); if (np && np->n_refparent) { @@ -252,18 +251,18 @@ nwfs_reclaim(struct vop_reclaim_args *ap) int nwfs_inactive(struct vop_inactive_args *ap) { - struct thread *td = ap->a_td; + struct thread *td = curthread; /* XXX */ struct ucred *cred; struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); int error; - KKASSERT(td->td_proc); - cred = td->td_proc->p_ucred; + KKASSERT(td->td_proc); /* XXX */ + cred = td->td_proc->p_ucred; /* XXX */ NCPVNDEBUG("%s: %d\n", VTONW(vp)->n_name, vp->v_usecount); if (np && np->opened) { - error = nwfs_vinvalbuf(vp, V_SAVE, td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, 1); error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, td, cred); np->opened = 0; } diff --git a/sys/vfs/nwfs/nwfs_vfsops.c b/sys/vfs/nwfs/nwfs_vfsops.c index cdf2499b4c..e87ad7bb93 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.21 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.22 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_ncp.h" #ifndef NCP @@ -72,7 +72,7 @@ SYSCTL_INT(_vfs_nwfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nwfs_debuglevel, 0, "") static int nwfs_mount(struct mount *, char *, caddr_t, struct thread *); static int nwfs_root(struct mount *, struct vnode **); static int nwfs_statfs(struct mount *, struct statfs *, struct thread *); -static int nwfs_sync(struct mount *, int, struct thread *); +static int nwfs_sync(struct mount *, int); static int nwfs_unmount(struct mount *, int, struct thread *); static int nwfs_init(struct vfsconf *vfsp); static int nwfs_uninit(struct vfsconf *vfsp); @@ -283,7 +283,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) conn = NWFSTOCONN(nmp); if (nmp->n_root) { *vpp = NWTOV(nmp->n_root); - while (vget(*vpp, LK_EXCLUSIVE, curthread) != 0) /* XXX */ + while (vget(*vpp, LK_EXCLUSIVE) != 0) /* XXX */ ; return 0; } @@ -350,7 +350,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) if (nmp->m.root_path[0] == 0) np->n_flag |= NVOLUME; nmp->n_root = np; -/* error = VOP_GETATTR(vp, &vattr, cred, td); +/* error = VOP_GETATTR(vp, &vattr); if (error) { vput(vp); NCPFATAL("Can't get root directory entry\n"); @@ -440,7 +440,7 @@ nwfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) */ /* ARGSUSED */ static int -nwfs_sync(struct mount *mp, int waitfor, struct thread *td) +nwfs_sync(struct mount *mp, int waitfor) { struct vnode *vp; int error, allerror = 0; @@ -460,10 +460,10 @@ loop: if (VOP_ISLOCKED(vp, NULL) || RB_EMPTY(&vp->v_rbdirty_tree) || waitfor == MNT_LAZY) continue; - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* XXX vp may not be retained */ - error = VOP_FSYNC(vp, waitfor, td); + error = VOP_FSYNC(vp, waitfor); if (error) allerror = error; vput(vp); diff --git a/sys/vfs/nwfs/nwfs_vnops.c b/sys/vfs/nwfs/nwfs_vnops.c index 8ea0c13e32..96d7aebd6a 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.28 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.29 2006/05/06 02:43:14 dillon Exp $ */ #include #include @@ -157,13 +157,13 @@ nwfs_access(struct vop_access_args *ap) /* * nwfs_open vnode op * - * nwfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred, - * struct thread *a_td) + * nwfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred) */ /* ARGSUSED */ static int nwfs_open(struct vop_open_args *ap) { + thread_t td = curthread; /* XXX */ struct vnode *vp = ap->a_vp; int mode = ap->a_mode; struct nwnode *np = VTONW(vp); @@ -179,19 +179,19 @@ nwfs_open(struct vop_open_args *ap) } if (vp->v_type == VDIR) return 0; /* nothing to do now */ if (np->n_flag & NMODIFIED) { - if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) + if ((error = nwfs_vinvalbuf(vp, V_SAVE, 1)) == EINTR) return (error); np->n_atime = 0; - error = VOP_GETATTR(vp, &vattr, ap->a_td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, ap->a_td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { - if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) + if ((error = nwfs_vinvalbuf(vp, V_SAVE, 1)) == EINTR) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } @@ -204,13 +204,13 @@ nwfs_open(struct vop_open_args *ap) if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) nwm |= AR_WRITE; error = ncp_open_create_file_or_subdir(nmp, vp, 0, NULL, OC_MODE_OPEN, - 0, nwm, &no, ap->a_td, ap->a_cred); + 0, nwm, &no, td, ap->a_cred); if (error) { if (mode & FWRITE) return EACCES; nwm = AR_READ; error = ncp_open_create_file_or_subdir(nmp, vp, 0, NULL, OC_MODE_OPEN, 0, - nwm, &no, ap->a_td,ap->a_cred); + nwm, &no, td, ap->a_cred); } np->n_atime = 0; if (error == 0) { @@ -229,6 +229,7 @@ nwfs_open(struct vop_open_args *ap) static int nwfs_close(struct vop_close_args *ap) { + thread_t td = curthread; /* XXX */ struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); int error; @@ -240,14 +241,14 @@ nwfs_close(struct vop_close_args *ap) goto done; if (np->opened == 0) goto done; - error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, 1); if (np->opened == 0) { error = 0; /* huh? */ goto done; } if (--np->opened == 0) { error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, - ap->a_td, proc0.p_ucred); + td, proc0.p_ucred); } np->n_atime = 0; done: @@ -264,6 +265,7 @@ done: static int nwfs_getattr(struct vop_getattr_args *ap) { + thread_t td = curthread; /* XXX */ struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); struct vattr *va=ap->a_vap; @@ -279,10 +281,10 @@ nwfs_getattr(struct vop_getattr_args *ap) oldsize = np->n_size; if (np->n_flag & NVOLUME) { error = ncp_obtain_info(nmp, np->n_fid.f_id, 0, NULL, &fattr, - ap->a_td,proc0.p_ucred); + td,proc0.p_ucred); } else { error = ncp_obtain_info(nmp, np->n_fid.f_parent, np->n_nmlen, - np->n_name, &fattr, ap->a_td, proc0.p_ucred); + np->n_name, &fattr, td, proc0.p_ucred); } if (error) { NCPVNDEBUG("error %d\n", error); @@ -297,12 +299,12 @@ nwfs_getattr(struct vop_getattr_args *ap) /* * nwfs_setattr call from vfs. * - * nwfs_setattr(struct vnode *a_vp, struct vattr *a_vap, struct ucred *a_cred, - * struct thread *a_td) + * nwfs_setattr(struct vnode *a_vp, struct vattr *a_vap, struct ucred *a_cred) */ static int nwfs_setattr(struct vop_setattr_args *ap) { + thread_t td = curthread; /* XXX */ struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); struct vattr *vap = ap->a_vap; @@ -338,13 +340,13 @@ nwfs_setattr(struct vop_setattr_args *ap) return EINVAL; }; } - error = ncp_setattr(vp, vap, ap->a_cred, ap->a_td); + error = ncp_setattr(vp, vap, ap->a_cred, td); if (error && vap->va_size != VNOVAL) { np->n_size = tsize; vnode_pager_setsize(vp, (u_long)tsize); } np->n_atime = 0; /* invalidate cache */ - VOP_GETATTR(vp, vap, ap->a_td); + VOP_GETATTR(vp, vap); np->n_mtime = vap->va_mtime.tv_sec; return (0); } @@ -415,7 +417,7 @@ nwfs_create(struct vop_old_create_args *ap) *vpp = NULL; if (vap->va_type == VSOCK) return (EOPNOTSUPP); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) { + if ((error = VOP_GETATTR(dvp, &vattr))) { return (error); } fmode = AR_READ | AR_WRITE; @@ -603,7 +605,7 @@ nwfs_mkdir(struct vop_old_mkdir_args *ap) struct vattr vattr; char *name=cnp->cn_nameptr; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) { + if ((error = VOP_GETATTR(dvp, &vattr))) { return (error); } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) { @@ -855,7 +857,7 @@ nwfs_lookup(struct vop_old_lookup_args *ap) if ((mp->mnt_flag & MNT_RDONLY) && nameiop != NAMEI_LOOKUP) return (EROFS); - if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td))) + if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred))) return (error); lockparent = flags & CNP_LOCKPARENT; wantparent = flags & (CNP_LOCKPARENT | CNP_WANTPARENT); @@ -914,7 +916,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & CNP_ISD }*/ /* handle DELETE case ... */ if (nameiop == NAMEI_DELETE) { /* delete last component */ - error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, cnp->cn_td); + error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred); if (error) return (error); if (NWCMPF(&dnp->n_fid, &fid)) { /* we found ourselfs */ vref(dvp); @@ -928,7 +930,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & CNP_ISD return (0); } if (nameiop == NAMEI_RENAME && wantparent) { - error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, cnp->cn_td); + error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred); if (error) return (error); if (NWCMPF(&dnp->n_fid, &fid)) return EISDIR; error = nwfs_nget(mp, fid, fap, dvp, &vp); diff --git a/sys/vfs/portal/portal_vnops.c b/sys/vfs/portal/portal_vnops.c index cf9baac175..6525d7fe10 100644 --- a/sys/vfs/portal/portal_vnops.c +++ b/sys/vfs/portal/portal_vnops.c @@ -36,7 +36,7 @@ * @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/miscfs/portal/portal_vnops.c,v 1.38 1999/12/21 06:29:00 chris Exp $ - * $DragonFly: src/sys/vfs/portal/portal_vnops.c,v 1.26 2006/04/01 20:46:53 dillon Exp $ + * $DragonFly: src/sys/vfs/portal/portal_vnops.c,v 1.27 2006/05/06 02:43:14 dillon Exp $ */ /* @@ -209,7 +209,7 @@ portal_open(struct vop_open_args *ap) { struct socket *so = 0; struct portalnode *pt; - struct thread *td = ap->a_td; + struct thread *td = curthread; struct vnode *vp = ap->a_vp; struct uio auio; struct iovec aiov[2]; @@ -246,7 +246,7 @@ portal_open(struct vop_open_args *ap) /* * Create a new socket. */ - error = socreate(AF_UNIX, &so, SOCK_STREAM, 0, ap->a_td); + error = socreate(AF_UNIX, &so, SOCK_STREAM, 0, td); if (error) goto bad; diff --git a/sys/vfs/procfs/procfs_subr.c b/sys/vfs/procfs/procfs_subr.c index ac5b0e1b2c..299a251a92 100644 --- a/sys/vfs/procfs/procfs_subr.c +++ b/sys/vfs/procfs/procfs_subr.c @@ -37,7 +37,7 @@ * @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_subr.c,v 1.26.2.3 2002/02/18 21:28:04 des Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_subr.c,v 1.12 2004/12/17 00:18:34 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_subr.c,v 1.13 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -83,7 +83,6 @@ static int pfsvplock; int procfs_allocvp(struct mount *mp, struct vnode **vpp, long pid, pfstype pfs_type) { - struct thread *td = curthread; /* XXX */ struct pfsnode *pfs; struct vnode *vp; struct pfsnode **pp; @@ -95,7 +94,7 @@ loop: if (pfs->pfs_pid == pid && pfs->pfs_type == pfs_type && PFSTOV(pfs)->v_mount == mp) { vp = PFSTOV(pfs); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* diff --git a/sys/vfs/procfs/procfs_vnops.c b/sys/vfs/procfs/procfs_vnops.c index 48de36f2c2..f75710d027 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.30 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.31 2006/05/06 02:43:14 dillon Exp $ */ /* @@ -129,8 +129,7 @@ static pid_t atopid (const char *, u_int); * is to support exclusive open on process * memory images. * - * procfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred, - * struct thread *a_td) + * procfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred) */ static int procfs_open(struct vop_open_args *ap) @@ -150,7 +149,7 @@ procfs_open(struct vop_open_args *ap) ((pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE))) return (EBUSY); - p1 = ap->a_td->td_proc; + p1 = curproc; KKASSERT(p1); /* Can't trace a process that's currently exec'ing. */ if ((p2->p_flag & P_INEXEC) != 0) @@ -177,8 +176,7 @@ procfs_open(struct vop_open_args *ap) * nothing to do for procfs other than undo * any exclusive open flag (see _open above). * - * procfs_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred, - * struct thread *a_td) + * procfs_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred) */ static int procfs_close(struct vop_close_args *ap) @@ -240,7 +238,7 @@ procfs_ioctl(struct vop_ioctl_args *ap) procp = pfind(pfs->pfs_pid); if (procp == NULL) return ENOTTY; - p = ap->a_td->td_proc; + p = curproc; if (p == NULL) return EINVAL; @@ -630,7 +628,7 @@ procfs_access(struct vop_access_args *ap) return (0); vap = &vattr; - error = VOP_GETATTR(ap->a_vp, vap, ap->a_td); + error = VOP_GETATTR(ap->a_vp, vap); if (error) return (error); diff --git a/sys/vfs/smbfs/smbfs.h b/sys/vfs/smbfs/smbfs.h index df15e1634d..d6e5dbf00c 100644 --- a/sys/vfs/smbfs/smbfs.h +++ b/sys/vfs/smbfs/smbfs.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs.h,v 1.2.2.2 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs.h,v 1.6 2006/02/17 19:18:07 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs.h,v 1.7 2006/05/06 02:43:14 dillon Exp $ */ #ifndef _SMBFS_SMBFS_H_ #define _SMBFS_SMBFS_H_ @@ -102,8 +102,7 @@ struct smbmount { int smbfs_ioctl(struct vop_ioctl_args *ap); int smbfs_doio(struct vnode *vp, struct bio *bio, struct ucred *cr, struct thread *td); -int smbfs_vinvalbuf(struct vnode *vp, int flags, - struct thread *td, int intrflg); +int smbfs_vinvalbuf(struct vnode *vp, int flags, int intrflg); #endif /* KERNEL */ #endif /* _SMBFS_SMBFS_H_ */ diff --git a/sys/vfs/smbfs/smbfs_io.c b/sys/vfs/smbfs/smbfs_io.c index 2af7394072..7998c4d24a 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.24 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_io.c,v 1.25 2006/05/06 02:43:14 dillon Exp $ * */ #include @@ -217,16 +217,16 @@ smbfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) /* biosize = SSTOCN(smp->sm_share)->sc_txmax;*/ if (np->n_flag & NMODIFIED) { smbfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return error; if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) { - error = smbfs_vinvalbuf(vp, V_SAVE, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, 1); if (error) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; @@ -259,7 +259,7 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop, if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { smbfs_attr_cacheremove(vp); - error = smbfs_vinvalbuf(vp, V_SAVE, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, 1); if (error) return error; } @@ -269,7 +269,7 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop, * File size can be changed by another client */ smbfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return (error); #endif uiop->uio_offset = np->n_size; @@ -549,10 +549,10 @@ smbfs_putpages(struct vop_putpages_args *ap) #ifdef SMBFS_RWGENERIC KKASSERT(td->td_proc); cred = td->td_proc->p_ucred; - VOP_OPEN(vp, FWRITE, cred, NULL, td); + VOP_OPEN(vp, FWRITE, cred, NULL); error = vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_sync, ap->a_rtvals); - VOP_CLOSE(vp, FWRITE, cred, td); + VOP_CLOSE(vp, FWRITE, cred); return error; #else struct uio uio; @@ -569,7 +569,7 @@ smbfs_putpages(struct vop_putpages_args *ap) KKASSERT(td->td_proc); cred = td->td_proc->p_ucred; -/* VOP_OPEN(vp, FWRITE, cred, td);*/ +/* VOP_OPEN(vp, FWRITE, cred, NULL);*/ np = VTOSMB(vp); smp = VFSTOSMBFS(vp->v_mount); pages = ap->a_m; @@ -616,7 +616,7 @@ smbfs_putpages(struct vop_putpages_args *ap) error = smb_write(smp->sm_share, np->n_fid, &uio, &scred); if (doclose) smbfs_smb_close(smp->sm_share, np->n_fid, NULL, &scred); -/* VOP_CLOSE(vp, FWRITE, cred, td);*/ +/* VOP_CLOSE(vp, FWRITE, cred);*/ SMBVDEBUG("paged write done: %d\n", error); pmap_qremove(kva, npages); @@ -638,7 +638,7 @@ smbfs_putpages(struct vop_putpages_args *ap) * doing the flush, just wait for completion. */ int -smbfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) +smbfs_vinvalbuf(struct vnode *vp, int flags, int intrflg) { struct smbnode *np = VTOSMB(vp); int error = 0, slpflag, slptimeo; @@ -655,12 +655,12 @@ smbfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) while (np->n_flag & NFLUSHINPROG) { np->n_flag |= NFLUSHWANT; error = tsleep((caddr_t)&np->n_flag, 0, "smfsvinv", slptimeo); - error = smb_proc_intr(td); + error = smb_proc_intr(curthread); if (error == EINTR && intrflg) return EINTR; } np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, flags, slpflag, 0); while (error) { if (intrflg && (error == ERESTART || error == EINTR)) { np->n_flag &= ~NFLUSHINPROG; @@ -670,7 +670,7 @@ smbfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) } return EINTR; } - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, flags, slpflag, 0); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { diff --git a/sys/vfs/smbfs/smbfs_node.c b/sys/vfs/smbfs/smbfs_node.c index 4c2edd8756..f2bf160661 100644 --- a/sys/vfs/smbfs/smbfs_node.c +++ b/sys/vfs/smbfs/smbfs_node.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_node.c,v 1.2.2.3 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_node.c,v 1.19 2006/05/05 20:15:02 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_node.c,v 1.20 2006/05/06 02:43:14 dillon Exp $ */ #include #include @@ -162,7 +162,6 @@ smbfs_node_alloc(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) { - struct thread *td = curthread; /* XXX */ struct smbmount *smp = VFSTOSMBFS(mp); struct smbnode_hashhead *nhpp; struct smbnode *np, *np2, *dnp; @@ -179,7 +178,7 @@ smbfs_node_alloc(struct mount *mp, struct vnode *dvp, if (dvp == NULL) return EINVAL; vp = VTOSMB(VTOSMB(dvp)->n_parent)->n_vnode; - error = vget(vp, LK_EXCLUSIVE, td); + error = vget(vp, LK_EXCLUSIVE); if (error == 0) *vpp = vp; return error; @@ -203,7 +202,7 @@ loop: continue; vp = SMBTOV(np); smbfs_hash_unlock(smp, td); - if (vget(vp, LK_EXCLUSIVE, td) != 0) + if (vget(vp, LK_EXCLUSIVE) != 0) goto retry; /* * relookup after we blocked. @@ -338,7 +337,6 @@ smbfs_reclaim(struct vop_reclaim_args *ap) int smbfs_inactive(struct vop_inactive_args *ap) { - struct thread *td = ap->a_td; struct ucred *cred; struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); @@ -347,10 +345,10 @@ smbfs_inactive(struct vop_inactive_args *ap) SMBVDEBUG("%s: %d\n", VTOSMB(vp)->n_name, vp->v_usecount); if (np->n_opencount) { - error = smbfs_vinvalbuf(vp, V_SAVE, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, 1); cred = np->n_cached_cred; np->n_cached_cred = NULL; - smb_makescred(&scred, td, cred); + smb_makescred(&scred, curthread, cred); error = smbfs_smb_close(np->n_mount->sm_share, np->n_fid, &np->n_mtime, &scred); np->n_opencount = 0; diff --git a/sys/vfs/smbfs/smbfs_vfsops.c b/sys/vfs/smbfs/smbfs_vfsops.c index 6e5ecaf8d7..ddcd34bae9 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.25 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.26 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_netsmb.h" #ifndef NETSMB @@ -84,7 +84,7 @@ static MALLOC_DEFINE(M_SMBFSHASH, "SMBFS hash", "SMBFS hash table"); static int smbfs_mount(struct mount *, char *, caddr_t, struct thread *); static int smbfs_root(struct mount *, struct vnode **); static int smbfs_statfs(struct mount *, struct statfs *, struct thread *); -static int smbfs_sync(struct mount *, int, struct thread *); +static int smbfs_sync(struct mount *, int); static int smbfs_unmount(struct mount *, int, struct thread *); static int smbfs_init(struct vfsconf *vfsp); static int smbfs_uninit(struct vfsconf *vfsp); @@ -303,7 +303,7 @@ smbfs_root(struct mount *mp, struct vnode **vpp) } if (smp->sm_root) { *vpp = SMBTOV(smp->sm_root); - return vget(*vpp, LK_EXCLUSIVE | LK_RETRY, td); + return vget(*vpp, LK_EXCLUSIVE | LK_RETRY); } if (td->td_proc) cred = td->td_proc->p_ucred; @@ -391,7 +391,7 @@ smbfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) */ /* ARGSUSED */ static int -smbfs_sync(struct mount *mp, int waitfor, struct thread *td) +smbfs_sync(struct mount *mp, int waitfor) { struct vnode *vp; int error, allerror = 0; @@ -411,9 +411,9 @@ loop: if (VOP_ISLOCKED(vp, NULL) || RB_EMPTY(&vp->v_rbdirty_tree) || waitfor == MNT_LAZY) continue; - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; - error = VOP_FSYNC(vp, waitfor, td); + error = VOP_FSYNC(vp, waitfor); if (error) allerror = error; vput(vp); diff --git a/sys/vfs/smbfs/smbfs_vnops.c b/sys/vfs/smbfs/smbfs_vnops.c index b2175cb82e..cd082b7d0f 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.29 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vnops.c,v 1.30 2006/05/06 02:43:14 dillon Exp $ */ #include #include @@ -184,19 +184,19 @@ smbfs_open(struct vop_open_args *ap) return (vop_stdopen(ap)); } if (np->n_flag & NMODIFIED) { - if ((error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) + if ((error = smbfs_vinvalbuf(vp, V_SAVE, 1)) == EINTR) return error; smbfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, ap->a_td); + error = VOP_GETATTR(vp, &vattr); if (error) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, ap->a_td); + error = VOP_GETATTR(vp, &vattr); if (error) return error; if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) { - error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, 1); if (error == EINTR) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; @@ -209,7 +209,7 @@ smbfs_open(struct vop_open_args *ap) accmode = SMB_AM_OPENREAD; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) accmode = SMB_AM_OPENRW; - smb_makescred(&scred, ap->a_td, ap->a_cred); + smb_makescred(&scred, curthread, ap->a_cred); error = smbfs_smb_open(np, accmode, &scred); if (error) { if (mode & FWRITE) @@ -232,14 +232,13 @@ smbfs_closel(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); - struct thread *td = ap->a_td; struct smb_cred scred; struct vattr vattr; int error; SMBVDEBUG("name=%s, pid=%d, c=%d\n",np->n_name, p->p_pid, np->n_opencount); - smb_makescred(&scred, td, proc0.p_ucred); + smb_makescred(&scred, curthread, proc0.p_ucred); error = 0; if (np->n_opencount == 0) { @@ -256,10 +255,10 @@ smbfs_closel(struct vop_close_args *ap) np->n_dirseq = NULL; } } else { - error = smbfs_vinvalbuf(vp, V_SAVE, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, 1); if (np->n_opencount) goto done; - VOP_GETATTR(vp, &vattr, td); + VOP_GETATTR(vp, &vattr); error = smbfs_smb_close(np->n_mount->sm_share, np->n_fid, &np->n_mtime, &scred); } @@ -292,7 +291,7 @@ smbfs_getattr(struct vop_getattr_args *ap) if (!error) return 0; SMBVDEBUG("not in the cache\n"); - smb_makescred(&scred, ap->a_td, proc0.p_ucred); + smb_makescred(&scred, curthread, proc0.p_ucred); oldsize = np->n_size; error = smbfs_smb_lookup(np, NULL, 0, &fattr, &scred); if (error) { @@ -334,7 +333,7 @@ smbfs_setattr(struct vop_setattr_args *ap) vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) && isreadonly) return EROFS; - smb_makescred(&scred, ap->a_td, ap->a_cred); + smb_makescred(&scred, curthread, ap->a_cred); if (vap->va_size != VNOVAL) { switch (vp->v_type) { case VDIR: @@ -374,7 +373,7 @@ smbfs_setattr(struct vop_setattr_args *ap) if (ap->a_cred->cr_uid != VTOSMBFS(vp)->sm_args.uid && (error = suser_cred(ap->a_cred, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td)))) + (error = VOP_ACCESS(vp, VWRITE, ap->a_cred)))) return (error); #if 0 if (mtime == NULL) @@ -388,13 +387,13 @@ smbfs_setattr(struct vop_setattr_args *ap) */ if (np->n_opencount == 0) { if (vcp->vc_flags & SMBV_WIN95) { - error = VOP_OPEN(vp, FWRITE, ap->a_cred, NULL, ap->a_td); + error = VOP_OPEN(vp, FWRITE, ap->a_cred, NULL); if (!error) { /* error = smbfs_smb_setfattrNT(np, 0, mtime, atime, &scred); - VOP_GETATTR(vp, &vattr, ap->a_td);*/ + VOP_GETATTR(vp, &vattr);*/ if (mtime) np->n_mtime = *mtime; - VOP_CLOSE(vp, FWRITE, ap->a_td); + VOP_CLOSE(vp, FWRITE); } } else if ((vcp->vc_sopt.sv_caps & SMB_CAP_NT_SMBS)) { error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred); @@ -424,7 +423,7 @@ smbfs_setattr(struct vop_setattr_args *ap) * required attributes. */ smbfs_attr_cacheremove(vp); /* invalidate cache */ - VOP_GETATTR(vp, vap, ap->a_td); + VOP_GETATTR(vp, vap); np->n_mtime.tv_sec = vap->va_mtime.tv_sec; return error; } @@ -490,7 +489,7 @@ smbfs_create(struct vop_old_create_args *ap) *vpp = NULL; if (vap->va_type != VREG) return EOPNOTSUPP; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) + if ((error = VOP_GETATTR(dvp, &vattr))) return error; smb_makescred(&scred, cnp->cn_td, cnp->cn_cred); @@ -663,7 +662,7 @@ smbfs_mkdir(struct vop_old_mkdir_args *ap) int len = cnp->cn_namelen; int error; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) { + if ((error = VOP_GETATTR(dvp, &vattr))) { return error; } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) @@ -858,7 +857,6 @@ smbfs_getextattr(struct vop_getextattr_args *ap) */ { struct vnode *vp = ap->a_vp; - struct thread *td = ap->a_td; struct ucred *cred = ap->a_cred; struct uio *uio = ap->a_uio; const char *name = ap->a_name; @@ -867,10 +865,10 @@ smbfs_getextattr(struct vop_getextattr_args *ap) char buf[10]; int i, attr, error; - error = VOP_ACCESS(vp, VREAD, cred, td); + error = VOP_ACCESS(vp, VREAD, cred); if (error) return error; - error = VOP_GETATTR(vp, &vattr, td); + error = VOP_GETATTR(vp, &vattr); if (error) return error; if (strcmp(name, "dosattr") == 0) { @@ -1057,7 +1055,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) #endif if ((mp->mnt_flag & MNT_RDONLY) && nameiop != NAMEI_LOOKUP) return EROFS; - if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) + if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred)) != 0) return error; lockparent = flags & CNP_LOCKPARENT; wantparent = flags & (CNP_LOCKPARENT | CNP_WANTPARENT); @@ -1091,7 +1089,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) * Handle RENAME or CREATE case... */ if ((nameiop == NAMEI_CREATE || nameiop == NAMEI_RENAME) && wantparent) { - error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, td); + error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred); if (error) return error; if (!lockparent) { @@ -1108,7 +1106,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) * handle DELETE case ... */ if (nameiop == NAMEI_DELETE) { /* delete last component */ - error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, td); + error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred); if (error) return error; if (isdot) { @@ -1127,7 +1125,7 @@ smbfs_lookup(struct vop_old_lookup_args *ap) return 0; } if (nameiop == NAMEI_RENAME && wantparent) { - error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, td); + error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred); if (error) return error; if (isdot) diff --git a/sys/vfs/specfs/spec_vnops.c b/sys/vfs/specfs/spec_vnops.c index 14ccbbf394..45adc1b94a 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.42 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/specfs/spec_vnops.c,v 1.43 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -241,7 +241,7 @@ spec_open(struct vop_open_args *ap) * only called for the last close unless D_TRACKCLOSE is set. */ VOP_UNLOCK(vp, 0); - error = dev_dopen(dev, ap->a_mode, S_IFCHR, ap->a_td); + error = dev_dopen(dev, ap->a_mode, S_IFCHR, curthread); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error) @@ -374,7 +374,7 @@ spec_ioctl(struct vop_ioctl_args *ap) return (EBADF); /* device was revoked */ return (dev_dioctl(dev, ap->a_command, ap->a_data, - ap->a_fflag, ap->a_td)); + ap->a_fflag,curthread)); } /* @@ -389,7 +389,7 @@ spec_poll(struct vop_poll_args *ap) if ((dev = ap->a_vp->v_rdev) == NULL) return (EBADF); /* device was revoked */ - return (dev_dpoll(dev, ap->a_events, ap->a_td)); + return (dev_dpoll(dev, ap->a_events, curthread)); } /* @@ -542,7 +542,7 @@ spec_bmap(struct vop_bmap_args *ap) static int spec_close(struct vop_close_args *ap) { - struct proc *p = ap->a_td->td_proc; + struct proc *p = curproc; struct vnode *vp = ap->a_vp; dev_t dev = vp->v_rdev; int error; @@ -581,11 +581,11 @@ spec_close(struct vop_close_args *ap) (dev_dflags(dev) & D_TRACKCLOSE) || (vcount(vp) <= 1 && vp->v_opencount == 1))) { needrelock = 0; - if (VOP_ISLOCKED(vp, ap->a_td)) { + if (VOP_ISLOCKED(vp, curthread)) { needrelock = 1; VOP_UNLOCK(vp, 0); } - error = dev_dclose(dev, ap->a_fflag, S_IFCHR, ap->a_td); + error = dev_dclose(dev, ap->a_fflag, S_IFCHR, curthread); if (needrelock) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } else { diff --git a/sys/vfs/udf/udf_vfsops.c b/sys/vfs/udf/udf_vfsops.c index 6c24dddbff..f35a495c8a 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.17 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.18 2006/05/06 02:43:14 dillon Exp $ */ /* udf_vfsops.c */ @@ -171,7 +171,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); - error = VOP_ACCESS(devvp, VREAD, td->td_proc->p_ucred, td); + error = VOP_ACCESS(devvp, VREAD, td->td_proc->p_ucred); if (error) error = suser(td); if (error) { @@ -246,11 +246,11 @@ udf_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) return(error); if (count_udev(devvp->v_udev) > 0) return(EBUSY); - if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0))) + if ((error = vinvalbuf(devvp, V_SAVE, 0, 0))) return(error); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); + error = VOP_OPEN(devvp, FREAD, FSCRED, NULL); VOP_UNLOCK(devvp, 0); if (error) return(error); @@ -394,7 +394,7 @@ bail: if (bp != NULL) brelse(bp); if (needclose) - VOP_CLOSE(devvp, FREAD, td); + VOP_CLOSE(devvp, FREAD); return(error); } @@ -413,7 +413,7 @@ udf_unmount(struct mount *mp, int mntflags, struct thread *td) return (error); udfmp->im_devvp->v_rdev->si_mountpoint = NULL; - error = VOP_CLOSE(udfmp->im_devvp, FREAD, td); + error = VOP_CLOSE(udfmp->im_devvp, FREAD); vrele(udfmp->im_devvp); if (udfmp->s_table) diff --git a/sys/vfs/udf/udf_vnops.c b/sys/vfs/udf/udf_vnops.c index 316f9914a9..47e8cabe84 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.20 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.21 2006/05/06 02:43:14 dillon Exp $ */ /* udf_vnops.c */ @@ -109,7 +109,7 @@ loop: if (node->hash_id != id) continue; vp = node->i_vnode; - if (vget(vp, LK_EXCLUSIVE, curthread)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* * We must check to see if the inode has been ripped diff --git a/sys/vfs/ufs/ffs_balloc.c b/sys/vfs/ufs/ffs_balloc.c index d3db2a417c..fcd5d2ca5d 100644 --- a/sys/vfs/ufs/ffs_balloc.c +++ b/sys/vfs/ufs/ffs_balloc.c @@ -32,7 +32,7 @@ * * @(#)ffs_balloc.c 8.8 (Berkeley) 6/16/95 * $FreeBSD: src/sys/ufs/ffs/ffs_balloc.c,v 1.26.2.1 2002/10/10 19:48:20 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_balloc.c,v 1.16 2006/04/03 02:02:37 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_balloc.c,v 1.17 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -436,7 +436,7 @@ fail: * occurence. The error return from fsync is ignored as we already * have an error to return to the user. */ - (void) VOP_FSYNC(vp, MNT_WAIT, td); + (void) VOP_FSYNC(vp, MNT_WAIT); for (deallocated = 0, blkp = allociblk; blkp < allocblk; blkp++) { ffs_blkfree(ip, *blkp, fs->fs_bsize); deallocated += fs->fs_bsize; @@ -472,7 +472,7 @@ fail: ip->i_blocks -= btodb(deallocated); ip->i_flag |= IN_CHANGE | IN_UPDATE; } - (void) VOP_FSYNC(vp, MNT_WAIT, td); + (void) VOP_FSYNC(vp, MNT_WAIT); /* * Cleanup the data block we getblk()'d before returning. diff --git a/sys/vfs/ufs/ffs_extern.h b/sys/vfs/ufs/ffs_extern.h index 34b9989d8b..7c282c6c0c 100644 --- a/sys/vfs/ufs/ffs_extern.h +++ b/sys/vfs/ufs/ffs_extern.h @@ -32,7 +32,7 @@ * * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95 * $FreeBSD: src/sys/ufs/ffs/ffs_extern.h,v 1.30 2000/01/09 22:40:02 mckusick Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_extern.h,v 1.10 2006/04/03 02:02:37 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_extern.h,v 1.11 2006/05/06 02:43:14 dillon Exp $ */ #ifndef _VFS_UFS_EXTERN_H @@ -92,8 +92,8 @@ int ffs_realloccg(struct inode *, ufs_daddr_t, ufs_daddr_t, int, int, struct ucred *, struct buf **); void ffs_setblock(struct fs *, u_char *, ufs_daddr_t); int ffs_statfs(struct mount *, struct statfs *, struct thread *); -int ffs_sync(struct mount *, int, struct thread *); -int ffs_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); +int ffs_sync(struct mount *, int); +int ffs_truncate(struct vnode *, off_t, int, struct ucred *); int ffs_unmount(struct mount *, int, struct thread *); int ffs_update(struct vnode *, int); int ffs_valloc(struct vnode *, int, struct ucred *, struct vnode **); diff --git a/sys/vfs/ufs/ffs_inode.c b/sys/vfs/ufs/ffs_inode.c index bfc306aff5..f556b77816 100644 --- a/sys/vfs/ufs/ffs_inode.c +++ b/sys/vfs/ufs/ffs_inode.c @@ -32,7 +32,7 @@ * * @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95 * $FreeBSD: src/sys/ufs/ffs/ffs_inode.c,v 1.56.2.5 2002/02/05 18:35:03 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_inode.c,v 1.21 2006/04/30 17:22:18 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_inode.c,v 1.22 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_quota.h" @@ -130,8 +130,7 @@ ffs_update(struct vnode *vp, int waitfor) * disk blocks. */ int -ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, - struct thread *td) +ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred) { struct vnode *ovp = vp; ufs_daddr_t lastblock; @@ -186,14 +185,14 @@ ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, * rarely, we solve the problem by syncing the file * so that it will have no data structures left. */ - if ((error = VOP_FSYNC(ovp, MNT_WAIT, td)) != 0) + if ((error = VOP_FSYNC(ovp, MNT_WAIT)) != 0) return (error); } else { #ifdef QUOTA (void) ufs_chkdq(oip, -oip->i_blocks, NOCRED, 0); #endif softdep_setup_freeblocks(oip, length); - vinvalbuf(ovp, 0, td, 0, 0); + vinvalbuf(ovp, 0, 0, 0); vnode_pager_setsize(ovp, 0); oip->i_flag |= IN_CHANGE | IN_UPDATE; return (ffs_update(ovp, 0)); @@ -254,7 +253,7 @@ ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, */ if (DOINGSOFTDEP(ovp) && lbn < NDADDR && fragroundup(fs, blkoff(fs, length)) < fs->fs_bsize && - (error = VOP_FSYNC(ovp, MNT_WAIT, td)) != 0) { + (error = VOP_FSYNC(ovp, MNT_WAIT)) != 0) { return (error); } oip->i_size = length; @@ -310,7 +309,7 @@ ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks); oip->i_size = osize; - error = vtruncbuf(ovp, td, length, fs->fs_bsize); + error = vtruncbuf(ovp, length, fs->fs_bsize); if (error && (allerror == 0)) allerror = error; diff --git a/sys/vfs/ufs/ffs_rawread.c b/sys/vfs/ufs/ffs_rawread.c index 34e131b2ec..d91bceada2 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.23 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_rawread.c,v 1.24 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -130,7 +130,7 @@ ffs_rawread_sync(struct vnode *vp, struct thread *td) /* Flush dirty buffers */ if (!RB_EMPTY(&vp->v_rbdirty_tree)) { crit_exit(); - if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) != 0) { + if ((error = VOP_FSYNC(vp, MNT_WAIT)) != 0) { if (upgraded != 0) VOP_LOCK(vp, LK_DOWNGRADE); return (error); diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index 86da441954..5cb4e8a73b 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.41 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.42 2006/05/06 02:43:14 dillon Exp $ */ /* @@ -822,7 +822,7 @@ softdep_flushfiles(struct mount *oldmnt, int flags, struct thread *td) break; } vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_FSYNC(devvp, MNT_WAIT, td); + error = VOP_FSYNC(devvp, MNT_WAIT); VOP_UNLOCK(devvp, 0); if (error) break; @@ -2864,7 +2864,6 @@ static void handle_workitem_remove(dirrem) struct dirrem *dirrem; { - struct thread *td = curthread; /* XXX */ struct inodedep *inodedep; struct vnode *vp; struct inode *ip; @@ -2913,7 +2912,7 @@ handle_workitem_remove(dirrem) } inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; FREE_LOCK(&lk); - if ((error = UFS_TRUNCATE(vp, (off_t)0, 0, proc0.p_ucred, td)) != 0) + if ((error = UFS_TRUNCATE(vp, (off_t)0, 0, proc0.p_ucred)) != 0) softdep_error("handle_workitem_remove: truncate", error); /* * Rename a directory to a new parent. Since, we are both deleting @@ -4268,7 +4267,7 @@ top: if (vn_isdisk(vp, NULL) && vp->v_rdev && vp->v_rdev->si_mountpoint && !VOP_ISLOCKED(vp, NULL) && - (error = VFS_SYNC(vp->v_rdev->si_mountpoint, MNT_WAIT, td)) != 0) + (error = VFS_SYNC(vp->v_rdev->si_mountpoint, MNT_WAIT)) != 0) return (error); return (0); } @@ -4554,7 +4553,6 @@ flush_pagedep_deps(pvp, mp, diraddhdp) struct mount *mp; struct diraddhd *diraddhdp; { - struct thread *td = curthread; /* XXX */ struct inodedep *inodedep; struct ufsmount *ump; struct diradd *dap; @@ -4601,8 +4599,8 @@ flush_pagedep_deps(pvp, mp, diraddhdp) FREE_LOCK(&lk); if ((error = VFS_VGET(mp, inum, &vp)) != 0) break; - if ((error=VOP_FSYNC(vp, MNT_NOWAIT, td)) || - (error=VOP_FSYNC(vp, MNT_NOWAIT, td))) { + if ((error=VOP_FSYNC(vp, MNT_NOWAIT)) || + (error=VOP_FSYNC(vp, MNT_NOWAIT))) { vput(vp); break; } @@ -4823,7 +4821,7 @@ clear_remove(struct thread *td) softdep_error("clear_remove: vget", error); return; } - if ((error = VOP_FSYNC(vp, MNT_NOWAIT, td))) + if ((error = VOP_FSYNC(vp, MNT_NOWAIT))) softdep_error("clear_remove: fsync", error); drain_output(vp, 0); vput(vp); @@ -4912,10 +4910,10 @@ clear_inodedeps(struct thread *td) return; } if (ino == lastino) { - if ((error = VOP_FSYNC(vp, MNT_WAIT, td))) + if ((error = VOP_FSYNC(vp, MNT_WAIT))) softdep_error("clear_inodedeps: fsync1", error); } else { - if ((error = VOP_FSYNC(vp, MNT_NOWAIT, td))) + if ((error = VOP_FSYNC(vp, MNT_NOWAIT))) softdep_error("clear_inodedeps: fsync2", error); drain_output(vp, 0); } diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c index 2635439b1d..26869055b5 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.40 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.41 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_quota.h" @@ -199,7 +199,7 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ /* * Flush any dirty data. */ - VFS_SYNC(mp, MNT_WAIT, td); + VFS_SYNC(mp, MNT_WAIT); /* * Check for and optionally get rid of files open * for writing. @@ -228,7 +228,7 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ if (cred->cr_uid != 0) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_ACCESS(devvp, VREAD | VWRITE, - cred, td)) != 0) { + cred)) != 0) { VOP_UNLOCK(devvp, 0); return (error); } @@ -306,7 +306,7 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if ((error = VOP_ACCESS(devvp, accessmode, cred, td)) != 0) { + if ((error = VOP_ACCESS(devvp, accessmode, cred)) != 0) { vput(devvp); return (error); } @@ -400,11 +400,11 @@ success: */ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if (ronly) { - VOP_OPEN(devvp, FREAD, FSCRED, NULL, td); - VOP_CLOSE(devvp, FREAD|FWRITE, td); + VOP_OPEN(devvp, FREAD, FSCRED, NULL); + VOP_CLOSE(devvp, FREAD|FWRITE); } else { - VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, NULL, td); - VOP_CLOSE(devvp, FREAD, td); + VOP_OPEN(devvp, FREAD|FWRITE, FSCRED, NULL); + VOP_CLOSE(devvp, FREAD); } VOP_UNLOCK(devvp, 0); ffs_sbupdate(ump, MNT_WAIT); @@ -458,7 +458,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) */ devvp = VFSTOUFS(mp)->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = vinvalbuf(devvp, 0, td, 0, 0); + error = vinvalbuf(devvp, 0, 0, 0); VOP_UNLOCK(devvp, 0); if (error) panic("ffs_reload: dirty1"); @@ -475,7 +475,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) /* * Step 2: re-read superblock from disk. */ - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, td) != 0) + if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED) != 0) size = DEV_BSIZE; else size = dpart.disklab->d_secsize; @@ -562,10 +562,10 @@ ffs_reload_scan2(struct mount *mp, struct vnode *vp, void *data) /* * Try to recycle */ - if (vrecycle(vp, info->td)) + if (vrecycle(vp)) return(0); - if (vinvalbuf(vp, 0, info->td, 0, 0)) + if (vinvalbuf(vp, 0, 0, 0)) panic("ffs_reload: dirty2"); /* * Step 6: re-read inode data for all active vnodes. @@ -613,14 +613,14 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, if (count_udev(devvp->v_udev) > 0) return (EBUSY); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = vinvalbuf(devvp, V_SAVE, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, 0, 0); VOP_UNLOCK(devvp, 0); if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, NULL); VOP_UNLOCK(devvp, 0); if (error) return (error); @@ -639,7 +639,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, if (devvp->v_object == NULL) panic("ffs_reload: devvp has no VM object!"); - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, proc0.p_ucred, td) != 0) + if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, proc0.p_ucred) != 0) size = DEV_BSIZE; else size = dpart.disklab->d_secsize; @@ -782,7 +782,7 @@ out: dev->si_mountpoint = NULL; if (bp) brelse(bp); - VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); + VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE); if (ump) { free(ump->um_fs, M_UFSMNT); free(ump, M_UFSMNT); @@ -854,8 +854,8 @@ ffs_unmount(struct mount *mp, int mntflags, struct thread *td) } ump->um_devvp->v_rdev->si_mountpoint = NULL; - vinvalbuf(ump->um_devvp, V_SAVE, td, 0, 0); - error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, td); + vinvalbuf(ump->um_devvp, V_SAVE, 0, 0); + error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE); vrele(ump->um_devvp); @@ -904,7 +904,7 @@ ffs_flushfiles(struct mount *mp, int flags, struct thread *td) * Flush filesystem metadata. */ vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_FSYNC(ump->um_devvp, MNT_WAIT, td); + error = VOP_FSYNC(ump->um_devvp, MNT_WAIT); VOP_UNLOCK(ump->um_devvp, 0); return (error); } @@ -951,7 +951,7 @@ static int ffs_sync_scan1(struct mount *mp, struct vnode *vp, void *data); static int ffs_sync_scan2(struct mount *mp, struct vnode *vp, void *data); int -ffs_sync(struct mount *mp, int waitfor, struct thread *td) +ffs_sync(struct mount *mp, int waitfor) { struct ufsmount *ump = VFSTOUFS(mp); struct fs *fs; @@ -983,7 +983,7 @@ ffs_sync(struct mount *mp, int waitfor, struct thread *td) if (ump->um_mountp->mnt_flag & MNT_SOFTDEP) waitfor = MNT_NOWAIT; vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); - if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) + if ((error = VOP_FSYNC(ump->um_devvp, waitfor)) != 0) scaninfo.allerror = error; VOP_UNLOCK(ump->um_devvp, 0); } @@ -1025,7 +1025,6 @@ static int ffs_sync_scan2(struct mount *mp, struct vnode *vp, void *data) { struct scaninfo *info = data; - thread_t td = curthread; /* XXX */ struct inode *ip; int error; @@ -1039,7 +1038,7 @@ ffs_sync_scan2(struct mount *mp, struct vnode *vp, void *data) return(0); } if (vp->v_type != VCHR) { - if ((error = VOP_FSYNC(vp, info->waitfor, td)) != 0) + if ((error = VOP_FSYNC(vp, info->waitfor)) != 0) info->allerror = error; } else { /* diff --git a/sys/vfs/ufs/ufs_ihash.c b/sys/vfs/ufs/ufs_ihash.c index 3d6d528851..cd4fe3c1c9 100644 --- a/sys/vfs/ufs/ufs_ihash.c +++ b/sys/vfs/ufs/ufs_ihash.c @@ -32,7 +32,7 @@ * * @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95 * $FreeBSD: src/sys/ufs/ufs/ufs_ihash.c,v 1.20 1999/08/28 00:52:29 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_ihash.c,v 1.16 2005/07/26 15:43:36 hmp Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_ihash.c,v 1.17 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -116,7 +116,6 @@ ufs_ihashlookup(dev_t dev, ino_t inum) struct vnode * ufs_ihashget(dev_t dev, ino_t inum) { - struct thread *td = curthread; /* XXX */ lwkt_tokref ilock; struct inode *ip; struct vnode *vp; @@ -127,7 +126,7 @@ loop: if (inum != ip->i_number || dev != ip->i_dev) continue; vp = ITOV(ip); - if (vget(vp, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE)) goto loop; /* * We must check to see if the inode has been ripped diff --git a/sys/vfs/ufs/ufs_inode.c b/sys/vfs/ufs/ufs_inode.c index 900e7891ad..9c3b643df4 100644 --- a/sys/vfs/ufs/ufs_inode.c +++ b/sys/vfs/ufs/ufs_inode.c @@ -37,7 +37,7 @@ * * @(#)ufs_inode.c 8.9 (Berkeley) 5/14/95 * $FreeBSD: src/sys/ufs/ufs/ufs_inode.c,v 1.25.2.3 2002/07/05 22:42:31 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_inode.c,v 1.17 2006/04/25 22:11:32 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_inode.c,v 1.18 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_quota.h" @@ -63,14 +63,13 @@ int prtactive = 0; /* 1 => print out reclaim of active vnodes */ /* * Last reference to an inode. If necessary, write or delete it. * - * ufs_inactive(struct vnode *a_vp, struct thread *a_td) + * ufs_inactive(struct vnode *a_vp) */ int ufs_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - struct thread *td = ap->a_td; int mode, error = 0; if (prtactive && vp->v_usecount != 1) @@ -86,7 +85,7 @@ ufs_inactive(struct vop_inactive_args *ap) if (!ufs_getinoquota(ip)) (void)ufs_chkiq(ip, -1, NOCRED, FORCE); #endif - error = UFS_TRUNCATE(vp, (off_t)0, 0, NOCRED, td); + error = UFS_TRUNCATE(vp, (off_t)0, 0, NOCRED); ip->i_rdev = 0; mode = ip->i_mode; ip->i_mode = 0; @@ -101,14 +100,14 @@ out: * so that it can be reused immediately. */ if (ip == NULL || ip->i_mode == 0) - vrecycle(vp, td); + vrecycle(vp); return (error); } /* * Reclaim an inode so that it can be used for other purposes. * - * ufs_reclaim(struct vnode *a_vp, struct thread *a_td) + * ufs_reclaim(struct vnode *a_vp) */ int ufs_reclaim(struct vop_reclaim_args *ap) diff --git a/sys/vfs/ufs/ufs_lookup.c b/sys/vfs/ufs/ufs_lookup.c index c2838142da..a97d85f1e8 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.24 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_lookup.c,v 1.25 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_ufs.h" @@ -380,7 +380,7 @@ notfound: * Access for write is interpreted as allowing * creation of files in the directory. */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td); + error = VOP_ACCESS(vdp, VWRITE, cred); if (error) return (error); /* @@ -464,7 +464,7 @@ found: /* * Write access to directory required to delete files. */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td); + error = VOP_ACCESS(vdp, VWRITE, cred); if (error) return (error); /* @@ -519,7 +519,7 @@ found: * regular file, or empty directory. */ if (nameiop == NAMEI_RENAME && wantparent) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred)) != 0) return (error); /* * Careful about locking second inode. @@ -903,7 +903,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, 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); + (void)UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, cred); if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); } @@ -1063,7 +1063,7 @@ ufs_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred) for (off = 0; off < ip->i_size; off += dp->d_reclen) { error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off, - UIO_SYSSPACE, IO_NODELOCKED, cred, &count, NULL); + UIO_SYSSPACE, IO_NODELOCKED, cred, &count); /* * Since we read MINDIRSIZ, residual must * be 0 unless we're at end of file. @@ -1131,8 +1131,8 @@ ufs_checkpath(struct inode *source, struct inode *target, struct ucred *cred) break; } error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, - sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED, cred, (int *)0, NULL); + sizeof (struct dirtemplate), (off_t)0, + UIO_SYSSPACE, IO_NODELOCKED, cred, (int *)0); if (error != 0) break; # if (BYTE_ORDER == LITTLE_ENDIAN) diff --git a/sys/vfs/ufs/ufs_quota.c b/sys/vfs/ufs/ufs_quota.c index 1cb4b90bfe..3512ad3858 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.20 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_quota.c,v 1.21 2006/05/06 02:43:14 dillon Exp $ */ #include @@ -488,7 +488,7 @@ ufs_quotaoff(struct thread *td, struct mount *mp, int type) } ufs_dqflush(qvp); qvp->v_flag &= ~VSYSTEM; - error = vn_close(qvp, FREAD|FWRITE, td); + error = vn_close(qvp, FREAD|FWRITE); ump->um_quotas[type] = NULLVP; crfree(ump->um_cred[type]); ump->um_cred[type] = NOCRED; diff --git a/sys/vfs/ufs/ufs_readwrite.c b/sys/vfs/ufs/ufs_readwrite.c index 7df8eba78d..dc0e27df2c 100644 --- a/sys/vfs/ufs/ufs_readwrite.c +++ b/sys/vfs/ufs/ufs_readwrite.c @@ -32,7 +32,7 @@ * * @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 * $FreeBSD: src/sys/ufs/ufs/ufs_readwrite.c,v 1.65.2.14 2003/04/04 22:21:29 tegge Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.15 2006/03/27 01:54:17 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.16 2006/05/06 02:43:14 dillon Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -491,8 +491,8 @@ ffs_write(struct vop_write_args *ap) VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0)); if (error) { if (ioflag & IO_UNIT) { - (void)UFS_TRUNCATE(vp, osize, - ioflag & IO_SYNC, ap->a_cred, uio->uio_td); + (void)UFS_TRUNCATE(vp, osize, ioflag & IO_SYNC, + ap->a_cred); uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } diff --git a/sys/vfs/ufs/ufs_vnops.c b/sys/vfs/ufs/ufs_vnops.c index 12dcaafa27..95bbb7e324 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.47 2006/05/05 21:15:10 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.48 2006/05/06 02:43:14 dillon Exp $ */ #include "opt_quota.h" @@ -80,8 +80,8 @@ static int ufs_access (struct vop_access_args *); static int ufs_advlock (struct vop_advlock_args *); -static int ufs_chmod (struct vnode *, int, struct ucred *, struct thread *); -static int ufs_chown (struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); +static int ufs_chmod (struct vnode *, int, struct ucred *); +static int ufs_chown (struct vnode *, uid_t, gid_t, struct ucred *); static int ufs_close (struct vop_close_args *); static int ufs_create (struct vop_old_create_args *); static int ufs_getattr (struct vop_getattr_args *); @@ -495,7 +495,7 @@ ufs_setattr(struct vop_setattr_args *ap) if (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - if ((error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred, ap->a_td)) != 0) + if ((error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred)) != 0) return (error); } if (vap->va_size != VNOVAL) { @@ -515,7 +515,7 @@ ufs_setattr(struct vop_setattr_args *ap) default: break; } - if ((error = UFS_TRUNCATE(vp, vap->va_size, 0, cred, ap->a_td)) != 0) + if ((error = UFS_TRUNCATE(vp, vap->va_size, 0, cred)) != 0) return (error); } ip = VTOI(vp); @@ -525,7 +525,7 @@ ufs_setattr(struct vop_setattr_args *ap) if (cred->cr_uid != ip->i_uid && (error = suser_cred(cred, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, cred, ap->a_td)))) + (error = VOP_ACCESS(vp, VWRITE, cred)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) ip->i_flag |= IN_ACCESS; @@ -548,7 +548,7 @@ ufs_setattr(struct vop_setattr_args *ap) if (vap->va_mode != (mode_t)VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - error = ufs_chmod(vp, (int)vap->va_mode, cred, ap->a_td); + error = ufs_chmod(vp, (int)vap->va_mode, cred); } VN_KNOTE(vp, NOTE_ATTRIB); return (error); @@ -559,7 +559,7 @@ ufs_setattr(struct vop_setattr_args *ap) * Inode must be locked before calling. */ static int -ufs_chmod(struct vnode *vp, int mode, struct ucred *cred, struct thread *td) +ufs_chmod(struct vnode *vp, int mode, struct ucred *cred) { struct inode *ip = VTOI(vp); int error; @@ -586,8 +586,7 @@ ufs_chmod(struct vnode *vp, int mode, struct ucred *cred, struct thread *td) * inode must be locked prior to call. */ static int -ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred, - struct thread *td) +ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred) { struct inode *ip = VTOI(vp); uid_t ouid; @@ -991,7 +990,7 @@ abortit: * to namei, as the parent directory is unlocked by the * call to checkpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred); VOP_UNLOCK(fvp, 0); /* @@ -1189,8 +1188,9 @@ abortit: xp->i_nlink--; xp->i_flag |= IN_CHANGE; ioflag = DOINGASYNC(tvp) ? 0 : IO_SYNC; - if ((error = UFS_TRUNCATE(tvp, (off_t)0, ioflag, - tcnp->cn_cred, tcnp->cn_td)) != 0) + error = UFS_TRUNCATE(tvp, (off_t)0, ioflag, + tcnp->cn_cred); + if (error) goto bad; } VN_KNOTE(tdvp, NOTE_WRITE); @@ -1577,8 +1577,7 @@ ufs_rmdir(struct vop_old_rmdir_args *ap) ip->i_nlink--; ip->i_flag |= IN_CHANGE; ioflag = DOINGASYNC(vp) ? 0 : IO_SYNC; - error = UFS_TRUNCATE(vp, (off_t)0, ioflag, cnp->cn_cred, - cnp->cn_td); + error = UFS_TRUNCATE(vp, (off_t)0, ioflag, cnp->cn_cred); } /* cache_purge removed - handled by VFS compat layer */ #ifdef UFS_DIRHASH @@ -1627,7 +1626,7 @@ ufs_symlink(struct vop_old_symlink_args *ap) vinitvmio(vp, 0); error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED, - ap->a_cnp->cn_cred, NULL, NULL); + ap->a_cnp->cn_cred, NULL); } if (error) vput(vp); diff --git a/sys/vfs/ufs/ufsmount.h b/sys/vfs/ufs/ufsmount.h index 81ca232ff2..92d8b4f034 100644 --- a/sys/vfs/ufs/ufsmount.h +++ b/sys/vfs/ufs/ufsmount.h @@ -32,7 +32,7 @@ * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 * $FreeBSD: src/sys/ufs/ufs/ufsmount.h,v 1.17 1999/12/29 04:55:06 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/ufsmount.h,v 1.7 2006/04/03 02:02:37 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufsmount.h,v 1.8 2006/05/06 02:43:14 dillon Exp $ */ #ifndef _VFS_UFS_UFSMOUNT_H_ @@ -96,15 +96,14 @@ struct ufsmount { struct malloc_type *um_malloctype; /* The inodes malloctype */ int um_i_effnlink_valid; /* i_effnlink valid? */ int (*um_blkatoff) (struct vnode *, off_t, char **, struct buf **); - int (*um_truncate) (struct vnode *, off_t, int, struct ucred *, - struct thread *); + int (*um_truncate) (struct vnode *, off_t, int, struct ucred *); int (*um_update) (struct vnode *, int); int (*um_valloc) (struct vnode *, int, struct ucred *, struct vnode **); int (*um_vfree) (struct vnode *, ino_t, int); }; #define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) -#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) +#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) #define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) diff --git a/sys/vfs/umapfs/umap_subr.c b/sys/vfs/umapfs/umap_subr.c index 7f4a142322..2b1f46e9b5 100644 --- a/sys/vfs/umapfs/umap_subr.c +++ b/sys/vfs/umapfs/umap_subr.c @@ -36,7 +36,7 @@ * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/umapfs/umap_subr.c,v 1.19 1999/09/04 11:51:41 bde Exp $ - * $DragonFly: src/sys/vfs/umapfs/Attic/umap_subr.c,v 1.13 2004/12/17 00:18:46 dillon Exp $ + * $DragonFly: src/sys/vfs/umapfs/Attic/umap_subr.c,v 1.14 2006/05/06 02:43:15 dillon Exp $ */ #include @@ -160,7 +160,7 @@ loop: * stuff, but we don't want to lock * the lower node. */ - if (vget(vp, LK_EXCLUSIVE|LK_SLEEPFAIL, td)) { + if (vget(vp, LK_EXCLUSIVE|LK_SLEEPFAIL)) { #ifdef DEBUG printf ("umap_node_find: vget failed.\n"); #endif diff --git a/sys/vfs/umapfs/umap_vnops.c b/sys/vfs/umapfs/umap_vnops.c index b2591de52c..b00dc9fdb8 100644 --- a/sys/vfs/umapfs/umap_vnops.c +++ b/sys/vfs/umapfs/umap_vnops.c @@ -35,7 +35,7 @@ * * @(#)umap_vnops.c 8.6 (Berkeley) 5/22/95 * $FreeBSD: src/sys/miscfs/umapfs/umap_vnops.c,v 1.30 1999/08/30 07:08:04 bde Exp $ - * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vnops.c,v 1.16 2006/04/23 00:54:57 dillon Exp $ + * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vnops.c,v 1.17 2006/05/06 02:43:15 dillon Exp $ */ /* @@ -387,7 +387,7 @@ umap_inactive(struct vop_inactive_args *ap) * cache and reusable. * */ - VOP_INACTIVE(lowervp, ap->a_td); + VOP_INACTIVE(lowervp); return (0); } diff --git a/sys/vfs/union/union_subr.c b/sys/vfs/union/union_subr.c index be3440e7df..09afdf67e9 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.23 2006/05/05 21:15:11 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_subr.c,v 1.24 2006/05/06 02:43:15 dillon Exp $ */ #include @@ -88,8 +88,7 @@ static int union_copyfile (struct vnode *, struct vnode *, struct ucred *, struct thread *); static int union_vn_create (struct vnode **, struct union_node *, struct thread *); -static int union_vn_close (struct vnode *, int, struct ucred *, - struct thread *); +static int union_vn_close (struct vnode *, int, struct ucred *); int union_init(void) @@ -392,8 +391,7 @@ loop: (un->un_uppervp == uppervp || un->un_uppervp == NULLVP) && (UNIONTOV(un)->v_mount == mp)) { - if (vget(UNIONTOV(un), LK_EXCLUSIVE|LK_SLEEPFAIL, - cnp ? cnp->cn_td : NULL)) { + if (vget(UNIONTOV(un), LK_EXCLUSIVE|LK_SLEEPFAIL)) { union_list_unlock(hash); goto loop; } @@ -727,7 +725,7 @@ union_copyup(struct union_node *un, int docopy, struct ucred *cred, * be copied to upper layer. */ vn_lock(un->un_lowervp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_ACCESS(un->un_lowervp, VREAD, cred, td); + error = VOP_ACCESS(un->un_lowervp, VREAD, cred); VOP_UNLOCK(un->un_lowervp, 0); if (error) return (error); @@ -745,11 +743,11 @@ union_copyup(struct union_node *un, int docopy, struct ucred *cred, * from VOP_CLOSE */ vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(lvp, FREAD, cred, NULL, td); + error = VOP_OPEN(lvp, FREAD, cred, NULL); if (error == 0) { error = union_copyfile(lvp, uvp, cred, td); VOP_UNLOCK(lvp, 0); - (void) VOP_CLOSE(lvp, FREAD, td); + (void) VOP_CLOSE(lvp, FREAD); } if (error == 0) UDEBUG(("union: copied up %s\n", un->un_path)); @@ -758,7 +756,7 @@ union_copyup(struct union_node *un, int docopy, struct ucred *cred, 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); + union_vn_close(uvp, FWRITE, cred); KASSERT(uvp->v_usecount > 0, ("copy: uvp refcount 0: %d", uvp->v_usecount)); /* * Subsequent IOs will go to the top layer, so @@ -772,8 +770,8 @@ union_copyup(struct union_node *un, int docopy, struct ucred *cred, int i; for (i = 0; i < un->un_openl; i++) { - VOP_CLOSE(lvp, FREAD, td); - VOP_OPEN(uvp, FREAD, cred, NULL, td); + VOP_CLOSE(lvp, FREAD); + VOP_OPEN(uvp, FREAD, cred, NULL); } un->un_openl = 0; } @@ -1032,7 +1030,7 @@ union_vn_create(struct vnode **vpp, struct union_node *un, struct thread *td) if (error) return (error); - error = VOP_OPEN(vp, fmode, cred, NULL, td); + error = VOP_OPEN(vp, fmode, cred, NULL); if (error) { vput(vp); return (error); @@ -1042,10 +1040,9 @@ union_vn_create(struct vnode **vpp, struct union_node *un, struct thread *td) } static int -union_vn_close(struct vnode *vp, int fmode, struct ucred *cred, - struct thread *td) +union_vn_close(struct vnode *vp, int fmode, struct ucred *cred) { - return (VOP_CLOSE(vp, fmode, td)); + return (VOP_CLOSE(vp, fmode)); } #if 0 @@ -1095,7 +1092,7 @@ union_dowhiteout(struct union_node *un, struct ucred *cred, struct thread *td) if (un->un_lowervp != NULLVP) return (1); - if (VOP_GETATTR(un->un_uppervp, &va, td) == 0 && + if (VOP_GETATTR(un->un_uppervp, &va) == 0 && (va.va_flags & OPAQUE)) return (1); @@ -1233,7 +1230,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) * If the directory is opaque, * then don't show lower entries */ - error = VOP_GETATTR(*vp, &va, td); + error = VOP_GETATTR(*vp, &va); if (va.va_flags & OPAQUE) { vput(lvp); lvp = NULL; @@ -1241,7 +1238,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) } if (lvp != NULLVP) { - error = VOP_OPEN(lvp, FREAD, fp->f_cred, NULL, td); + error = VOP_OPEN(lvp, FREAD, fp->f_cred, NULL); if (error) { vput(lvp); return (error); @@ -1249,7 +1246,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) VOP_UNLOCK(lvp, 0); fp->f_data = lvp; fp->f_offset = 0; - error = vn_close(*vp, FREAD, td); + error = vn_close(*vp, FREAD); if (error) return (error); *vp = lvp; diff --git a/sys/vfs/union/union_vnops.c b/sys/vfs/union/union_vnops.c index 60f8814d52..9be5e93adf 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.28 2006/05/05 21:27:58 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.29 2006/05/06 02:43:15 dillon Exp $ */ #include @@ -398,7 +398,7 @@ union_lookup(struct vop_old_lookup_args *ap) } else if (lowerdvp != NULLVP) { int terror; - terror = VOP_GETATTR(upperdvp, &va, cnp->cn_td); + terror = VOP_GETATTR(upperdvp, &va); if (terror == 0 && (va.va_flags & OPAQUE)) iswhiteout = 1; } @@ -748,7 +748,7 @@ union_open(struct vop_open_args *ap) * underlying filesystem uses buffer cache calls on it. */ if (error == 0) - error = VOP_OPEN(tvp, mode, cred, NULL, td); + error = VOP_OPEN(tvp, mode, cred, NULL); /* * Release any locks held @@ -899,7 +899,7 @@ union_getattr(struct vop_getattr_args *ap) vap = ap->a_vap; if ((vp = un->un_uppervp) != NULLVP) { - error = VOP_GETATTR(vp, vap, ap->a_td); + error = VOP_GETATTR(vp, vap); if (error) return (error); /* XXX isn't this dangerouso without a lock? */ @@ -916,7 +916,7 @@ union_getattr(struct vop_getattr_args *ap) } if (vp != NULLVP) { - error = VOP_GETATTR(vp, vap, ap->a_td); + error = VOP_GETATTR(vp, vap); if (error) return (error); /* XXX isn't this dangerous without a lock? */ @@ -970,8 +970,7 @@ union_setattr(struct vop_setattr_args *ap) */ error = EROFS; if ((uppervp = union_lock_upper(un, td)) != NULLVP) { - error = VOP_SETATTR(un->un_uppervp, ap->a_vap, - ap->a_cred, ap->a_td); + error = VOP_SETATTR(un->un_uppervp, ap->a_vap, ap->a_cred); if ((error == 0) && (ap->a_vap->va_size != VNOVAL)) union_newsize(ap->a_vp, ap->a_vap->va_size, VNOVAL); union_unlock_upper(uppervp, td); @@ -1181,7 +1180,7 @@ union_fsync(struct vop_fsync_args *ap) struct union_node *un = VTOUNION(ap->a_vp); if ((targetvp = union_lock_other(un, td)) != NULLVP) { - error = VOP_FSYNC(targetvp, ap->a_waitfor, td); + error = VOP_FSYNC(targetvp, ap->a_waitfor); union_unlock_other(targetvp, td); } diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index d0843e361e..97e221e2a2 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -39,7 +39,7 @@ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 * $FreeBSD: src/sys/vm/vm_mmap.c,v 1.108.2.6 2002/07/02 20:06:19 dillon Exp $ - * $DragonFly: src/sys/vm/vm_mmap.c,v 1.25 2006/03/29 18:45:07 dillon Exp $ + * $DragonFly: src/sys/vm/vm_mmap.c,v 1.26 2006/05/06 02:43:15 dillon Exp $ */ /* @@ -335,7 +335,7 @@ kern_mmap(caddr_t uaddr, size_t ulen, int uprot, int uflags, int fd, (vp->v_type == VCHR && disablexworkaround)) { if ((fp->f_flag & FWRITE) != 0) { struct vattr va; - if ((error = VOP_GETATTR(vp, &va, td))) { + if ((error = VOP_GETATTR(vp, &va))) { goto done; } if ((va.va_flags & @@ -978,7 +978,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, struct vattr vat; int error; - error = VOP_GETATTR(vp, &vat, td); + error = VOP_GETATTR(vp, &vat); if (error) return (error); objsize = vat.va_size; diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 140bc4ce4b..18c918148f 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -62,7 +62,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm_object.c,v 1.171.2.8 2003/05/26 19:17:56 alc Exp $ - * $DragonFly: src/sys/vm/vm_object.c,v 1.22 2005/06/02 20:57:21 swildner Exp $ + * $DragonFly: src/sys/vm/vm_object.c,v 1.23 2006/05/06 02:43:15 dillon Exp $ */ /* @@ -440,7 +440,7 @@ vm_object_terminate(vm_object_t object) vm_object_page_clean(object, 0, 0, OBJPC_SYNC); vp = (struct vnode *) object->handle; - vinvalbuf(vp, V_SAVE, NULL, 0, 0); + vinvalbuf(vp, V_SAVE, 0, 0); } /* @@ -717,10 +717,6 @@ again: } crit_exit(); -#if 0 - VOP_FSYNC(vp, NULL, (pagerflags & VM_PAGER_PUT_SYNC)?MNT_WAIT:0, curproc); -#endif - vm_object_clear_flag(object, OBJ_CLEANING); return; } diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 0d1004a923..f857435f97 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -66,7 +66,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm_pageout.c,v 1.151.2.15 2002/12/29 18:21:04 dillon Exp $ - * $DragonFly: src/sys/vm/vm_pageout.c,v 1.20 2006/05/05 20:15:02 dillon Exp $ + * $DragonFly: src/sys/vm/vm_pageout.c,v 1.21 2006/05/06 02:43:15 dillon Exp $ */ /* @@ -912,7 +912,7 @@ rescan0: if (object->type == OBJT_VNODE) { vp = object->handle; - if (vget(vp, LK_EXCLUSIVE|LK_NOOBJ|LK_TIMELOCK, curthread)) { + if (vget(vp, LK_EXCLUSIVE|LK_NOOBJ|LK_TIMELOCK)) { ++pageout_lock_miss; if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 3e6edc91b4..6429383437 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.24 2006/05/05 21:15:11 dillon Exp $ + * $DragonFly: src/sys/vm/vm_swap.c,v 1.25 2006/05/06 02:43:15 dillon Exp $ */ #include "opt_swap.h" @@ -202,7 +202,7 @@ swapon(struct swapon_args *uap) if (vn_isdisk(vp, &error)) error = swaponvp(td, vp, 0); else if (vp->v_type == VREG && vp->v_tag == VT_NFS && - (error = VOP_GETATTR(vp, &attr, td)) == 0) { + (error = VOP_GETATTR(vp, &attr)) == 0) { /* * Allow direct swapping to NFS regular files in the same * way that nfs_mountroot() sets up diskless swapping. @@ -263,7 +263,7 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) return EINVAL; found: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_OPEN(vp, FREAD | FWRITE, cred, NULL, td); + error = VOP_OPEN(vp, FREAD | FWRITE, cred, NULL); VOP_UNLOCK(vp, 0); if (error) return (error); @@ -278,11 +278,11 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) dev = NODEV; if (nblks == 0 && dev != NODEV && ((nblks = dev_dpsize(dev)) == -1)) { - VOP_CLOSE(vp, FREAD | FWRITE, td); + VOP_CLOSE(vp, FREAD | FWRITE); return (ENXIO); } if (nblks == 0) { - VOP_CLOSE(vp, FREAD | FWRITE, td); + VOP_CLOSE(vp, FREAD | FWRITE); return (ENXIO); } @@ -293,7 +293,7 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) if (nblks > 0x40000000 / BLIST_META_RADIX / nswdev) { printf("exceeded maximum of %d blocks per swap unit\n", 0x40000000 / BLIST_META_RADIX / nswdev); - VOP_CLOSE(vp, FREAD | FWRITE, td); + VOP_CLOSE(vp, FREAD | FWRITE); return (ENXIO); } /* diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 24c6a1cba3..76df13445e 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -39,7 +39,7 @@ * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 * $FreeBSD: src/sys/vm/vnode_pager.c,v 1.116.2.7 2002/12/31 09:34:51 dillon Exp $ - * $DragonFly: src/sys/vm/vnode_pager.c,v 1.26 2006/05/03 20:44:49 dillon Exp $ + * $DragonFly: src/sys/vm/vnode_pager.c,v 1.27 2006/05/06 02:43:15 dillon Exp $ */ /* @@ -1029,7 +1029,7 @@ vnode_pager_lock(vm_object_t object) for (;;) { struct vnode *vp = object->handle; error = vget(vp, LK_NOPAUSE | LK_SHARED | - LK_RETRY | LK_CANRECURSE, td); + LK_RETRY | LK_CANRECURSE); if (error == 0) { if (object->handle != vp) { vput(vp); -- 2.41.0