From 3b5687877febd6fd2390247b524f57d810d31d1b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 26 Jun 2003 05:55:21 +0000 Subject: [PATCH] proc->thread stage 5: BUF/VFS clearance! Remove the ucred argument from vop_close, vop_getattr, vop_fsync, and vop_createvobject. These VOPs can be called from multiple contexts so the cred is fairly useless, and UFS ignorse it anyway. For filesystems (like NFS) that sometimes need a cred we use proc0.p_ucred for now. This removal also removed the need for a 'proc' reference in the related VFS procedures, which greatly helps our proc->thread conversion. bp->b_wcred and bp->b_rcred have also been removed, and for the same reason. It makes no sense to have a particular cred when multiple users can access a file. This may create issues with certain types of NFS mounts but if it does we will solve them in a way that doesn't pollute the struct buf. --- sys/dev/disk/ccd/ccd.c | 13 +- sys/dev/disk/vn/vn.c | 10 +- sys/dev/raid/vinum/.gdbinit.kernel | 4 - sys/dev/raid/vinum/vinumrequest.c | 4 +- sys/emulation/ibcs2/coff/imgact_coff.c | 4 +- sys/emulation/ibcs2/i386/ibcs2_util.c | 6 +- .../linux/i386/linprocfs/linprocfs_vnops.c | 4 +- sys/emulation/linux/linux_file.c | 4 +- sys/emulation/linux/linux_getcwd.c | 4 +- sys/emulation/linux/linux_misc.c | 4 +- sys/emulation/linux/linux_util.c | 6 +- sys/emulation/svr4/svr4_fcntl.c | 6 +- sys/emulation/svr4/svr4_misc.c | 4 +- sys/emulation/svr4/svr4_sysvec.c | 6 +- sys/kern/kern_acct.c | 12 +- sys/kern/kern_exec.c | 4 +- sys/kern/kern_ktrace.c | 9 +- sys/kern/kern_linker.c | 4 +- sys/kern/kern_sig.c | 6 +- sys/kern/link_aout.c | 4 +- sys/kern/link_elf.c | 4 +- sys/kern/vfs_bio.c | 35 +--- sys/kern/vfs_cluster.c | 11 +- sys/kern/vfs_default.c | 9 +- sys/kern/vfs_lookup.c | 8 +- sys/kern/vfs_subr.c | 30 ++- sys/kern/vfs_syscalls.c | 25 ++- sys/kern/vfs_vnops.c | 14 +- sys/kern/vnode_if.src | 6 +- sys/sys/buf.h | 11 +- sys/sys/mount.h | 9 +- sys/sys/vnode.h | 12 +- sys/vfs/coda/coda_psdev.c | 8 +- sys/vfs/coda/coda_vfsops.c | 5 +- sys/vfs/coda/coda_vfsops.h | 4 +- sys/vfs/coda/coda_vnops.c | 29 ++- sys/vfs/fifofs/fifo_vnops.c | 4 +- sys/vfs/gnu/ext2fs/ext2_readwrite.c | 5 +- sys/vfs/gnu/ext2fs/ext2_vfsops.c | 8 +- sys/vfs/hpfs/hpfs_alsubr.c | 4 +- sys/vfs/hpfs/hpfs_subr.c | 10 +- sys/vfs/hpfs/hpfs_vfsops.c | 8 +- sys/vfs/isofs/cd9660/cd9660_lookup.c | 4 +- sys/vfs/isofs/cd9660/cd9660_rrip.c | 4 +- sys/vfs/isofs/cd9660/cd9660_vfsops.c | 17 +- sys/vfs/isofs/cd9660/cd9660_vnops.c | 15 +- sys/vfs/mfs/mfs_vnops.c | 4 +- sys/vfs/msdosfs/denode.h | 6 +- sys/vfs/msdosfs/msdosfs_denode.c | 22 +-- sys/vfs/msdosfs/msdosfs_fat.c | 15 +- sys/vfs/msdosfs/msdosfs_lookup.c | 23 ++- sys/vfs/msdosfs/msdosfs_vfsops.c | 29 ++- sys/vfs/msdosfs/msdosfs_vnops.c | 26 ++- sys/vfs/nfs/nfs.h | 29 ++- sys/vfs/nfs/nfs_bio.c | 115 +++++------- sys/vfs/nfs/nfs_node.c | 6 +- sys/vfs/nfs/nfs_nqlease.c | 20 +- sys/vfs/nfs/nfs_serv.c | 103 +++++------ sys/vfs/nfs/nfs_subs.c | 5 +- sys/vfs/nfs/nfs_syscalls.c | 7 +- sys/vfs/nfs/nfs_vfsops.c | 32 ++-- sys/vfs/nfs/nfs_vnops.c | 173 ++++++------------ sys/vfs/nfs/nfsmount.h | 6 +- sys/vfs/nfs/nqnfs.h | 4 +- sys/vfs/ntfs/ntfs_subr.c | 9 +- sys/vfs/ntfs/ntfs_vfsops.c | 20 +- sys/vfs/ntfs/ntfs_vnops.c | 4 +- sys/vfs/nullfs/null_vfsops.c | 8 +- sys/vfs/nullfs/null_vnops.c | 4 +- sys/vfs/nwfs/nwfs.h | 5 +- sys/vfs/nwfs/nwfs_io.c | 19 +- sys/vfs/nwfs/nwfs_node.c | 4 +- sys/vfs/nwfs/nwfs_vfsops.c | 9 +- sys/vfs/nwfs/nwfs_vnops.c | 33 ++-- sys/vfs/procfs/procfs_vnops.c | 4 +- sys/vfs/smbfs/smbfs.h | 4 +- sys/vfs/smbfs/smbfs_io.c | 19 +- sys/vfs/smbfs/smbfs_node.c | 4 +- sys/vfs/smbfs/smbfs_vfsops.c | 9 +- sys/vfs/smbfs/smbfs_vnops.c | 40 ++-- sys/vfs/specfs/spec_vnops.c | 4 +- sys/vfs/ufs/ffs_alloc.c | 22 +-- sys/vfs/ufs/ffs_balloc.c | 20 +- sys/vfs/ufs/ffs_extern.h | 7 +- sys/vfs/ufs/ffs_inode.c | 13 +- sys/vfs/ufs/ffs_softdep.c | 31 ++-- sys/vfs/ufs/ffs_subr.c | 4 +- sys/vfs/ufs/ffs_vfsops.c | 50 +++-- sys/vfs/ufs/ufs_quota.c | 6 +- sys/vfs/ufs/ufs_readwrite.c | 10 +- sys/vfs/ufs/ufs_vnops.c | 3 +- sys/vfs/umapfs/umap_vfsops.c | 6 +- sys/vfs/union/union_subr.c | 22 +-- sys/vfs/union/union_vnops.c | 17 +- sys/vm/swap_pager.c | 7 +- sys/vm/vm_mmap.c | 7 +- sys/vm/vm_object.c | 4 +- sys/vm/vm_pager.c | 17 +- sys/vm/vm_swap.c | 10 +- sys/vm/vnode_pager.c | 6 +- 100 files changed, 642 insertions(+), 861 deletions(-) diff --git a/sys/dev/disk/ccd/ccd.c b/sys/dev/disk/ccd/ccd.c index 1b432f683b..a5d51b4b85 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.5 2003/06/25 03:55:47 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/ccd/ccd.c,v 1.6 2003/06/26 05:55:11 dillon Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -1333,8 +1333,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, - cred, td); + (void)vn_close(vpp[j], FREAD|FWRITE, td); free(vpp, M_DEVBUF); free(cpp, M_DEVBUF); ccdunlock(cs); @@ -1351,8 +1350,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, - cred, td); + (void)vn_close(vpp[j], FREAD|FWRITE, td); bzero(&ccd_softc[unit], sizeof(struct ccd_softc)); free(vpp, M_DEVBUF); free(cpp, M_DEVBUF); @@ -1407,8 +1405,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, - cred, td); + (void)vn_close(cs->sc_cinfo[i].ci_vp, FREAD|FWRITE, td); free(cs->sc_cinfo[i].ci_path, M_DEVBUF); } @@ -1588,7 +1585,7 @@ bad: VOP_UNLOCK(vp, 0, td); NDFREE(&nd, NDF_ONLY_PNBUF); /* vn_close does vrele() for vp */ - (void)vn_close(vp, FREAD|FWRITE, cred, td); + (void)vn_close(vp, FREAD|FWRITE, td); return (error); } diff --git a/sys/dev/disk/vn/vn.c b/sys/dev/disk/vn/vn.c index 1c7d086950..d3567fe9b1 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.4 2003/06/25 03:55:51 dillon Exp $ + * $DragonFly: src/sys/dev/disk/vn/vn.c,v 1.5 2003/06/26 05:55:11 dillon Exp $ */ /* @@ -557,9 +557,9 @@ vniocattach_file(vn, vio, dev, flag, td) } NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp->v_type != VREG || - (error = VOP_GETATTR(nd.ni_vp, &vattr, p->p_ucred, td))) { + (error = VOP_GETATTR(nd.ni_vp, &vattr, td))) { VOP_UNLOCK(nd.ni_vp, 0, td); - (void) vn_close(nd.ni_vp, flags, p->p_ucred, td); + (void) vn_close(nd.ni_vp, flags, td); return (error ? error : EINVAL); } VOP_UNLOCK(nd.ni_vp, 0, td); @@ -576,7 +576,7 @@ vniocattach_file(vn, vio, dev, flag, td) vn->sc_size = vattr.va_size / vn->sc_secsize; error = vnsetcred(vn, p->p_ucred); if (error) { - (void) vn_close(nd.ni_vp, flags, p->p_ucred, td); + (void) vn_close(nd.ni_vp, flags, td); return(error); } vn->sc_flags |= VNF_INITED; @@ -733,7 +733,7 @@ vnclear(struct vn_softc *vn) vn->sc_flags &= ~VNF_INITED; if (vn->sc_vp != NULL) { (void)vn_close(vn->sc_vp, vn->sc_flags & VNF_READONLY ? - FREAD : (FREAD|FWRITE), vn->sc_cred, td); + FREAD : (FREAD|FWRITE), td); vn->sc_vp = NULL; } vn->sc_flags &= ~VNF_READONLY; diff --git a/sys/dev/raid/vinum/.gdbinit.kernel b/sys/dev/raid/vinum/.gdbinit.kernel index c814d7f1d5..557ab98868 100644 --- a/sys/dev/raid/vinum/.gdbinit.kernel +++ b/sys/dev/raid/vinum/.gdbinit.kernel @@ -302,10 +302,6 @@ printf "\nb_dirtyend: " output $bp->b_dirtyend printf "\nb_generation: " output $bp->b_generation -printf "\nb_rcred: " -output $bp->b_rcred -printf "\nb_wcred: " -output $bp->b_wcred printf "\nb_validoff: " output $bp->b_validoff printf "\nb_validend: " diff --git a/sys/dev/raid/vinum/vinumrequest.c b/sys/dev/raid/vinum/vinumrequest.c index 3a9c07af69..9d2efc67de 100644 --- a/sys/dev/raid/vinum/vinumrequest.c +++ b/sys/dev/raid/vinum/vinumrequest.c @@ -39,7 +39,7 @@ * * $Id: vinumrequest.c,v 1.30 2001/01/09 04:20:55 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumrequest.c,v 1.44.2.5 2002/08/28 04:30:56 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumrequest.c,v 1.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumrequest.c,v 1.3 2003/06/26 05:55:11 dillon Exp $ */ #include @@ -825,8 +825,6 @@ build_rq_buffer(struct rqelement *rqe, struct plex *plex) bp->b_bcount = rqe->buflen << DEV_BSHIFT; /* number of bytes to transfer */ bp->b_resid = bp->b_bcount; /* and it's still all waiting */ bp->b_bufsize = bp->b_bcount; /* and buffer size */ - bp->b_rcred = FSCRED; /* we have the file system credentials */ - bp->b_wcred = FSCRED; /* we have the file system credentials */ if (rqe->flags & XFR_MALLOCED) { /* this operation requires a malloced buffer */ bp->b_data = Malloc(bp->b_bcount); /* get a buffer to put it in */ diff --git a/sys/emulation/ibcs2/coff/imgact_coff.c b/sys/emulation/ibcs2/coff/imgact_coff.c index b9403e57ae..0950a11380 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.3 2003/06/25 03:55:53 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/coff/Attic/imgact_coff.c,v 1.4 2003/06/26 05:55:13 dillon Exp $ */ #include @@ -188,7 +188,7 @@ coff_load_file(struct thread *td, char *name) goto fail; } - if ((error = VOP_GETATTR(vp, &attr, cred, td)) != 0) + if ((error = VOP_GETATTR(vp, &attr, td)) != 0) goto fail; if ((vp->v_mount->mnt_flag & MNT_NOEXEC) diff --git a/sys/emulation/ibcs2/i386/ibcs2_util.c b/sys/emulation/ibcs2/i386/ibcs2_util.c index 8a6fcbb044..9da2f276b9 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.4 2003/06/25 03:55:53 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_util.c,v 1.5 2003/06/26 05:55:13 dillon Exp $ */ #include @@ -147,11 +147,11 @@ ibcs2_emul_find(sgp, prefix, path, pbuf, cflag) return error; } - if ((error = VOP_GETATTR(nd.ni_vp, &vat, cred, td)) != 0) { + if ((error = VOP_GETATTR(nd.ni_vp, &vat, td)) != 0) { goto done; } - if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, cred, td)) + if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, td)) != 0) { goto done; } diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c index 129025af3d..58062dbc8a 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.4 2003/06/25 03:55:55 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.5 2003/06/26 05:55:13 dillon Exp $ */ /* @@ -602,7 +602,7 @@ linprocfs_access(ap) return (0); vap = &vattr; - error = VOP_GETATTR(ap->a_vp, vap, ap->a_cred, ap->a_td); + error = VOP_GETATTR(ap->a_vp, vap, ap->a_td); if (error) return (error); diff --git a/sys/emulation/linux/linux_file.c b/sys/emulation/linux/linux_file.c index 96c2135911..3ce328909f 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.4 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_file.c,v 1.5 2003/06/26 05:55:10 dillon Exp $ */ #include "opt_compat.h" @@ -282,7 +282,7 @@ getdents_common(struct linux_getdents64_args *args, int is64bit) if (vp->v_type != VDIR) return (EINVAL); - if ((error = VOP_GETATTR(vp, &va, p->p_ucred, td))) + if ((error = VOP_GETATTR(vp, &va, td))) return (error); nbytes = args->count; diff --git a/sys/emulation/linux/linux_getcwd.c b/sys/emulation/linux/linux_getcwd.c index 9e5da04b15..74b160d8f6 100644 --- a/sys/emulation/linux/linux_getcwd.c +++ b/sys/emulation/linux/linux_getcwd.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/compat/linux/linux_getcwd.c,v 1.2.2.3 2001/11/05 19:08:22 marcel Exp $ */ -/* $DragonFly: src/sys/emulation/linux/linux_getcwd.c,v 1.4 2003/06/25 03:55:44 dillon Exp $ */ +/* $DragonFly: src/sys/emulation/linux/linux_getcwd.c,v 1.5 2003/06/26 05:55:10 dillon Exp $ */ /* $OpenBSD: linux_getcwd.c,v 1.2 2001/05/16 12:50:21 ho Exp $ */ /* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ @@ -136,7 +136,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bufp, td) * current directory is still locked. */ if (bufp != NULL) { - error = VOP_GETATTR(lvp, &va, p->p_ucred, td); + error = VOP_GETATTR(lvp, &va, td); if (error) { vput(lvp); *lvpp = NULL; diff --git a/sys/emulation/linux/linux_misc.c b/sys/emulation/linux/linux_misc.c index 7ff1f5479b..bf63c55965 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.4 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.5 2003/06/26 05:55:10 dillon Exp $ */ #include "opt_compat.h" @@ -296,7 +296,7 @@ linux_uselib(struct linux_uselib_args *args) } /* Executable? */ - error = VOP_GETATTR(vp, &attr, p->p_ucred, td); + error = VOP_GETATTR(vp, &attr, td); if (error) goto cleanup; diff --git a/sys/emulation/linux/linux_util.c b/sys/emulation/linux/linux_util.c index 0af8a889bc..6d065d0782 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.4 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_util.c,v 1.5 2003/06/26 05:55:10 dillon Exp $ */ #include @@ -145,11 +145,11 @@ linux_emul_find(td, sgp, prefix, path, pbuf, cflag) return error; } - if ((error = VOP_GETATTR(nd.ni_vp, &vat, cred, td)) != 0) { + if ((error = VOP_GETATTR(nd.ni_vp, &vat, td)) != 0) { goto bad; } - if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, cred, td)) + if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, td)) != 0) { goto bad; } diff --git a/sys/emulation/svr4/svr4_fcntl.c b/sys/emulation/svr4/svr4_fcntl.c index 2ee3a208ff..60d1d9bb9d 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.5 2003/06/25 03:56:09 dillon Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_fcntl.c,v 1.6 2003/06/26 05:55:19 dillon Exp $ */ #include #include @@ -269,7 +269,7 @@ fd_revoke(struct thread *td, int fd) goto out; } - if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, td)) != 0) + if ((error = VOP_GETATTR(vp, &vattr, td)) != 0) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && @@ -310,7 +310,7 @@ fd_truncate(struct thread *td, int fd, struct flock *flp) if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) return ESPIPE; - if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, td)) != 0) + if ((error = VOP_GETATTR(vp, &vattr, td)) != 0) return error; length = vattr.va_size; diff --git a/sys/emulation/svr4/svr4_misc.c b/sys/emulation/svr4/svr4_misc.c index a6daa2828a..37562f7cb3 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.4 2003/06/25 03:56:10 dillon Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_misc.c,v 1.5 2003/06/26 05:55:19 dillon Exp $ */ /* @@ -263,7 +263,7 @@ svr4_sys_getdents64(struct svr4_sys_getdents64_args *uap) if (vp->v_type != VDIR) return (EINVAL); - if ((error = VOP_GETATTR(vp, &va, p->p_ucred, td))) { + if ((error = VOP_GETATTR(vp, &va, td))) { return error; } diff --git a/sys/emulation/svr4/svr4_sysvec.c b/sys/emulation/svr4/svr4_sysvec.c index f4ab874493..3207111721 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.4 2003/06/25 03:56:10 dillon Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_sysvec.c,v 1.5 2003/06/26 05:55:19 dillon Exp $ */ /* XXX we use functions that might not exist. */ @@ -337,11 +337,11 @@ svr4_emul_find(sgp, prefix, path, pbuf, cflag) } NDFREE(&ndroot, NDF_ONLY_PNBUF); - if ((error = VOP_GETATTR(nd.ni_vp, &vat, cred, td)) != 0) { + if ((error = VOP_GETATTR(nd.ni_vp, &vat, td)) != 0) { goto done; } - if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, cred, td)) + if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, td)) != 0) { goto done; } diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 368ca82e6d..7ac7b2ca61 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.4 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/kern_acct.c,v 1.5 2003/06/26 05:55:14 dillon Exp $ */ #include @@ -117,7 +117,6 @@ acct(uap) } */ *uap; { struct thread *td = curthread; - struct proc *p = td->td_proc; /* XXX */ struct nameidata nd; int error; @@ -139,7 +138,7 @@ acct(uap) NDFREE(&nd, NDF_ONLY_PNBUF); VOP_UNLOCK(nd.ni_vp, 0, td); if (nd.ni_vp->v_type != VREG) { - vn_close(nd.ni_vp, FWRITE | O_APPEND, p->p_ucred, td); + vn_close(nd.ni_vp, FWRITE | O_APPEND, td); return (EACCES); } } @@ -151,7 +150,7 @@ acct(uap) if (acctp != NULLVP || savacctp != NULLVP) { untimeout(acctwatch, NULL, acctwatch_handle); error = vn_close((acctp != NULLVP ? acctp : savacctp), - FWRITE | O_APPEND, p->p_ucred, td); + FWRITE | O_APPEND, td); acctp = savacctp = NULLVP; } if (SCARG(uap, path) == NULL) @@ -305,8 +304,7 @@ acctwatch(a) if (savacctp != NULLVP) { if (savacctp->v_type == VBAD) { - (void) vn_close(savacctp, FWRITE | O_APPEND, NOCRED, - NULL); + (void) vn_close(savacctp, FWRITE | O_APPEND, NULL); savacctp = NULLVP; return; } @@ -320,7 +318,7 @@ acctwatch(a) if (acctp == NULLVP) return; if (acctp->v_type == VBAD) { - (void) vn_close(acctp, FWRITE | O_APPEND, NOCRED, NULL); + (void) vn_close(acctp, FWRITE | O_APPEND, NULL); acctp = NULLVP; return; } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 4f78ee6821..dcb3d42f30 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.5 2003/06/26 02:17:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_exec.c,v 1.6 2003/06/26 05:55:14 dillon Exp $ */ #include @@ -749,7 +749,7 @@ exec_check_permissions(imgp) int error; /* Get file attributes */ - error = VOP_GETATTR(vp, attr, p->p_ucred, td); + error = VOP_GETATTR(vp, attr, td); if (error) return (error); diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 6399f4b34a..a8d3992b5c 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.4 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/kern_ktrace.c,v 1.5 2003/06/26 05:55:14 dillon Exp $ */ #include "opt_ktrace.h" @@ -299,7 +299,7 @@ ktrace(struct ktrace_args *uap) vp = nd.ni_vp; VOP_UNLOCK(vp, 0, td); if (vp->v_type != VREG) { - (void) vn_close(vp, FREAD|FWRITE, curp->p_ucred, td); + (void) vn_close(vp, FREAD|FWRITE, td); curp->p_traceflag &= ~KTRFAC_ACTIVE; return (EACCES); } @@ -314,8 +314,7 @@ ktrace(struct ktrace_args *uap) if (ktrcanset(curp, p) && p->p_tracep == vp) { p->p_tracep = NULL; p->p_traceflag = 0; - (void) vn_close(vp, FREAD|FWRITE, - p->p_ucred, td); + (void) vn_close(vp, FREAD|FWRITE, td); } else { error = EPERM; } @@ -366,7 +365,7 @@ ktrace(struct ktrace_args *uap) error = EPERM; done: if (vp != NULL) - (void) vn_close(vp, FWRITE, curp->p_ucred, td); + (void) vn_close(vp, FWRITE, td); curp->p_traceflag &= ~KTRFAC_ACTIVE; return (error); #else diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 0c626d5799..30b061b756 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_linker.c,v 1.41.2.3 2001/11/21 17:50:35 luigi Exp $ - * $DragonFly: src/sys/kern/kern_linker.c,v 1.4 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/kern_linker.c,v 1.5 2003/06/26 05:55:14 dillon Exp $ */ #include "opt_ddb.h" @@ -1043,7 +1043,7 @@ linker_search_path(const char *name) NDFREE(&nd, NDF_ONLY_PNBUF); type = nd.ni_vp->v_type; VOP_UNLOCK(nd.ni_vp, 0, td); - vn_close(nd.ni_vp, FREAD, p->p_ucred, td); + vn_close(nd.ni_vp, FREAD, td); if (type == VREG) return(result); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index e62eeb2665..04434935ba 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.5 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/kern_sig.c,v 1.6 2003/06/26 05:55:14 dillon Exp $ */ #include "opt_compat.h" @@ -1615,7 +1615,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, cred, td) || vattr.va_nlink != 1) { + VOP_GETATTR(vp, &vattr, td) || vattr.va_nlink != 1) { error = EFAULT; goto out1; } @@ -1636,7 +1636,7 @@ out1: lf.l_type = F_UNLCK; VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &lf, F_FLOCK); out2: - error1 = vn_close(vp, FWRITE, cred, td); + error1 = vn_close(vp, FWRITE, td); if (error == 0) error = error1; return (error); diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c index 3d17201eff..46cf7b509d 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.3 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/link_aout.c,v 1.4 2003/06/26 05:55:14 dillon Exp $ */ #ifndef __alpha__ @@ -271,7 +271,7 @@ link_aout_load_file(const char* filename, linker_file_t* result) out: VOP_UNLOCK(nd.ni_vp, 0, td); - vn_close(nd.ni_vp, FREAD, p->p_ucred, td); + vn_close(nd.ni_vp, FREAD, td); return error; } diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index ae207129bb..12461f8ab7 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.3 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/link_elf.c,v 1.4 2003/06/26 05:55:14 dillon Exp $ */ #include @@ -689,7 +689,7 @@ out: if (firstpage) free(firstpage, M_LINKER); VOP_UNLOCK(nd.ni_vp, 0, td); - vn_close(nd.ni_vp, FREAD, p->p_ucred, td); + vn_close(nd.ni_vp, FREAD, td); return error; } diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 76b4ae70c3..0b94be8826 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -12,7 +12,7 @@ * John S. Dyson. * * $FreeBSD: src/sys/kern/vfs_bio.c,v 1.242.2.20 2003/05/28 18:38:10 alc Exp $ - * $DragonFly: src/sys/kern/vfs_bio.c,v 1.4 2003/06/22 17:39:42 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_bio.c,v 1.5 2003/06/26 05:55:14 dillon Exp $ */ /* @@ -353,8 +353,6 @@ bufinit(void) bzero(bp, sizeof *bp); bp->b_flags = B_INVAL; /* we're just an empty header */ bp->b_dev = NODEV; - bp->b_rcred = NOCRED; - bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_EMPTY; bp->b_xflags = 0; LIST_INIT(&bp->b_dep); @@ -505,8 +503,7 @@ bremfree(struct buf * bp) * getblk() ). */ int -bread(struct vnode * vp, daddr_t blkno, int size, struct ucred * cred, - struct buf ** bpp) +bread(struct vnode * vp, daddr_t blkno, int size, struct buf ** bpp) { struct buf *bp; @@ -520,11 +517,6 @@ bread(struct vnode * vp, daddr_t blkno, int size, struct ucred * cred, KASSERT(!(bp->b_flags & B_ASYNC), ("bread: illegal async bp %p", bp)); bp->b_flags |= B_READ; bp->b_flags &= ~(B_ERROR | B_INVAL); - if (bp->b_rcred == NOCRED) { - if (cred != NOCRED) - crhold(cred); - bp->b_rcred = cred; - } vfs_busy_pages(bp, 0); VOP_STRATEGY(vp, bp); return (biowait(bp)); @@ -539,9 +531,8 @@ bread(struct vnode * vp, daddr_t blkno, int size, struct ucred * cred, * and we do not have to do anything. */ int -breadn(struct vnode * vp, daddr_t blkno, int size, - daddr_t * rablkno, int *rabsize, - int cnt, struct ucred * cred, struct buf ** bpp) +breadn(struct vnode * vp, daddr_t blkno, int size, daddr_t * rablkno, + int *rabsize, int cnt, struct buf ** bpp) { struct buf *bp, *rabp; int i; @@ -555,11 +546,6 @@ breadn(struct vnode * vp, daddr_t blkno, int size, curproc->p_stats->p_ru.ru_inblock++; bp->b_flags |= B_READ; bp->b_flags &= ~(B_ERROR | B_INVAL); - if (bp->b_rcred == NOCRED) { - if (cred != NOCRED) - crhold(cred); - bp->b_rcred = cred; - } vfs_busy_pages(bp, 0); VOP_STRATEGY(vp, bp); ++readwait; @@ -575,11 +561,6 @@ breadn(struct vnode * vp, daddr_t blkno, int size, curproc->p_stats->p_ru.ru_inblock++; rabp->b_flags |= B_READ | B_ASYNC; rabp->b_flags &= ~(B_ERROR | B_INVAL); - if (rabp->b_rcred == NOCRED) { - if (cred != NOCRED) - crhold(cred); - rabp->b_rcred = cred; - } vfs_busy_pages(rabp, 0); BUF_KERNPROC(rabp); VOP_STRATEGY(vp, rabp); @@ -1639,14 +1620,6 @@ restart: * valid after this operation. */ - if (bp->b_rcred != NOCRED) { - crfree(bp->b_rcred); - bp->b_rcred = NOCRED; - } - if (bp->b_wcred != NOCRED) { - crfree(bp->b_wcred); - bp->b_wcred = NOCRED; - } if (LIST_FIRST(&bp->b_dep) != NULL && bioops.io_deallocate) (*bioops.io_deallocate)(bp); if (bp->b_xflags & BX_BKGRDINPROG) diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 7dcbccbfd6..3a1b30a2a2 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -34,7 +34,7 @@ * * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 * $FreeBSD: src/sys/kern/vfs_cluster.c,v 1.92.2.9 2001/11/18 07:10:59 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_cluster.c,v 1.4 2003/06/26 02:17:45 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_cluster.c,v 1.5 2003/06/26 05:55:14 dillon Exp $ */ #include "opt_debug_cluster.h" @@ -85,12 +85,11 @@ extern int cluster_pbuf_freecnt; * This replaces bread. */ int -cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) +cluster_read(vp, filesize, lblkno, size, totread, seqcount, bpp) struct vnode *vp; u_quad_t filesize; daddr_t lblkno; long size; - struct ucred *cred; long totread; int seqcount; struct buf **bpp; @@ -804,9 +803,6 @@ cluster_wbuild(vp, size, start_lbn, len) bp->b_bcount = 0; bp->b_bufsize = 0; bp->b_npages = 0; - if (tbp->b_wcred != NOCRED) - bp->b_wcred = crhold(tbp->b_wcred); - bp->b_blkno = tbp->b_blkno; bp->b_lblkno = tbp->b_lblkno; bp->b_offset = tbp->b_offset; @@ -852,7 +848,6 @@ cluster_wbuild(vp, size, start_lbn, len) != (B_DELWRI | B_CLUSTEROK | (bp->b_flags & (B_VMIO | B_NEEDCOMMIT))) || (tbp->b_flags & B_LOCKED) || - tbp->b_wcred != bp->b_wcred || BUF_LOCK(tbp, LK_EXCLUSIVE | LK_NOWAIT)) { splx(s); break; @@ -969,7 +964,7 @@ cluster_collectbufs(vp, last_bp) buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **) (buflist + 1); for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) { - (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp); + (void) bread(vp, lbn, last_bp->b_bcount, &bp); buflist->bs_children[i] = bp; if (bp->b_blkno == bp->b_lblkno) VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno, diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index d9a14d0bad..079864d384 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.3 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_default.c,v 1.4 2003/06/26 05:55:14 dillon Exp $ */ #include @@ -511,12 +511,10 @@ int vop_stdcreatevobject(ap) struct vop_createvobject_args /* { struct vnode *a_vp; - struct ucred *a_cred; struct proc *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; - struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; struct vattr vat; vm_object_t object; @@ -528,7 +526,7 @@ vop_stdcreatevobject(ap) retry: if ((object = vp->v_object) == NULL) { if (vp->v_type == VREG || vp->v_type == VDIR) { - if ((error = VOP_GETATTR(vp, &vat, cred, td)) != 0) + if ((error = VOP_GETATTR(vp, &vat, td)) != 0) goto retn; object = vnode_pager_alloc(vp, vat.va_size, 0, 0); } else if (devsw(vp->v_rdev) != NULL) { @@ -667,8 +665,7 @@ vfs_stdquotactl(struct mount *mp, int cmds, uid_t uid, } int -vfs_stdsync(struct mount *mp, int waitfor, - struct ucred *cred, struct thread *td) +vfs_stdsync(struct mount *mp, int waitfor, struct thread *td) { return (0); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 5a0eaee708..ecd09d3085 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -37,7 +37,7 @@ * * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 * $FreeBSD: src/sys/kern/vfs_lookup.c,v 1.38.2.3 2001/08/31 19:36:49 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_lookup.c,v 1.3 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_lookup.c,v 1.4 2003/06/26 05:55:14 dillon Exp $ */ #include "opt_ktrace.h" @@ -171,9 +171,7 @@ namei(struct nameidata *ndp) (cnp->cn_nameiop != DELETE) && ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF)) - vfs_object_create(ndp->ni_vp, - ndp->ni_cnd.cn_td, - ndp->ni_cnd.cn_cred); + vfs_object_create(ndp->ni_vp, ndp->ni_cnd.cn_td); return (0); } @@ -719,7 +717,7 @@ relookup(dvp, vpp, cnp) if (vn_canvmio(dp) == TRUE && ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF)) - vfs_object_create(dp, cnp->cn_td, cnp->cn_cred); + vfs_object_create(dp, cnp->cn_td); if ((cnp->cn_flags & LOCKLEAF) == 0) VOP_UNLOCK(dp, 0, td); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8af1514a15..003a8e9220 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.6 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_subr.c,v 1.7 2003/06/26 05:55:14 dillon Exp $ */ /* @@ -578,7 +578,6 @@ getnewvnode(tag, mp, vops, vpp) { int s; struct thread *td = curthread; /* XXX */ - struct proc *p = td->td_proc; struct vnode *vp = NULL; vm_object_t object; @@ -713,7 +712,7 @@ getnewvnode(tag, mp, vops, vpp) vp->v_data = 0; splx(s); - vfs_object_create(vp, td, p->p_ucred); + vfs_object_create(vp, td); return (0); } @@ -774,8 +773,8 @@ vwakeup(bp) * Called with the underlying object locked. */ int -vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, - struct thread *td, int slpflag, int slptimeo) +vinvalbuf(struct vnode *vp, int flags, struct thread *td, + int slpflag, int slptimeo) { register struct buf *bp; struct buf *nbp, *blist; @@ -795,7 +794,7 @@ vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, } if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { splx(s); - if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, td)) != 0) + if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) != 0) return (error); s = splbio(); if (vp->v_numoutput > 0 || @@ -895,8 +894,7 @@ vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, * sync activity. */ int -vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, - off_t length, int blksize) +vtruncbuf(struct vnode *vp, struct thread *td, off_t length, int blksize) { struct buf *bp; struct buf *nbp; @@ -1122,7 +1120,6 @@ sched_sync(void) long starttime; int s; struct thread *td = updatethread; - struct proc *p = td->td_proc; EVENTHANDLER_REGISTER(shutdown_pre_sync, shutdown_kproc, td, SHUTDOWN_PRI_LAST); @@ -1146,7 +1143,7 @@ sched_sync(void) while ((vp = LIST_FIRST(slp)) != NULL) { if (VOP_ISLOCKED(vp, NULL) == 0) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - (void) VOP_FSYNC(vp, p->p_ucred, MNT_LAZY, td); + (void) VOP_FSYNC(vp, MNT_LAZY, td); VOP_UNLOCK(vp, 0, td); } s = splbio(); @@ -1703,7 +1700,6 @@ vflush(mp, rootrefs, flags) int flags; { struct thread *td = curthread; /* XXX */ - struct proc *p = td->td_proc; struct vnode *vp, *nvp, *rootvp = NULL; struct vattr vattr; int busy = 0, error; @@ -1745,7 +1741,7 @@ loop: */ if ((flags & WRITECLOSE) && (vp->v_type == VNON || - (VOP_GETATTR(vp, &vattr, p->p_ucred, td) == 0 && + (VOP_GETATTR(vp, &vattr, td) == 0 && vattr.va_nlink > 0)) && (vp->v_writecount == 0 || vp->v_type != VREG)) { simple_unlock(&vp->v_interlock); @@ -1867,7 +1863,7 @@ vclean(struct vnode *vp, int flags, struct thread *td) /* * Clean out any buffers associated with the vnode. */ - vinvalbuf(vp, V_SAVE, NOCRED, td, 0, 0); + vinvalbuf(vp, V_SAVE, td, 0, 0); VOP_DESTROYVOBJECT(vp); @@ -1878,7 +1874,7 @@ vclean(struct vnode *vp, int flags, struct thread *td) */ if (active) { if (flags & DOCLOSE) - VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); + VOP_CLOSE(vp, FNONBLOCK, td); VOP_INACTIVE(vp, td); } else { /* @@ -2721,9 +2717,9 @@ loop: * vp must be locked when vfs_object_create is called. */ int -vfs_object_create(struct vnode *vp, struct thread *td, struct ucred *cred) +vfs_object_create(struct vnode *vp, struct thread *td) { - return (VOP_CREATEVOBJECT(vp, cred, td)); + return (VOP_CREATEVOBJECT(vp, td)); } void @@ -2953,7 +2949,7 @@ sync_fsync(ap) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_LAZY, ap->a_cred, td); + VFS_SYNC(mp, MNT_LAZY, td); if (asyncflag) mp->mnt_flag |= MNT_ASYNC; vfs_unbusy(mp, td); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index ec59fb2fbb..a2e2e52918 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.5 2003/06/25 05:22:32 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_syscalls.c,v 1.6 2003/06/26 05:55:14 dillon Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -195,13 +195,13 @@ 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, p->p_ucred, td)) || + if ((error = VOP_GETATTR(vp, &va, td)) || (va.va_uid != p->p_ucred->cr_uid && (error = suser(td)))) { vput(vp); return (error); } - if ((error = vinvalbuf(vp, V_SAVE, p->p_ucred, td, 0, 0)) != 0) { + if ((error = vinvalbuf(vp, V_SAVE, td, 0, 0)) != 0) { vput(vp); return (error); } @@ -511,7 +511,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, p->p_ucred, td)) == 0) || + (error = VFS_SYNC(mp, MNT_WAIT, td)) == 0) || (flags & MNT_FORCE)) error = VFS_UNMOUNT(mp, flags, td); simple_lock(&mountlist_slock); @@ -560,7 +560,6 @@ int sync(struct sync_args *uap) { struct thread *td = curthread; - struct proc *p = td->td_proc; struct mount *mp, *nmp; int asyncflag; @@ -574,8 +573,7 @@ sync(struct sync_args *uap) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_NOWAIT, - ((p != NULL) ? p->p_ucred : NOCRED), td); + VFS_SYNC(mp, MNT_NOWAIT, td); mp->mnt_flag |= asyncflag; } simple_lock(&mountlist_slock); @@ -1017,7 +1015,7 @@ open(struct open_args *uap) KASSERT(fdp->fd_ofiles[indx] != fp, ("Open file descriptor lost all refs")); VOP_UNLOCK(vp, 0, td); - vn_close(vp, flags & FMASK, fp->f_cred, td); + vn_close(vp, flags & FMASK, td); fdrop(fp, td); p->p_retval[0] = indx; return 0; @@ -1418,7 +1416,6 @@ lseek(struct lseek_args *uap) { struct thread *td = curthread; struct proc *p = td->td_proc; - struct ucred *cred = p->p_ucred; struct filedesc *fdp = p->p_fd; struct file *fp; struct vattr vattr; @@ -1434,7 +1431,7 @@ lseek(struct lseek_args *uap) fp->f_offset += SCARG(uap, offset); break; case L_XTND: - error=VOP_GETATTR((struct vnode *)fp->f_data, &vattr, cred, td); + error=VOP_GETATTR((struct vnode *)fp->f_data, &vattr, td); if (error) return (error); fp->f_offset = SCARG(uap, offset) + vattr.va_size; @@ -2303,7 +2300,7 @@ fsync(struct fsync_args *uap) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); if (VOP_GETVOBJECT(vp, &obj) == 0) vm_object_page_clean(obj, 0, 0, 0); - if ((error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, td)) == 0 && + if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) && bioops.io_fsync) error = (*bioops.io_fsync)(vp); @@ -2753,7 +2750,7 @@ revoke(struct revoke_args *uap) error = EINVAL; goto out; } - if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, td)) != 0) + if ((error = VOP_GETATTR(vp, &vattr, td)) != 0) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && (error = suser_cred(p->p_ucred, PRISON_ROOT))) @@ -2918,7 +2915,7 @@ fhopen(struct fhopen_args *uap) * Make sure that a VM object is created for VMIO support. */ if (vn_canvmio(vp) == TRUE) { - if ((error = vfs_object_create(vp, td, p->p_ucred)) != 0) + if ((error = vfs_object_create(vp, td)) != 0) goto bad; } if (fmode & FWRITE) @@ -2977,7 +2974,7 @@ fhopen(struct fhopen_args *uap) fp->f_flag |= FHASLOCK; } if ((vp->v_type == VREG) && (VOP_GETVOBJECT(vp, NULL) != 0)) - vfs_object_create(vp, td, p->p_ucred); + vfs_object_create(vp, td); VOP_UNLOCK(vp, 0, td); fdrop(fp, td); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1b1f53ab22..0eda6662ee 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.4 2003/06/25 03:55:57 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_vnops.c,v 1.5 2003/06/26 05:55:14 dillon Exp $ */ #include @@ -188,7 +188,7 @@ vn_open(ndp, fmode, cmode) * Make sure that a VM object is created for VMIO support. */ if (vn_canvmio(vp) == TRUE) { - if ((error = vfs_object_create(vp, td, cred)) != 0) + if ((error = vfs_object_create(vp, td)) != 0) goto bad; } @@ -224,13 +224,13 @@ vn_writechk(vp) * Vnode close call */ int -vn_close(struct vnode *vp, int flags, struct ucred *cred, struct thread *td) +vn_close(struct vnode *vp, int flags, struct thread *td) { int error; if (flags & FWRITE) vp->v_writecount--; - error = VOP_CLOSE(vp, flags, cred, td); + error = VOP_CLOSE(vp, flags, td); vrele(vp); return (error); } @@ -457,7 +457,7 @@ vn_stat(struct vnode *vp, struct stat *sb, struct thread *td) KKASSERT(p); vap = &vattr; - error = VOP_GETATTR(vp, vap, p->p_ucred, td); + error = VOP_GETATTR(vp, vap, td); if (error) return (error); @@ -570,7 +570,7 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct thread *td) case VREG: case VDIR: if (com == FIONREAD) { - error = VOP_GETATTR(vp, &vattr, ucred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); *(int *)data = vattr.va_size - fp->f_offset; @@ -671,7 +671,7 @@ vn_closefile(struct file *fp, struct thread *td) int err; fp->f_ops = &badfileops; - err = vn_close(((struct vnode *)fp->f_data), fp->f_flag, fp->f_cred, td); + err = vn_close(((struct vnode *)fp->f_data), fp->f_flag, td); return(err); } diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 8eefe6ee82..f19f7d8c15 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -32,7 +32,7 @@ # # @(#)vnode_if.src 8.12 (Berkeley) 5/14/95 # $FreeBSD: src/sys/kern/vnode_if.src,v 1.29.2.3 2001/05/18 09:58:45 bp Exp $ -# $DragonFly: src/sys/kern/Attic/vnode_if.src,v 1.3 2003/06/25 03:55:57 dillon Exp $ +# $DragonFly: src/sys/kern/Attic/vnode_if.src,v 1.4 2003/06/26 05:55:14 dillon Exp $ # # @@ -136,7 +136,6 @@ vop_open { vop_close { IN struct vnode *vp; IN int fflag; - IN struct ucred *cred; IN struct thread *td; }; @@ -156,7 +155,6 @@ vop_access { vop_getattr { IN struct vnode *vp; OUT struct vattr *vap; - IN struct ucred *cred; IN struct thread *td; }; @@ -253,7 +251,6 @@ vop_mmap { # vop_fsync { IN struct vnode *vp; - IN struct ucred *cred; IN int waitfor; IN struct thread *td; }; @@ -554,7 +551,6 @@ vop_setextattr { # vop_createvobject { IN struct vnode *vp; - IN struct ucred *cred; IN struct thread *td; }; diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 36f674967d..346db87081 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -37,7 +37,7 @@ * * @(#)buf.h 8.9 (Berkeley) 3/30/95 * $FreeBSD: src/sys/sys/buf.h,v 1.88.2.10 2003/01/25 19:02:23 dillon Exp $ - * $DragonFly: src/sys/sys/buf.h,v 1.3 2003/06/19 01:55:07 dillon Exp $ + * $DragonFly: src/sys/sys/buf.h,v 1.4 2003/06/26 05:55:19 dillon Exp $ */ #ifndef _SYS_BUF_H_ @@ -124,8 +124,6 @@ struct buf { struct vnode *b_vp; /* Device vnode. */ int b_dirtyoff; /* Offset in buffer of dirty region. */ int b_dirtyend; /* Offset of end of dirty region. */ - struct ucred *b_rcred; /* Read credentials reference. */ - struct ucred *b_wcred; /* Write credentials reference. */ daddr_t b_pblkno; /* physical block number */ void *b_saveaddr; /* Original b_addr for physio. */ void *b_driver1; /* for private use by the driver */ @@ -339,10 +337,9 @@ void bufinit __P((void)); void bwillwrite __P((void)); int buf_dirty_count_severe __P((void)); void bremfree __P((struct buf *)); -int bread __P((struct vnode *, daddr_t, int, - struct ucred *, struct buf **)); +int bread __P((struct vnode *, daddr_t, int, struct buf **)); int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int, - struct ucred *, struct buf **)); + struct buf **)); int bwrite __P((struct buf *)); void bdwrite __P((struct buf *)); void bawrite __P((struct buf *)); @@ -363,7 +360,7 @@ void biodone __P((struct buf *)); void cluster_callback __P((struct buf *)); int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long, - struct ucred *, long, int, struct buf **)); + long, int, struct buf **)); int cluster_wbuild __P((struct vnode *, long, daddr_t, int)); void cluster_write __P((struct buf *, u_quad_t, int)); int physio __P((dev_t dev, struct uio *uio, int ioflag)); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ba3a97c1ac..18ad7eff05 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.3 2003/06/25 03:56:10 dillon Exp $ + * $DragonFly: src/sys/sys/mount.h,v 1.4 2003/06/26 05:55:20 dillon Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -341,7 +341,7 @@ struct vfsops { int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp, struct thread *td)); int (*vfs_sync) __P((struct mount *mp, int waitfor, - struct ucred *cred, struct thread *td)); + struct thread *td)); int (*vfs_vget) __P((struct mount *mp, ino_t ino, struct vnode **vpp)); int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp, @@ -363,7 +363,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, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P) +#define VFS_SYNC(MP, WAIT, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, P) #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) @@ -455,8 +455,7 @@ int vfs_stdroot __P((struct mount *mp, struct vnode **vpp)); int vfs_stdquotactl __P((struct mount *mp, int cmds, uid_t uid, caddr_t arg, struct thread *p)); int vfs_stdstatfs __P((struct mount *mp, struct statfs *sbp, struct thread *p)); -int vfs_stdsync __P((struct mount *mp, int waitfor, struct ucred *cred, - struct thread *p)); +int vfs_stdsync __P((struct mount *mp, int waitfor, struct thread *td)); int vfs_stdvget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); int vfs_stdfhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); int vfs_stdcheckexp __P((struct mount *mp, struct sockaddr *nam, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 5d5f979874..92caf1423e 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.4 2003/06/25 03:56:10 dillon Exp $ + * $DragonFly: src/sys/sys/vnode.h,v 1.5 2003/06/26 05:55:20 dillon Exp $ */ #ifndef _SYS_VNODE_H_ @@ -586,15 +586,14 @@ int vget __P((struct vnode *vp, int lockflag, struct thread *td)); void vgone __P((struct vnode *vp)); void vgonel __P((struct vnode *vp, struct thread *td)); void vhold __P((struct vnode *)); -int vinvalbuf __P((struct vnode *vp, int save, struct ucred *cred, +int vinvalbuf __P((struct vnode *vp, int save, struct thread *td, int slpflag, int slptimeo)); -int vtruncbuf __P((struct vnode *vp, struct ucred *cred, struct thread *td, +int vtruncbuf __P((struct vnode *vp, struct thread *td, off_t length, int blksize)); void vprint __P((char *label, struct vnode *vp)); int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp, struct thread *td)); -int vn_close __P((struct vnode *vp, - int flags, struct ucred *cred, struct thread *td)); +int vn_close __P((struct vnode *vp, int flags, struct thread *td)); int vn_isdisk __P((struct vnode *vp, int *errp)); int vn_lock __P((struct vnode *vp, int flags, struct thread *td)); #ifdef DEBUG_LOCKS @@ -615,8 +614,7 @@ int vn_rdwr_inchunks __P((enum uio_rw rw, struct vnode *vp, caddr_t base, int vn_stat __P((struct vnode *vp, struct stat *sb, struct thread *td)); dev_t vn_todev __P((struct vnode *vp)); int vfs_cache_lookup __P((struct vop_lookup_args *ap)); -int vfs_object_create __P((struct vnode *vp, struct thread *td, - struct ucred *cred)); +int vfs_object_create __P((struct vnode *vp, struct thread *td)); void vfs_timestamp __P((struct timespec *)); int vn_writechk __P((struct vnode *vp)); int vop_stdbwrite __P((struct vop_bwrite_args *ap)); diff --git a/sys/vfs/coda/coda_psdev.c b/sys/vfs/coda/coda_psdev.c index b52cbb1006..f164a6f830 100644 --- a/sys/vfs/coda/coda_psdev.c +++ b/sys/vfs/coda/coda_psdev.c @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_psdev.c,v 1.13 1999/09/29 15:03:46 marcel Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_psdev.c,v 1.3 2003/06/23 17:55:26 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_psdev.c,v 1.4 2003/06/26 05:55:07 dillon Exp $ * */ @@ -149,14 +149,10 @@ vc_nb_close (dev_t dev, int flag, int mode, d_thread_t *td) struct vcomm *vcp; struct vmsg *vmp, *nvmp = NULL; struct coda_mntinfo *mi; - struct proc *p; int err; ENTRY; - p = td->td_proc; - KKASSERT(p != NULL); - if (minor(dev) >= NVCODA || minor(dev) < 0) return(ENXIO); @@ -220,7 +216,7 @@ vc_nb_close (dev_t dev, int flag, int mode, d_thread_t *td) #endif } - err = dounmount(mi->mi_vfsp, flag, p); + err = dounmount(mi->mi_vfsp, flag, td); if (err) myprintf(("Error %d unmounting vfs in vcclose(%d)\n", err, minor(dev))); diff --git a/sys/vfs/coda/coda_vfsops.c b/sys/vfs/coda/coda_vfsops.c index b07dc52766..dd673f9ec3 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.4 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.5 2003/06/26 05:55:07 dillon Exp $ * */ @@ -418,10 +418,9 @@ coda_nb_statfs(vfsp, sbp, td) * Flush any pending I/O. */ int -coda_sync(vfsp, waitfor, cred, td) +coda_sync(vfsp, waitfor, td) struct mount *vfsp; int waitfor; - struct ucred *cred; struct thread *td; { ENTRY; diff --git a/sys/vfs/coda/coda_vfsops.h b/sys/vfs/coda/coda_vfsops.h index 5ebd092867..466baae13a 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.3 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.h,v 1.4 2003/06/26 05:55:07 dillon Exp $ * */ @@ -54,7 +54,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 ucred *, struct thread *); +int coda_sync(struct mount *, int, struct thread *); 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 e0933e0854..7bad296608 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.4 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.5 2003/06/26 05:55:07 dillon Exp $ * */ @@ -302,7 +302,7 @@ coda_open(v) } /* grab (above) does this when it calls newvnode unless it's in the cache*/ if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = vfs_object_create(vp, td); if (error != 0) { printf("coda_open: vfs_object_create() returns %d\n", error); vput(vp); @@ -324,7 +324,6 @@ coda_close(v) struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); int flag = ap->a_fflag; - struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; /* locals */ int error; @@ -346,7 +345,7 @@ coda_close(v) #ifdef hmm vgone(cp->c_ovp); #else - VOP_CLOSE(cp->c_ovp, flag, cred, td); /* Do errors matter here? */ + VOP_CLOSE(cp->c_ovp, flag, td); /* Do errors matter here? */ vrele(cp->c_ovp); #endif } else { @@ -356,7 +355,7 @@ coda_close(v) } return ENODEV; } else { - VOP_CLOSE(cp->c_ovp, flag, cred, td); /* Do errors matter here? */ + VOP_CLOSE(cp->c_ovp, flag, td); /* Do errors matter here? */ vrele(cp->c_ovp); } @@ -366,7 +365,7 @@ coda_close(v) if (flag & FWRITE) /* file was opened for write */ --cp->c_owrite; - error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, td); + error = venus_close(vtomi(vp), &cp->c_fid, flag, proc0.p_ucred, td); vrele(CTOV(cp)); CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error)); ) @@ -462,7 +461,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = vfs_object_create(vp, td); if (error != 0) { printf("coda_rdwr: vfs_object_create() returns %d\n", error); vput(vp); @@ -490,7 +489,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); { struct vattr attr; - if (VOP_GETATTR(cfvp, &attr, cred, td) == 0) { + if (VOP_GETATTR(cfvp, &attr, td) == 0) { vnode_pager_setsize(vp, attr.va_size); } } @@ -504,7 +503,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); /* Do an internal close if necessary. */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - (void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), cred, td); + (void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), td); } /* Invalidate cached attributes if writing. */ @@ -608,7 +607,6 @@ coda_getattr(v) struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; - struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; /* locals */ int error; @@ -638,7 +636,7 @@ coda_getattr(v) return(0); } - error = venus_getattr(vtomi(vp), &cp->c_fid, cred, td, vap); + error = venus_getattr(vtomi(vp), &cp->c_fid, proc0.p_ucred, td, vap); if (!error) { CODADEBUG(CODA_GETATTR, myprintf(("getattr miss (%lx.%lx.%lx): result %d\n", @@ -810,7 +808,6 @@ coda_fsync(v) struct vop_fsync_args *ap = v; struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; /* locals */ struct vnode *convp = cp->c_ovp; @@ -834,7 +831,7 @@ coda_fsync(v) } if (convp) - VOP_FSYNC(convp, cred, MNT_WAIT, td); + VOP_FSYNC(convp, MNT_WAIT, td); /* * We see fsyncs with usecount == 1 then usecount == 0. @@ -860,7 +857,7 @@ coda_fsync(v) /* needs research */ return 0; - error = venus_fsync(vtomi(vp), &cp->c_fid, cred, td); + error = venus_fsync(vtomi(vp), &cp->c_fid, proc0.p_ucred, td); CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n",error)); ); return(error); @@ -1636,7 +1633,7 @@ printf("coda_readdir: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = vfs_object_create(vp, td); if (error != 0) { printf("coda_readdir: vfs_object_create() returns %d\n", error); vput(vp); @@ -1658,7 +1655,7 @@ printf("coda_readdir: Internally Opening %p\n", vp); /* Do an "internal close" if necessary. */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - (void)VOP_CLOSE(vp, FREAD, cred, td); + (void)VOP_CLOSE(vp, FREAD, td); } } diff --git a/sys/vfs/fifofs/fifo_vnops.c b/sys/vfs/fifofs/fifo_vnops.c index e8a89050a2..4750f231ec 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.3 2003/06/25 03:55:59 dillon Exp $ + * $DragonFly: src/sys/vfs/fifofs/fifo_vnops.c,v 1.4 2003/06/26 05:55:15 dillon Exp $ */ #include @@ -262,7 +262,7 @@ fifo_open(ap) } return (0); bad: - VOP_CLOSE(vp, ap->a_mode, ap->a_cred, ap->a_td); + VOP_CLOSE(vp, ap->a_mode, ap->a_td); return (error); } diff --git a/sys/vfs/gnu/ext2fs/ext2_readwrite.c b/sys/vfs/gnu/ext2fs/ext2_readwrite.c index 0e6fe8b7ae..1608fcfc55 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.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.3 2003/06/26 05:55:12 dillon Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -113,8 +113,7 @@ READ(ap) if (lblktosize(fs, nextlbn) >= ip->i_size) error = bread(vp, lbn, size, NOCRED, &bp); else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) - error = cluster_read(vp, - ip->i_size, lbn, size, NOCRED, + error = cluster_read(vp, ip->i_size, lbn, size, uio->uio_resid, (ap->a_ioflag >> 16), &bp); else if (seqcount > 1) { int nextsize = BLKSIZE(fs, ip, nextlbn); diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index ea2aa6dee7..5fd846e869 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.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.3 2003/06/26 05:55:12 dillon Exp $ */ #include "opt_quota.h" @@ -535,7 +535,7 @@ ext2_reload(mountp, cred, p) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOUFS(mountp)->um_devvp; - if (vinvalbuf(devvp, 0, cred, p, 0, 0)) + if (vinvalbuf(devvp, 0, p, 0, 0)) panic("ext2_reload: dirty1"); /* * Step 2: re-read superblock from disk. @@ -582,7 +582,7 @@ loop: if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) { goto loop; } - if (vinvalbuf(vp, 0, cred, p, 0, 0)) + if (vinvalbuf(vp, 0, p, 0, 0)) panic("ext2_reload: dirty2"); /* * Step 6: re-read inode data for all active vnodes. @@ -635,7 +635,7 @@ ext2_mountfs(devvp, mp, p) return (error); if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); - if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) != 0) + if ((error = vinvalbuf(devvp, V_SAVE, p, 0, 0)) != 0) return (error); #ifdef READONLY /* turn on this to force it to be read-only */ diff --git a/sys/vfs/hpfs/hpfs_alsubr.c b/sys/vfs/hpfs/hpfs_alsubr.c index 02222a6afe..164abc3d7d 100644 --- a/sys/vfs/hpfs/hpfs_alsubr.c +++ b/sys/vfs/hpfs/hpfs_alsubr.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs_alsubr.c,v 1.1 1999/12/09 19:09:58 semenu Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_alsubr.c,v 1.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_alsubr.c,v 1.3 2003/06/26 05:55:12 dillon Exp $ */ #include @@ -91,7 +91,7 @@ dive: if (bp) brelse(bp); error = bread(hp->h_devvp, anp->an_lsn, - DEV_BSIZE, NOCRED, &bp); + DEV_BSIZE, &bp); if (error) { printf("hpfs_hpbmap: bread error\n"); brelse(bp); diff --git a/sys/vfs/hpfs/hpfs_subr.c b/sys/vfs/hpfs/hpfs_subr.c index e5778edc72..6d098e6dee 100644 --- a/sys/vfs/hpfs/hpfs_subr.c +++ b/sys/vfs/hpfs/hpfs_subr.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs_subr.c,v 1.1 1999/12/09 19:09:59 semenu Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_subr.c,v 1.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_subr.c,v 1.3 2003/06/26 05:55:12 dillon Exp $ */ #include @@ -116,7 +116,7 @@ hpfs_bminit( M_HPFSMNT, M_WAITOK); error = bread(hpmp->hpm_devvp, hpmp->hpm_su.su_bitmap.lsn1, - ((hpmp->hpm_dbnum + 0x7F) & ~(0x7F)) << 2, NOCRED, &bp); + ((hpmp->hpm_dbnum + 0x7F) & ~(0x7F)) << 2, &bp); if (error) { brelse(bp); FREE(hpmp->hpm_bitmap, M_HPFSMNT); @@ -135,7 +135,7 @@ hpfs_bminit( dprintf(("[%d: 0x%x] ", i, hpmp->hpm_bmind[i])); error = bread(hpmp->hpm_devvp, hpmp->hpm_bmind[i], - BMSIZE, NOCRED, &bp); + BMSIZE, &bp); if (error) { brelse(bp); FREE(hpmp->hpm_bitmap, M_HPFSMNT); @@ -216,7 +216,7 @@ hpfs_cpload ( struct cpdsec * cpdsp; int error, i; - error = bread(hpmp->hpm_devvp, cpibp->b_cpdsec, DEV_BSIZE, NOCRED, &bp); + error = bread(hpmp->hpm_devvp, cpibp->b_cpdsec, DEV_BSIZE, &bp); if (error) { brelse(bp); return (error); @@ -279,7 +279,7 @@ hpfs_cpinit ( lsn = hpmp->hpm_sp.sp_cpi; while (cpicnt > 0) { - error = bread(hpmp->hpm_devvp, lsn, DEV_BSIZE, NOCRED, &bp); + error = bread(hpmp->hpm_devvp, lsn, DEV_BSIZE, &bp); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/hpfs/hpfs_vfsops.c b/sys/vfs/hpfs/hpfs_vfsops.c index 16447b6747..80ea2dc148 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.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.3 2003/06/26 05:55:12 dillon Exp $ */ @@ -342,10 +342,10 @@ hpfs_mountfs(devvp, mp, argsp, p) #if defined(__FreeBSD__) VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p); - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); + error = vinvalbuf(devvp, V_SAVE, p, 0, 0); VOP__UNLOCK(devvp, 0, p); #else - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); + error = vinvalbuf(devvp, V_SAVE, p, 0, 0); #endif if (error) return (error); @@ -486,7 +486,7 @@ hpfs_unmount( hpmp->hpm_devvp->v_specflags &= ~SI_MOUNTEDON; #endif - vinvalbuf(hpmp->hpm_devvp, V_SAVE, NOCRED, p, 0, 0); + vinvalbuf(hpmp->hpm_devvp, V_SAVE, p, 0, 0); error = VOP_CLOSE(hpmp->hpm_devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p); diff --git a/sys/vfs/isofs/cd9660/cd9660_lookup.c b/sys/vfs/isofs/cd9660/cd9660_lookup.c index 2ec2cd940a..3f4e720e47 100644 --- a/sys/vfs/isofs/cd9660/cd9660_lookup.c +++ b/sys/vfs/isofs/cd9660/cd9660_lookup.c @@ -39,7 +39,7 @@ * * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94 * $FreeBSD: src/sys/isofs/cd9660/cd9660_lookup.c,v 1.23.2.2 2001/11/04 06:19:47 dillon Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_lookup.c,v 1.3 2003/06/25 03:55:56 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_lookup.c,v 1.4 2003/06/26 05:55:13 dillon Exp $ */ #include @@ -417,7 +417,7 @@ cd9660_blkatoff(vp, offset, res, bpp) lbn = lblkno(imp, offset); bsize = blksize(imp, ip, lbn); - if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) { + if ((error = bread(vp, lbn, bsize, &bp)) != 0) { brelse(bp); *bpp = NULL; return (error); diff --git a/sys/vfs/isofs/cd9660/cd9660_rrip.c b/sys/vfs/isofs/cd9660/cd9660_rrip.c index 22c0b0ed92..fa736c8fec 100644 --- a/sys/vfs/isofs/cd9660/cd9660_rrip.c +++ b/sys/vfs/isofs/cd9660/cd9660_rrip.c @@ -37,7 +37,7 @@ * * @(#)cd9660_rrip.c 8.6 (Berkeley) 12/5/94 * $FreeBSD: src/sys/isofs/cd9660/cd9660_rrip.c,v 1.17 1999/08/28 00:46:06 peter Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_rrip.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_rrip.c,v 1.3 2003/06/26 05:55:13 dillon Exp $ */ #include @@ -558,7 +558,7 @@ cd9660_rrip_loop(isodir,ana,table) || bread(ana->imp->im_devvp, ana->iso_ce_blk << (ana->imp->im_bshift - DEV_BSHIFT), - ana->imp->logical_block_size, NOCRED, &bp)) + ana->imp->logical_block_size, &bp)) /* what to do now? */ break; phead = (ISO_SUSP_HEADER *)(bp->b_data + ana->iso_ce_off); diff --git a/sys/vfs/isofs/cd9660/cd9660_vfsops.c b/sys/vfs/isofs/cd9660/cd9660_vfsops.c index ec1e1ae2eb..ef0aa97eec 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.4 2003/06/25 03:55:56 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.5 2003/06/26 05:55:13 dillon Exp $ */ #include @@ -164,7 +164,7 @@ iso_mountroot(struct mount *mp, struct thread *td) args.ssector = iso_get_ssector(rootdev, td); - (void)VOP_CLOSE(rootvp, FREAD, NOCRED, td); + (void)VOP_CLOSE(rootvp, FREAD, td); if (bootverbose) printf("iso_mountroot(): using session at block %d\n", @@ -298,7 +298,6 @@ iso_mountfs( if (!(mp->mnt_flag & MNT_RDONLY)) return EROFS; - KKASSERT(td->td_proc); /* * Disallow multiple mounts of the same device. * Disallow mounting of a device that is currently in use @@ -309,7 +308,7 @@ iso_mountfs( return error; if (vcount(devvp) > 1 && devvp != rootvp) return EBUSY; - if ((error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0))) + if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0))) return (error); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); @@ -335,7 +334,7 @@ iso_mountfs( iso_blknum < 100 + argp->ssector; iso_blknum++) { if ((error = bread(devvp, iso_blknum * btodb(iso_bsize), - iso_bsize, NOCRED, &bp)) != 0) + iso_bsize, &bp)) != 0) goto out; vdp = (struct iso_volume_descriptor *)bp->b_data; @@ -461,7 +460,7 @@ iso_mountfs( if ((error = bread(isomp->im_devvp, (isomp->root_extent + isonum_711(rootp->ext_attr_length)) << (isomp->im_bshift - DEV_BSHIFT), - isomp->logical_block_size, NOCRED, &bp)) != 0) + isomp->logical_block_size, &bp)) != 0) goto out; rootp = (struct iso_directory_record *)bp->b_data; @@ -529,7 +528,7 @@ out: if (supbp) brelse(supbp); if (needclose) - (void)VOP_CLOSE(devvp, FREAD, NOCRED, td); + (void)VOP_CLOSE(devvp, FREAD, td); if (isomp) { free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; @@ -559,7 +558,7 @@ cd9660_unmount(struct mount *mp, int mntflags, struct thread *td) isomp = VFSTOISOFS(mp); isomp->im_devvp->v_specmountpoint = NULL; - error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, td); + error = VOP_CLOSE(isomp->im_devvp, FREAD, td); vrele(isomp->im_devvp); free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; @@ -769,7 +768,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir) error = bread(imp->im_devvp, lbn << (imp->im_bshift - DEV_BSHIFT), - imp->logical_block_size, NOCRED, &bp); + imp->logical_block_size, &bp); if (error) { vput(vp); brelse(bp); diff --git a/sys/vfs/isofs/cd9660/cd9660_vnops.c b/sys/vfs/isofs/cd9660/cd9660_vnops.c index c62b67f21d..c25d98587d 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.3 2003/06/25 03:55:56 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.4 2003/06/26 05:55:13 dillon Exp $ */ #include @@ -203,7 +203,6 @@ cd9660_getattr(ap) struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; - struct ucred *a_cred; struct thread *a_td; } */ *ap; @@ -243,7 +242,7 @@ cd9660_getattr(ap) auio.uio_resid = MAXPATHLEN; rdlnk.a_uio = &auio; rdlnk.a_vp = ap->a_vp; - rdlnk.a_cred = ap->a_cred; + rdlnk.a_cred = proc0.p_ucred; /* use root cred */ if (cd9660_readlink(&rdlnk) == 0) vap->va_size = MAXPATHLEN - auio.uio_resid; FREE(cp, M_TEMP); @@ -330,18 +329,18 @@ cd9660_read(ap) if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { if (lblktosize(imp, rablock) < ip->i_size) error = cluster_read(vp, (off_t)ip->i_size, - lbn, size, NOCRED, uio->uio_resid, + lbn, size, uio->uio_resid, (ap->a_ioflag >> 16), &bp); else - error = bread(vp, lbn, size, NOCRED, &bp); + error = bread(vp, lbn, size, &bp); } else { if (seqcount > 1 && lblktosize(imp, rablock) < ip->i_size) { rasize = blksize(imp, ip, rablock); error = breadn(vp, lbn, size, &rablock, - &rasize, 1, NOCRED, &bp); + &rasize, 1, &bp); } else - error = bread(vp, lbn, size, NOCRED, &bp); + error = bread(vp, lbn, size, &bp); } n = min(n, size - bp->b_resid); if (error) { @@ -679,7 +678,7 @@ cd9660_readlink(ap) error = bread(imp->im_devvp, (ip->i_number >> imp->im_bshift) << (imp->im_bshift - DEV_BSHIFT), - imp->logical_block_size, NOCRED, &bp); + imp->logical_block_size, &bp); if (error) { brelse(bp); return (EINVAL); diff --git a/sys/vfs/mfs/mfs_vnops.c b/sys/vfs/mfs/mfs_vnops.c index aa28d32de5..1c87d47df4 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.5 2003/06/25 03:56:12 dillon Exp $ + * $DragonFly: src/sys/vfs/mfs/mfs_vnops.c,v 1.6 2003/06/26 05:55:21 dillon Exp $ */ #include @@ -339,7 +339,7 @@ mfs_close(ap) * we must invalidate any in core blocks, so that * we can, free up its vnode. */ - if ((error = vinvalbuf(vp, 1, ap->a_cred, ap->a_td, 0, 0)) != 0) + if ((error = vinvalbuf(vp, 1, ap->a_td, 0, 0)) != 0) return (error); /* * There should be no way to have any more uses of this diff --git a/sys/vfs/msdosfs/denode.h b/sys/vfs/msdosfs/denode.h index 983416eb40..7bd77d5efc 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.3 2003/06/25 03:56:01 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/denode.h,v 1.4 2003/06/26 05:55:17 dillon Exp $ */ /* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */ /*- @@ -275,13 +275,13 @@ int findwin95 __P((struct denode *)); int readep __P((struct msdosfsmount *pmp, u_long dirclu, u_long dirofs, struct buf **bpp, struct direntry **epp)); int readde __P((struct denode *dep, struct buf **bpp, struct direntry **epp)); -int deextend __P((struct denode *dep, u_long length, struct ucred *cred)); +int deextend __P((struct denode *dep, u_long length)); int fillinusemap __P((struct msdosfsmount *pmp)); void reinsert __P((struct denode *dep)); int dosdirempty __P((struct denode *dep)); int createde __P((struct denode *dep, struct denode *ddep, struct denode **depp, struct componentname *cnp)); int deupdat __P((struct denode *dep, int waitfor)); int removede __P((struct denode *pdep, struct denode *dep)); -int detrunc __P((struct denode *dep, u_long length, int flags, struct ucred *cred, struct thread *td)); +int detrunc __P((struct denode *dep, u_long length, int flags, struct thread *td)); int doscheckpath __P(( 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 1685015629..297a3d5fbc 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.3 2003/06/25 03:56:01 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_denode.c,v 1.4 2003/06/26 05:55:17 dillon Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */ /*- @@ -425,11 +425,10 @@ deupdat(dep, waitfor) * Truncate the file described by dep to the length specified by length. */ int -detrunc(dep, length, flags, cred, td) +detrunc(dep, length, flags, td) struct denode *dep; u_long length; int flags; - struct ucred *cred; struct thread *td; { int error; @@ -463,7 +462,7 @@ detrunc(dep, length, flags, cred, td) if (dep->de_FileSize < length) { vnode_pager_setsize(DETOV(dep), length); - return deextend(dep, length, cred); + return deextend(dep, length); } /* @@ -500,12 +499,10 @@ detrunc(dep, length, flags, cred, td) if ((boff = length & pmp->pm_crbomask) != 0) { if (isadir) { bn = cntobn(pmp, eofentry); - error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, - NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, &bp); } else { bn = de_blk(pmp, length); - error = bread(DETOV(dep), bn, pmp->pm_bpcluster, - NOCRED, &bp); + error = bread(DETOV(dep), bn, pmp->pm_bpcluster, &bp); } if (error) { brelse(bp); @@ -531,7 +528,7 @@ detrunc(dep, length, flags, cred, td) dep->de_FileSize = length; if (!isadir) dep->de_flag |= DE_UPDATE|DE_MODIFIED; - allerror = vtruncbuf(DETOV(dep), cred, td, length, pmp->pm_bpcluster); + allerror = vtruncbuf(DETOV(dep), td, length, pmp->pm_bpcluster); #ifdef MSDOSFS_DEBUG if (allerror) printf("detrunc(): vtruncbuf error %d\n", allerror); @@ -575,10 +572,9 @@ detrunc(dep, length, flags, cred, td) * Extend the file described by dep to length specified by length. */ int -deextend(dep, length, cred) +deextend(dep, length) struct denode *dep; u_long length; - struct ucred *cred; { struct msdosfsmount *pmp = dep->de_pmp; u_long count; @@ -609,7 +605,7 @@ deextend(dep, length, cred) error = extendfile(dep, count, NULL, NULL, DE_CLEAR); if (error) { /* truncate the added clusters away again */ - (void) detrunc(dep, dep->de_FileSize, 0, cred, NULL); + (void) detrunc(dep, dep->de_FileSize, 0, NULL); return (error); } } @@ -711,7 +707,7 @@ msdosfs_inactive(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, NOCRED, ap->a_td); + error = detrunc(dep, (u_long) 0, 0, ap->a_td); dep->de_flag |= DE_UPDATE; dep->de_Name[0] = SLOT_DELETED; } diff --git a/sys/vfs/msdosfs/msdosfs_fat.c b/sys/vfs/msdosfs/msdosfs_fat.c index 912654cce7..cf674cc4c0 100644 --- a/sys/vfs/msdosfs/msdosfs_fat.c +++ b/sys/vfs/msdosfs/msdosfs_fat.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_fat.c,v 1.23 2000/01/27 14:43:06 nyan Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_fat.c,v 1.2 2003/06/17 04:28:47 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_fat.c,v 1.3 2003/06/26 05:55:17 dillon Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.28 1997/11/17 15:36:49 ws Exp $ */ /*- @@ -229,7 +229,7 @@ pcbmap(dep, findcn, bnp, cnp, sp) if (bn != bp_bn) { if (bp) brelse(bp); - error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, bsize, &bp); if (error) { brelse(bp); return (error); @@ -365,8 +365,7 @@ updatefats(pmp, bp, fatbn) + ffs(pmp->pm_inusemap[cn / N_INUSEBITS] ^ (u_int)-1) - 1; } - if (bread(pmp->pm_devvp, pmp->pm_fsinfo, fsi_size(pmp), - NOCRED, &bpn) != 0) { + if (bread(pmp->pm_devvp, pmp->pm_fsinfo, fsi_size(pmp), &bpn) != 0) { /* * Ignore the error, but turn off FSInfo update for the future. */ @@ -547,7 +546,7 @@ fatentry(function, pmp, cn, oldcontents, newcontents) byteoffset = FATOFS(pmp, cn); fatblock(pmp, byteoffset, &bn, &bsize, &bo); - error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, bsize, &bp); if (error) { brelse(bp); return (error); @@ -634,7 +633,7 @@ fatchain(pmp, start, count, fillwith) while (count > 0) { byteoffset = FATOFS(pmp, start); fatblock(pmp, byteoffset, &bn, &bsize, &bo); - error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, bsize, &bp); if (error) { brelse(bp); return (error); @@ -870,7 +869,7 @@ freeclusterchain(pmp, cluster) if (lbn != bn) { if (bp) updatefats(pmp, bp, lbn); - error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, bsize, &bp); if (error) { brelse(bp); return (error); @@ -945,7 +944,7 @@ fillinusemap(pmp) if (bp) brelse(bp); fatblock(pmp, byteoffset, &bn, &bsize, NULL); - error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, bsize, &bp); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/msdosfs/msdosfs_lookup.c b/sys/vfs/msdosfs/msdosfs_lookup.c index 31869ae516..136c6ead41 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.3 2003/06/25 03:56:01 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.4 2003/06/26 05:55:17 dillon Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */ /*- @@ -209,7 +209,7 @@ msdosfs_lookup(ap) break; return (error); } - error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, blsize, &bp); if (error) { brelse(bp); return (error); @@ -596,7 +596,7 @@ createde(dep, ddep, depp, cnp) dirclust = de_clcount(pmp, diroffset); error = extendfile(ddep, dirclust, 0, 0, DE_CLEAR); if (error) { - (void)detrunc(ddep, ddep->de_FileSize, 0, NOCRED, NULL); + (void)detrunc(ddep, ddep->de_FileSize, 0, NULL); return error; } @@ -618,7 +618,7 @@ createde(dep, ddep, depp, cnp) diroffset = ddep->de_fndoffset; if (dirclust != MSDOSFSROOT) diroffset &= pmp->pm_crbomask; - if ((error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp)) != 0) { + if ((error = bread(pmp->pm_devvp, bn, blsize, &bp)) != 0) { brelse(bp); return error; } @@ -648,8 +648,7 @@ createde(dep, ddep, depp, cnp) if (error) return error; - error = bread(pmp->pm_devvp, bn, blsize, - NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, blsize, &bp); if (error) { brelse(bp); return error; @@ -716,7 +715,7 @@ dosdirempty(dep) return (1); /* it's empty */ return (0); } - error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, blsize, &bp); if (error) { brelse(bp); return (0); @@ -809,7 +808,7 @@ doscheckpath(source, target) } scn = dep->de_StartCluster; error = bread(pmp->pm_devvp, cntobn(pmp, scn), - pmp->pm_bpcluster, NOCRED, &bp); + pmp->pm_bpcluster, &bp); if (error) break; @@ -875,7 +874,7 @@ readep(pmp, dirclust, diroffset, bpp, epp) && de_blk(pmp, diroffset + blsize) > pmp->pm_rootdirsize) blsize = de_bn2off(pmp, pmp->pm_rootdirsize) & pmp->pm_crbomask; bn = detobn(pmp, dirclust, diroffset); - if ((error = bread(pmp->pm_devvp, bn, blsize, NOCRED, bpp)) != 0) { + if ((error = bread(pmp->pm_devvp, bn, blsize, bpp)) != 0) { brelse(*bpp); *bpp = NULL; return (error); @@ -934,7 +933,7 @@ removede(pdep, dep) error = pcbmap(pdep, de_cluster(pmp, offset), &bn, 0, &blsize); if (error) return error; - error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, blsize, &bp); if (error) { brelse(bp); return error; @@ -1017,7 +1016,7 @@ uniqdosname(dep, cnp, cp) return 0; return error; } - error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, blsize, &bp); if (error) { brelse(bp); return error; @@ -1069,7 +1068,7 @@ findwin95(dep) for (cn = 0;; cn++) { if (pcbmap(dep, cn, &bn, 0, &blsize)) return (win95); - if (bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp)) { + if (bread(pmp->pm_devvp, bn, blsize, &bp)) { brelse(bp); return (win95); } diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index 71d161ee46..9322d50bab 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_vfsops.c,v 1.60.2.6 2002/09/12 21:33:38 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.3 2003/06/25 03:56:01 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.4 2003/06/26 05:55:17 dillon Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -98,8 +98,7 @@ static int msdosfs_mount __P((struct mount *, char *, caddr_t, static int msdosfs_root __P((struct mount *, struct vnode **)); static int msdosfs_statfs __P((struct mount *, struct statfs *, struct thread *)); -static int msdosfs_sync __P((struct mount *, int, struct ucred *, - struct thread *)); +static int msdosfs_sync __P((struct mount *, int, struct thread *)); static int msdosfs_unmount __P((struct mount *, int, struct thread *)); static int msdosfs_vptofh __P((struct vnode *, struct fid *)); @@ -384,9 +383,6 @@ mountmsdosfs(devvp, mp, td, argp) u_int8_t SecPerClust; u_long clusters; int ronly, error; - struct proc *p = td->td_proc; - - KKASSERT(p); /* * Disallow multiple mounts of the same device. @@ -400,7 +396,7 @@ mountmsdosfs(devvp, mp, td, argp) if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, td, 0, 0); VOP_UNLOCK(devvp, 0, td); if (error) return (error); @@ -427,8 +423,7 @@ mountmsdosfs(devvp, mp, td, argp) * 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, NOCRED, td); + error = VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, td); if (error) goto error_exit; tmp = dpart.part->p_fstype; @@ -447,7 +442,7 @@ mountmsdosfs(devvp, mp, td, argp) * * NOTE: 2048 is a maximum sector size in current... */ - error = bread(devvp, 0, 2048, NOCRED, &bp); + error = bread(devvp, 0, 2048, &bp); if (error) goto error_exit; bp->b_flags |= B_AGE; @@ -671,8 +666,7 @@ mountmsdosfs(devvp, mp, td, argp) if (pmp->pm_fsinfo) { struct fsinfo *fp; - if ((error = bread(devvp, pmp->pm_fsinfo, fsi_size(pmp), - NOCRED, &bp)) != 0) + if ((error = bread(devvp, pmp->pm_fsinfo, fsi_size(pmp), &bp)) != 0) goto error_exit; fp = (struct fsinfo *)bp->b_data; if (!bcmp(fp->fsisig1, "RRaA", 4) @@ -745,7 +739,7 @@ mountmsdosfs(devvp, mp, td, argp) error_exit: if (bp) brelse(bp); - (void) VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, td); + (void) VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, td); if (pmp) { if (pmp->pm_inusemap) free(pmp->pm_inusemap, M_MSDOSFSFAT); @@ -799,7 +793,7 @@ msdosfs_unmount(mp, mntflags, td) #endif error = VOP_CLOSE(pmp->pm_devvp, (pmp->pm_flags&MSDOSFSMNT_RONLY) ? FREAD : FREAD | FWRITE, - NOCRED, td); + td); vrele(pmp->pm_devvp); free(pmp->pm_inusemap, M_MSDOSFSFAT); free(pmp, M_MSDOSFSMNT); @@ -853,10 +847,9 @@ msdosfs_statfs(mp, sbp, td) } static int -msdosfs_sync(mp, waitfor, cred, td) +msdosfs_sync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { struct vnode *vp, *nvp; @@ -906,7 +899,7 @@ loop: goto loop; continue; } - error = VOP_FSYNC(vp, cred, waitfor, td); + error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; VOP_UNLOCK(vp, 0, td); @@ -920,7 +913,7 @@ loop: */ if (waitfor != MNT_LAZY) { vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = VOP_FSYNC(pmp->pm_devvp, cred, waitfor, td); + error = VOP_FSYNC(pmp->pm_devvp, waitfor, td); if (error) allerror = error; VOP_UNLOCK(pmp->pm_devvp, 0, td); diff --git a/sys/vfs/msdosfs/msdosfs_vnops.c b/sys/vfs/msdosfs/msdosfs_vnops.c index 58d2a7ba38..ccc4cb96f8 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.5 2003/06/25 03:56:01 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.6 2003/06/26 05:55:17 dillon Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -495,7 +495,7 @@ msdosfs_setattr(ap) default: break; } - error = detrunc(dep, vap->va_size, 0, cred, ap->a_td); + error = detrunc(dep, vap->va_size, 0, ap->a_td); if (error) return error; } @@ -605,7 +605,7 @@ msdosfs_read(ap) break; } else if (error) break; - error = bread(pmp->pm_devvp, lbn, blsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, lbn, blsize, &bp); } else { blsize = pmp->pm_bpcluster; rablock = lbn + 1; @@ -613,9 +613,9 @@ msdosfs_read(ap) de_cn2off(pmp, rablock) < dep->de_FileSize) { rasize = pmp->pm_bpcluster; error = breadn(vp, lbn, blsize, - &rablock, &rasize, 1, NOCRED, &bp); + &rablock, &rasize, 1, &bp); } else { - error = bread(vp, lbn, blsize, NOCRED, &bp); + error = bread(vp, lbn, blsize, &bp); } } if (error) { @@ -667,7 +667,6 @@ msdosfs_write(ap) struct vnode *thisvp; struct denode *dep = VTODE(vp); struct msdosfsmount *pmp = dep->de_pmp; - struct ucred *cred = ap->a_cred; struct proc *p = td->td_proc; #ifdef MSDOSFS_DEBUG @@ -715,7 +714,7 @@ msdosfs_write(ap) * with zeroed blocks. */ if (uio->uio_offset > dep->de_FileSize) { - error = deextend(dep, uio->uio_offset, cred); + error = deextend(dep, uio->uio_offset); if (error) return (error); } @@ -786,7 +785,7 @@ msdosfs_write(ap) /* * The block we need to write into exists, so read it in. */ - error = bread(thisvp, bn, pmp->pm_bpcluster, cred, &bp); + error = bread(thisvp, bn, pmp->pm_bpcluster, &bp); if (error) { brelse(bp); break; @@ -830,11 +829,11 @@ msdosfs_write(ap) errexit: if (error) { if (ioflag & IO_UNIT) { - detrunc(dep, osize, ioflag & IO_SYNC, NOCRED, NULL); + detrunc(dep, osize, ioflag & IO_SYNC, NULL); uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } else { - detrunc(dep, dep->de_FileSize, ioflag & IO_SYNC, NOCRED, NULL); + detrunc(dep, dep->de_FileSize, ioflag & IO_SYNC, NULL); if (uio->uio_resid != resid) error = 0; } @@ -1269,8 +1268,7 @@ abortit: panic("msdosfs_rename(): updating .. in root directory?"); } else bn = cntobn(pmp, cn); - error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, - NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, &bp); if (error) { /* XXX should really panic here, fs is corrupt */ brelse(bp); @@ -1492,7 +1490,7 @@ msdosfs_rmdir(ap) /* * Truncate the directory that is being deleted. */ - error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred, td); + error = detrunc(ip, (u_long)0, IO_SYNC, td); cache_purge(vp); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); @@ -1651,7 +1649,7 @@ msdosfs_readdir(ap) error = pcbmap(dep, lbn, &bn, &cn, &blsize); if (error) break; - error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); + error = bread(pmp->pm_devvp, bn, blsize, &bp); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/nfs/nfs.h b/sys/vfs/nfs/nfs.h index 4f0d105fe5..8dc0fe8da5 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.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs.h,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ #ifndef _NFS_NFS_H_ @@ -592,19 +592,17 @@ void nfs_sndunlock __P((struct nfsreq *)); int nfs_slplock __P((struct nfssvc_sock *, int)); void nfs_slpunlock __P((struct nfssvc_sock *)); int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); -int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct thread *, - int)); -int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *)); -int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *, - int *)); +int nfs_vinvalbuf __P((struct vnode *, int, struct thread *, int)); +int nfs_readrpc __P((struct vnode *, struct uio *)); +int nfs_writerpc __P((struct vnode *, struct uio *, int *, int *)); int nfs_commit __P((struct vnode *vp, u_quad_t offset, int cnt, - struct ucred *cred, struct thread *td)); -int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *)); -int nfs_asyncio __P((struct buf *, struct ucred *, struct thread *)); -int nfs_doio __P((struct buf *, struct ucred *, struct thread *)); -int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *)); + struct thread *td)); +int nfs_readdirrpc __P((struct vnode *, struct uio *)); +int nfs_asyncio __P((struct buf *, struct thread *)); +int nfs_doio __P((struct buf *, struct thread *)); +int nfs_readlinkrpc __P((struct vnode *, struct uio *)); int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct thread *)); -int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *)); +int nfs_readdirplusrpc __P((struct vnode *, struct uio *)); int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *, struct vattr *, struct nfs_fattr *)); @@ -646,7 +644,7 @@ void nfs_disconnect __P((struct nfsmount *)); void nfs_safedisconnect __P((struct nfsmount *)); int nfs_getattrcache __P((struct vnode *, struct vattr *)); int nfsm_strtmbuf __P((struct mbuf **, char **, const char *, long)); -int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *)); +int nfs_bioread __P((struct vnode *, struct uio *, int)); int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); @@ -658,8 +656,7 @@ int nfsrv_object_create __P((struct vnode *)); void nfsrv_wakenfsd __P((struct nfssvc_sock *slp)); int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *, struct thread *, struct mbuf **)); -int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *, - struct thread *p)); +int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct thread *p)); int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -723,7 +720,7 @@ int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); -int nfs_meta_setsize __P((struct vnode *vp, struct ucred *cred, struct thread *td, u_quad_t nsize)); +int nfs_meta_setsize __P((struct vnode *vp, struct thread *td, u_quad_t nsize)); #endif /* _KERNEL */ diff --git a/sys/vfs/nfs/nfs_bio.c b/sys/vfs/nfs/nfs_bio.c index fb1d955a81..0e4aadf5bf 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: src/sys/nfs/nfs_bio.c,v 1.83.2.4 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.5 2003/06/26 02:17:46 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.6 2003/06/26 05:55:18 dillon Exp $ */ @@ -86,21 +86,16 @@ nfs_getpages(ap) } */ *ap; { struct thread *td = curthread; /* XXX */ - struct proc *p = td->td_proc; /* XXX */ int i, error, nextoff, size, toff, count, npages; struct uio uio; struct iovec iov; vm_offset_t kva; struct buf *bp; struct vnode *vp; - struct ucred *cred; struct nfsmount *nmp; vm_page_t *pages; - KKASSERT(p); - vp = ap->a_vp; - cred = p->p_ucred; /* XXX */ nmp = VFSTONFS(vp->v_mount); pages = ap->a_m; count = ap->a_count; @@ -112,7 +107,7 @@ nfs_getpages(ap) if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) - (void)nfs_fsinfo(nmp, vp, cred, td); + (void)nfs_fsinfo(nmp, vp, td); npages = btoc(count); @@ -155,7 +150,7 @@ nfs_getpages(ap) uio.uio_rw = UIO_READ; uio.uio_td = td; - error = nfs_readrpc(vp, &uio, cred); + error = nfs_readrpc(vp, &uio); pmap_qremove(kva, npages); relpbuf(bp, &nfs_pbuf_freecnt); @@ -275,7 +270,7 @@ nfs_putpages(ap) if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) - (void)nfs_fsinfo(nmp, vp, cred, td); + (void)nfs_fsinfo(nmp, vp, td); for (i = 0; i < npages; i++) { rtvals[i] = VM_PAGER_AGAIN; @@ -315,7 +310,7 @@ nfs_putpages(ap) else iomode = NFSV3WRITE_FILESYNC; - error = nfs_writerpc(vp, &uio, cred, &iomode, &must_commit); + error = nfs_writerpc(vp, &uio, &iomode, &must_commit); pmap_qremove(kva, npages); relpbuf(bp, &nfs_pbuf_freecnt); @@ -336,7 +331,7 @@ nfs_putpages(ap) * Vnode op for read using bio */ int -nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) +nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag) { struct nfsnode *np = VTONFS(vp); int biosize, i; @@ -361,7 +356,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) - (void)nfs_fsinfo(nmp, vp, cred, td); + (void)nfs_fsinfo(nmp, vp, td); if (vp->v_type != VDIR && (uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) return (EFBIG); @@ -390,23 +385,23 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) if (vp->v_type != VDIR) panic("nfs: bioread, not dir"); nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); } np->n_attrstamp = 0; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { if (vp->v_type == VDIR) nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; @@ -421,7 +416,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) if (nmp->nm_flag & NFSMNT_NQNFS) { if (NQNFS_CKINVALID(vp, np, ND_READ)) { do { - error = nqnfs_getlease(vp, ND_READ, cred, td); + error = nqnfs_getlease(vp, ND_READ, td); } while (error == NQNFS_EXPIRED); if (error) return (error); @@ -430,14 +425,14 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) ((np->n_flag & NMODIFIED) && vp->v_type == VDIR)) { if (vp->v_type == VDIR) nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); np->n_brev = np->n_lrev; } } else if (vp->v_type == VDIR && (np->n_flag & NMODIFIED)) { nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); } @@ -445,9 +440,9 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) if (np->n_flag & NQNFSNONCACHE) { switch (vp->v_type) { case VREG: - return (nfs_readrpc(vp, uio, cred)); + return (nfs_readrpc(vp, uio)); case VLNK: - return (nfs_readlinkrpc(vp, uio, cred)); + return (nfs_readlinkrpc(vp, uio)); case VDIR: break; default: @@ -475,7 +470,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) { rabp->b_flags |= (B_READ | B_ASYNC); vfs_busy_pages(rabp, 0); - if (nfs_asyncio(rabp, cred, td)) { + if (nfs_asyncio(rabp, td)) { rabp->b_flags |= B_INVAL|B_ERROR; vfs_unbusy_pages(rabp); brelse(rabp); @@ -536,7 +531,7 @@ again: if ((bp->b_flags & B_CACHE) == 0) { bp->b_flags |= B_READ; vfs_busy_pages(bp, 0); - error = nfs_doio(bp, cred, td); + error = nfs_doio(bp, td); if (error) { brelse(bp); return (error); @@ -563,7 +558,7 @@ again: if ((bp->b_flags & B_CACHE) == 0) { bp->b_flags |= B_READ; vfs_busy_pages(bp, 0); - error = nfs_doio(bp, cred, td); + error = nfs_doio(bp, td); if (error) { bp->b_flags |= B_ERROR; brelse(bp); @@ -587,14 +582,14 @@ again: if ((bp->b_flags & B_CACHE) == 0) { bp->b_flags |= B_READ; vfs_busy_pages(bp, 0); - error = nfs_doio(bp, cred, td); + error = nfs_doio(bp, td); if (error) { brelse(bp); } while (error == NFSERR_BAD_COOKIE) { printf("got bad cookie vp %p bp %p\n", vp, bp); nfs_invaldir(vp); - error = nfs_vinvalbuf(vp, 0, cred, td, 1); + error = nfs_vinvalbuf(vp, 0, td, 1); /* * Yuck! The directory has been modified on the * server. The only way to get the block is by @@ -615,7 +610,7 @@ again: if ((bp->b_flags & B_CACHE) == 0) { bp->b_flags |= B_READ; vfs_busy_pages(bp, 0); - error = nfs_doio(bp, cred, td); + error = nfs_doio(bp, td); /* * no error + B_INVAL == directory EOF, * use the block. @@ -658,7 +653,7 @@ again: if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) { rabp->b_flags |= (B_READ | B_ASYNC); vfs_busy_pages(rabp, 0); - if (nfs_asyncio(rabp, cred, td)) { + if (nfs_asyncio(rabp, td)) { rabp->b_flags |= B_INVAL|B_ERROR; vfs_unbusy_pages(rabp); brelse(rabp); @@ -731,7 +726,6 @@ nfs_write(ap) struct thread *td = uio->uio_td; struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); - struct ucred *cred = ap->a_cred; int ioflag = ap->a_ioflag; struct buf *bp; struct vattr vattr; @@ -755,7 +749,7 @@ nfs_write(ap) } if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) - (void)nfs_fsinfo(nmp, vp, cred, td); + (void)nfs_fsinfo(nmp, vp, td); /* * Synchronously flush pending buffers if we are in synchronous @@ -764,7 +758,7 @@ nfs_write(ap) if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { np->n_attrstamp = 0; - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); } @@ -777,7 +771,7 @@ nfs_write(ap) restart: if (ioflag & IO_APPEND) { np->n_attrstamp = 0; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); uio->uio_offset = np->n_size; @@ -841,13 +835,13 @@ restart: if ((nmp->nm_flag & NFSMNT_NQNFS) && NQNFS_CKINVALID(vp, np, ND_WRITE)) { do { - error = nqnfs_getlease(vp, ND_WRITE, cred, td); + error = nqnfs_getlease(vp, ND_WRITE, td); } while (error == NQNFS_EXPIRED); if (error) break; if (np->n_lrev != np->n_brev || (np->n_flag & NQNFSNONCACHE)) { - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) break; np->n_brev = np->n_lrev; @@ -855,7 +849,7 @@ restart: } if ((np->n_flag & NQNFSNONCACHE) && uio->uio_iovcnt == 1) { iomode = NFSV3WRITE_FILESYNC; - error = nfs_writerpc(vp, uio, cred, &iomode, &must_commit); + error = nfs_writerpc(vp, uio, &iomode, &must_commit); if (must_commit) nfs_clearcommit(vp->v_mount); break; @@ -944,7 +938,7 @@ again: if ((bp->b_flags & B_CACHE) == 0) { bp->b_flags |= B_READ; vfs_busy_pages(bp, 0); - error = nfs_doio(bp, cred, td); + error = nfs_doio(bp, td); if (error) { brelse(bp); break; @@ -954,8 +948,6 @@ again: error = EINTR; break; } - if (bp->b_wcred == NOCRED) - bp->b_wcred = crhold(cred); np->n_flag |= NMODIFIED; /* @@ -1010,7 +1002,7 @@ again: if ((nmp->nm_flag & NFSMNT_NQNFS) && NQNFS_CKINVALID(vp, np, ND_WRITE)) { do { - error = nqnfs_getlease(vp, ND_WRITE, cred, td); + error = nqnfs_getlease(vp, ND_WRITE, td); } while (error == NQNFS_EXPIRED); if (error) { brelse(bp); @@ -1019,7 +1011,7 @@ again: if (np->n_lrev != np->n_brev || (np->n_flag & NQNFSNONCACHE)) { brelse(bp); - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) break; np->n_brev = np->n_lrev; @@ -1077,7 +1069,7 @@ again: if (error) break; if (np->n_flag & NQNFSNONCACHE) { - error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) break; } @@ -1146,7 +1138,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td) * doing the flush, just wait for completion. */ int -nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, +nfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) { register struct nfsnode *np = VTONFS(vp); @@ -1181,7 +1173,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, * Now, flush as required. */ np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, cred, td, slpflag, 0); + error = vinvalbuf(vp, flags, td, slpflag, 0); while (error) { if (intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, td)) { np->n_flag &= ~NFLUSHINPROG; @@ -1191,7 +1183,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, } return (EINTR); } - error = vinvalbuf(vp, flags, cred, td, 0, slptimeo); + error = vinvalbuf(vp, flags, td, 0, slptimeo); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { @@ -1210,7 +1202,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, * is eventually dequeued by the async daemon, nfs_doio() *will*. */ int -nfs_asyncio(struct buf *bp, struct ucred *cred, struct thread *td) +nfs_asyncio(struct buf *bp, struct thread *td) { struct nfsmount *nmp; int i; @@ -1310,14 +1302,8 @@ again: } } - if (bp->b_flags & B_READ) { - if (bp->b_rcred == NOCRED && cred != NOCRED) - bp->b_rcred = crhold(cred); - } else { + if ((bp->b_flags & B_READ) == 0) bp->b_flags |= B_WRITEINPROG; - if (bp->b_wcred == NOCRED && cred != NOCRED) - bp->b_wcred = crhold(cred); - } BUF_KERNPROC(bp); TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); @@ -1340,7 +1326,7 @@ again: * NOTE! TD MIGHT BE NULL */ int -nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) +nfs_doio(struct buf *bp, struct thread *td) { struct uio *uiop; struct vnode *vp; @@ -1382,14 +1368,14 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) if (bp->b_flags & B_READ) { uiop->uio_rw = UIO_READ; nfsstats.read_physios++; - error = nfs_readrpc(vp, uiop, cr); + error = nfs_readrpc(vp, uiop); } else { int com; iomode = NFSV3WRITE_DATASYNC; uiop->uio_rw = UIO_WRITE; nfsstats.write_physios++; - error = nfs_writerpc(vp, uiop, cr, &iomode, &com); + error = nfs_writerpc(vp, uiop, &iomode, &com); } if (error) { bp->b_flags |= B_ERROR; @@ -1404,7 +1390,7 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) case VREG: uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE; nfsstats.read_bios++; - error = nfs_readrpc(vp, uiop, cr); + error = nfs_readrpc(vp, uiop); if (!error) { if (uiop->uio_resid) { @@ -1438,18 +1424,18 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) case VLNK: uiop->uio_offset = (off_t)0; nfsstats.readlink_bios++; - error = nfs_readlinkrpc(vp, uiop, cr); + error = nfs_readlinkrpc(vp, uiop); break; case VDIR: nfsstats.readdir_bios++; uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ; if (nmp->nm_flag & NFSMNT_RDIRPLUS) { - error = nfs_readdirplusrpc(vp, uiop, cr); + error = nfs_readdirplusrpc(vp, uiop); if (error == NFSERR_NOTSUPP) nmp->nm_flag &= ~NFSMNT_RDIRPLUS; } if ((nmp->nm_flag & NFSMNT_RDIRPLUS) == 0) - error = nfs_readdirrpc(vp, uiop, cr); + error = nfs_readdirrpc(vp, uiop); /* * end-of-directory sets B_INVAL but does not generate an * error. @@ -1475,9 +1461,8 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff; bp->b_flags |= B_WRITEINPROG; - retv = nfs_commit( - bp->b_vp, off, bp->b_dirtyend-bp->b_dirtyoff, - bp->b_wcred, td); + retv = nfs_commit(bp->b_vp, off, + bp->b_dirtyend - bp->b_dirtyoff, td); bp->b_flags &= ~B_WRITEINPROG; if (retv == 0) { bp->b_dirtyoff = bp->b_dirtyend = 0; @@ -1513,7 +1498,7 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) iomode = NFSV3WRITE_FILESYNC; bp->b_flags |= B_WRITEINPROG; - error = nfs_writerpc(vp, uiop, cr, &iomode, &must_commit); + error = nfs_writerpc(vp, uiop, &iomode, &must_commit); /* * When setting B_NEEDCOMMIT also set B_CLUSTEROK to try @@ -1599,7 +1584,7 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td) */ int -nfs_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad_t nsize) +nfs_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize) { struct nfsnode *np = VTONFS(vp); u_quad_t tsize = np->n_size; @@ -1618,7 +1603,7 @@ nfs_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad * truncation point. We may have a B_DELWRI and/or B_CACHE * buffer that now needs to be truncated. */ - error = vtruncbuf(vp, cred, td, nsize, biosize); + error = vtruncbuf(vp, td, nsize, biosize); lbn = nsize / biosize; bufsize = nsize & (biosize - 1); bp = nfs_getcacheblk(vp, lbn, bufsize, td); diff --git a/sys/vfs/nfs/nfs_node.c b/sys/vfs/nfs/nfs_node.c index 625dacab2c..eb1d2c91a7 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.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_node.c,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ @@ -214,11 +214,11 @@ nfs_inactive(ap) * have our own reference. */ if (ap->a_vp->v_usecount > 0) - (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, ap->a_td, 1); + (void) nfs_vinvalbuf(ap->a_vp, 0, ap->a_td, 1); else if (vget(ap->a_vp, 0, ap->a_td)) panic("nfs_inactive: lost vnode"); else { - (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, ap->a_td, 1); + (void) nfs_vinvalbuf(ap->a_vp, 0, ap->a_td, 1); vrele(ap->a_vp); } /* diff --git a/sys/vfs/nfs/nfs_nqlease.c b/sys/vfs/nfs/nfs_nqlease.c index e4330effd5..4e3e0f6b38 100644 --- a/sys/vfs/nfs/nfs_nqlease.c +++ b/sys/vfs/nfs/nfs_nqlease.c @@ -35,7 +35,7 @@ * * @(#)nfs_nqlease.c 8.9 (Berkeley) 5/20/95 * $FreeBSD: src/sys/nfs/nfs_nqlease.c,v 1.50 2000/02/13 03:32:05 peter Exp $ - * $DragonFly: src/sys/vfs/nfs/Attic/nfs_nqlease.c,v 1.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/Attic/nfs_nqlease.c,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ @@ -194,7 +194,7 @@ nqsrv_getlease(vp, duration, flags, slp, td, nam, cachablep, frev, cred) return (0); if (*duration > nqsrv_maxlease) *duration = nqsrv_maxlease; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); *frev = vattr.va_filerev; @@ -758,7 +758,7 @@ nqnfsrv_getlease(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, } (void) nqsrv_getlease(vp, &nfsd->nd_duration, flags, slp, td, nam, &cache, &frev, cred); - error = VOP_GETATTR(vp, vap, cred, td); + error = VOP_GETATTR(vp, vap, td); vput(vp); nfsm_reply(NFSX_V3FATTR + 4 * NFSX_UNSIGNED); nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED); @@ -850,8 +850,7 @@ nfsmout: * Client get lease rpc function. */ int -nqnfs_getlease(struct vnode *vp, int rwflag, - struct ucred *cred, struct thread *td) +nqnfs_getlease(struct vnode *vp, int rwflag, struct thread *td) { u_int32_t *tl; caddr_t cp; @@ -873,7 +872,7 @@ nqnfs_getlease(struct vnode *vp, int rwflag, *tl++ = txdr_unsigned(rwflag); *tl = txdr_unsigned(nmp->nm_leaseterm); reqtime = time_second; - nfsm_request(vp, NQNFSPROC_GETLEASE, td, cred); + nfsm_request(vp, NQNFSPROC_GETLEASE, td, NFSVPCRED(vp)); np = VTONFS(vp); nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED); cachable = fxdr_unsigned(int, *tl++); @@ -1088,12 +1087,11 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, td) nfs_invaldir(vp); cache_purge(vp); (void) nfs_vinvalbuf(vp, - V_SAVE, cred, td, 0); + V_SAVE, td, 0); np->n_flag &= ~NQNFSEVICTED; (void) nqnfs_vacated(vp, cred); } else if (vp->v_type == VREG) { - (void) VOP_FSYNC(vp, cred, - MNT_WAIT, td); + (void) VOP_FSYNC(vp, MNT_WAIT, td); np->n_flag &= ~NMODIFIED; } } @@ -1108,7 +1106,7 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, td) vget(vp, LK_EXCLUSIVE, td) == 0) { nmp->nm_inprog = vp; if (vpid == vp->v_id && - nqnfs_getlease(vp, ND_WRITE, cred, td)==0) + nqnfs_getlease(vp, ND_WRITE, td)==0) np->n_brev = np->n_lrev; vput(vp); nmp->nm_inprog = NULLVP; @@ -1153,7 +1151,7 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, td) TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp, nu_lru); free((caddr_t)nuidp, M_NFSUID); } - zfree(nfsmount_zone, nmp); + nfs_free_mount(nmp); if (error == EWOULDBLOCK) error = 0; return (error); diff --git a/sys/vfs/nfs/nfs_serv.c b/sys/vfs/nfs/nfs_serv.c index 5fe53d5467..f0b7fbe8df 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.5 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_serv.c,v 1.6 2003/06/26 05:55:18 dillon Exp $ */ /* @@ -225,7 +225,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, cred, td); + getret = VOP_GETATTR(vp, vap, td); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED); @@ -277,7 +277,7 @@ nfsrv_getattr(nfsd, slp, td, mrq) goto nfsmout; } nqsrv_getl(vp, ND_READ); - error = VOP_GETATTR(vp, vap, cred, td); + error = VOP_GETATTR(vp, vap, td); vput(vp); vp = NULL; nfsm_reply(NFSX_FATTR(nfsd->nd_flag & ND_NFSV3)); @@ -387,7 +387,7 @@ nfsrv_setattr(nfsd, slp, td, mrq) nqsrv_getl(vp, ND_WRITE); if (v3) { - error = preat_ret = VOP_GETATTR(vp, &preat, cred, td); + error = preat_ret = VOP_GETATTR(vp, &preat, td); if (!error && gcheck && (preat.va_ctime.tv_sec != guard.tv_sec || preat.va_ctime.tv_nsec != guard.tv_nsec)) @@ -421,7 +421,7 @@ nfsrv_setattr(nfsd, slp, td, mrq) } } error = VOP_SETATTR(vp, vap, cred, td); - postat_ret = VOP_GETATTR(vp, vap, cred, td); + postat_ret = VOP_GETATTR(vp, vap, td); if (!error) error = postat_ret; out: @@ -497,8 +497,7 @@ nfsrv_lookup(nfsd, slp, td, mrq) if (error) { if (dirp) { if (v3) - dirattr_ret = VOP_GETATTR(dirp, &dirattr, cred, - td); + dirattr_ret = VOP_GETATTR(dirp, &dirattr, td); vrele(dirp); dirp = NULL; } @@ -571,8 +570,7 @@ nfsrv_lookup(nfsd, slp, td, mrq) if (dirp) { if (v3) - dirattr_ret = VOP_GETATTR(dirp, &dirattr, cred, - td); + dirattr_ret = VOP_GETATTR(dirp, &dirattr, td); vrele(dirp); dirp = NULL; } @@ -610,7 +608,7 @@ nfsrv_lookup(nfsd, slp, td, mrq) fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, cred, td); + error = VOP_GETATTR(vp, vap, td); vput(vp); ndp->ni_vp = NULL; @@ -725,7 +723,7 @@ nfsrv_readlink(nfsd, slp, td, mrq) nqsrv_getl(vp, ND_READ); error = VOP_READLINK(vp, uiop, cred); out: - getret = VOP_GETATTR(vp, &attr, cred, td); + getret = VOP_GETATTR(vp, &attr, td); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_UNSIGNED); @@ -829,7 +827,7 @@ nfsrv_read(nfsd, slp, td, mrq) 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, cred, td); + getret = VOP_GETATTR(vp, vap, td); if (!error) error = getret; if (error) { @@ -968,7 +966,7 @@ nfsrv_read(nfsd, slp, td, mrq) off = uiop->uio_offset; nh->nh_nextr = off; FREE((caddr_t)iv2, M_TEMP); - if (error || (getret = VOP_GETATTR(vp, vap, cred, td))) { + if (error || (getret = VOP_GETATTR(vp, vap, td))) { if (!error) error = getret; m_freem(mreq); @@ -1111,7 +1109,7 @@ nfsrv_write(nfsd, slp, td, mrq) goto nfsmout; } if (v3) - forat_ret = VOP_GETATTR(vp, &forat, cred, td); + forat_ret = VOP_GETATTR(vp, &forat, td); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1168,7 +1166,7 @@ nfsrv_write(nfsd, slp, td, mrq) nfsstats.srvvop_writes++; FREE((caddr_t)iv, M_TEMP); } - aftat_ret = VOP_GETATTR(vp, vap, cred, td); + aftat_ret = VOP_GETATTR(vp, vap, td); vput(vp); vp = NULL; if (!error) @@ -1397,7 +1395,7 @@ loop1: nfsd->nd_nam, &rdonly, (nfsd->nd_flag & ND_KERBAUTH), TRUE); if (!error) { if (v3) - forat_ret = VOP_GETATTR(vp, &forat, cred, td); + forat_ret = VOP_GETATTR(vp, &forat, td); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1452,7 +1450,7 @@ loop1: } m_freem(mrep); if (vp) { - aftat_ret = VOP_GETATTR(vp, &va, cred, td); + aftat_ret = VOP_GETATTR(vp, &va, td); vput(vp); vp = NULL; } @@ -1647,8 +1645,7 @@ nfsrv_create(nfsd, slp, td, mrq) &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); } else { vrele(dirp); dirp = NULL; @@ -1821,13 +1818,13 @@ nfsrv_create(nfsd, slp, td, mrq) 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, cred, td); + error = VOP_GETATTR(nd.ni_vp, vap, td); } if (v3) { if (exclusive_flag && !error && bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF)) error = EEXIST; - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); vrele(dirp); dirp = NULL; } @@ -1920,7 +1917,7 @@ nfsrv_mknod(nfsd, slp, td, mrq) error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); if (error) { nfsm_reply(NFSX_WCCDATA(1)); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -2015,14 +2012,14 @@ 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, cred, td); + error = VOP_GETATTR(vp, vap, td); } if (vp) { vput(vp); vp = NULL; nd.ni_vp = NULL; } - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); if (dirp) { vrele(dirp); dirp = NULL; @@ -2093,7 +2090,7 @@ nfsrv_remove(nfsd, slp, td, mrq) &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); } else { vrele(dirp); dirp = NULL; @@ -2120,7 +2117,7 @@ out: } } if (dirp && v3) { - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); vrele(dirp); dirp = NULL; } @@ -2201,7 +2198,7 @@ nfsrv_rename(nfsd, slp, td, mrq) &dpos, &fdirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (fdirp) { if (v3) { - fdirfor_ret = VOP_GETATTR(fdirp, &fdirfor, cred, td); + fdirfor_ret = VOP_GETATTR(fdirp, &fdirfor, td); } else { vrele(fdirp); fdirp = NULL; @@ -2225,7 +2222,7 @@ nfsrv_rename(nfsd, slp, td, mrq) &dpos, &tdirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (tdirp) { if (v3) { - tdirfor_ret = VOP_GETATTR(tdirp, &tdirfor, cred, td); + tdirfor_ret = VOP_GETATTR(tdirp, &tdirfor, td); } else { vrele(tdirp); tdirp = NULL; @@ -2318,9 +2315,9 @@ out: out1: if (fdirp) - fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, cred, td); + fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, td); if (tdirp) - tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, cred, td); + tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, td); nfsm_reply(2 * NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft); @@ -2421,7 +2418,7 @@ nfsrv_link(nfsd, slp, td, mrq) &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); } else { vrele(dirp); dirp = NULL; @@ -2449,9 +2446,9 @@ out: out1: if (v3) - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, td); if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { nfsm_srvpostop_attr(getret, &at); @@ -2521,7 +2518,7 @@ nfsrv_symlink(nfsd, slp, td, mrq) &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); } else { vrele(dirp); dirp = NULL; @@ -2597,7 +2594,7 @@ nfsrv_symlink(nfsd, slp, td, mrq) 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, cred, td); + error = VOP_GETATTR(nd.ni_vp, vap, td); vput(nd.ni_vp); nd.ni_vp = NULL; } @@ -2613,7 +2610,7 @@ out: pathcp = NULL; } if (dirp) { - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); vrele(dirp); dirp = NULL; } @@ -2698,7 +2695,7 @@ nfsrv_mkdir(nfsd, slp, td, mrq) &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); } else { vrele(dirp); dirp = NULL; @@ -2750,11 +2747,11 @@ nfsrv_mkdir(nfsd, slp, td, mrq) 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, cred, td); + error = VOP_GETATTR(nd.ni_vp, vap, td); } out: if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); nfsm_reply(NFSX_SRVFH(v3) + NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { if (!error) { @@ -2830,7 +2827,7 @@ nfsrv_rmdir(nfsd, slp, td, mrq) &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, td); } else { vrele(dirp); dirp = NULL; @@ -2872,7 +2869,7 @@ out: NDFREE(&nd, NDF_ONLY_PNBUF); if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, td); nfsm_reply(NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -3009,7 +3006,7 @@ nfsrv_readdir(nfsd, slp, td, mrq) nqsrv_getl(vp, ND_READ); if (v3) { - error = getret = VOP_GETATTR(vp, &at, cred, td); + error = getret = VOP_GETATTR(vp, &at, td); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3055,7 +3052,7 @@ again: if (!cookies && !error) error = NFSERR_PERM; if (v3) { - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, td); if (!error) error = getret; } @@ -3293,7 +3290,7 @@ nfsrv_readdirplus(nfsd, slp, td, mrq) error = 0; goto nfsmout; } - error = getret = VOP_GETATTR(vp, &at, cred, td); + error = getret = VOP_GETATTR(vp, &at, td); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3333,7 +3330,7 @@ again: } error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (u_quad_t)io.uio_offset; - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, td); VOP_UNLOCK(vp, 0, td); if (!cookies && !error) error = NFSERR_PERM; @@ -3451,7 +3448,7 @@ again: nvp = NULL; goto invalid; } - if (VOP_GETATTR(nvp, vap, cred, td)) { + if (VOP_GETATTR(nvp, vap, td)) { vput(nvp); nvp = NULL; goto invalid; @@ -3614,7 +3611,7 @@ nfsrv_commit(nfsd, slp, td, mrq) error = 0; goto nfsmout; } - for_ret = VOP_GETATTR(vp, &bfor, cred, td); + for_ret = VOP_GETATTR(vp, &bfor, td); if (cnt > MAX_COMMIT_COUNT) { /* @@ -3624,7 +3621,7 @@ nfsrv_commit(nfsd, slp, td, mrq) (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) { vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); } - error = VOP_FSYNC(vp, cred, MNT_WAIT, td); + error = VOP_FSYNC(vp, MNT_WAIT, td); } else { /* * Locate and synchronously write any buffers that fall @@ -3682,7 +3679,7 @@ nfsrv_commit(nfsd, slp, td, mrq) splx(s); } - aft_ret = VOP_GETATTR(vp, &aft, cred, td); + aft_ret = VOP_GETATTR(vp, &aft, td); vput(vp); vp = NULL; nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF); @@ -3748,7 +3745,7 @@ nfsrv_statfs(nfsd, slp, td, mrq) } sf = &statfs; error = VFS_STATFS(vp->v_mount, sf, td); - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, td); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_STATFS(v3)); @@ -3836,7 +3833,7 @@ nfsrv_fsinfo(nfsd, slp, td, mrq) VFS_STATFS(vp->v_mount, &sb, td); maxfsize = (u_quad_t)0x80000000 * sb.f_bsize - 1; - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, td); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3FSINFO); @@ -3920,7 +3917,7 @@ nfsrv_pathconf(nfsd, slp, td, mrq) error = VOP_PATHCONF(vp, _PC_CHOWN_RESTRICTED, &chownres); if (!error) error = VOP_PATHCONF(vp, _PC_NO_TRUNC, ¬runc); - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, td); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3PATHCONF); @@ -4050,7 +4047,7 @@ nfsrv_access(struct vnode *vp, int flags, struct ucred *cred, if (vp->v_flag & VTEXT) return (ETXTBSY); } - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); error = VOP_ACCESS(vp, flags, cred, td); diff --git a/sys/vfs/nfs/nfs_subs.c b/sys/vfs/nfs/nfs_subs.c index 1926754b32..11a3c5ab5d 100644 --- a/sys/vfs/nfs/nfs_subs.c +++ b/sys/vfs/nfs/nfs_subs.c @@ -35,7 +35,7 @@ * * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 * $FreeBSD: src/sys/nfs/nfs_subs.c,v 1.90.2.2 2001/10/25 19:18:53 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_subs.c,v 1.4 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_subs.c,v 1.5 2003/06/26 05:55:18 dillon Exp $ */ /* @@ -2191,11 +2191,10 @@ int nfsrv_object_create(struct vnode *vp) { struct thread *td = curthread; - struct proc *p = td->td_proc; if (vp == NULL || vp->v_type != VREG) return (1); - return (vfs_object_create(vp, td, p ? p->p_ucred : NULL)); + return (vfs_object_create(vp, td)); } /* diff --git a/sys/vfs/nfs/nfs_syscalls.c b/sys/vfs/nfs/nfs_syscalls.c index bfa95e0103..5827c5b923 100644 --- a/sys/vfs/nfs/nfs_syscalls.c +++ b/sys/vfs/nfs/nfs_syscalls.c @@ -35,7 +35,7 @@ * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nfs_syscalls.c,v 1.58.2.1 2000/11/26 02:30:06 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_syscalls.c,v 1.4 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_syscalls.c,v 1.5 2003/06/26 05:55:18 dillon Exp $ */ #include @@ -954,10 +954,7 @@ nfssvc_iod(struct thread *td) nmp->nm_bufqwant = FALSE; wakeup(&nmp->nm_bufq); } - if (bp->b_flags & B_READ) - (void) nfs_doio(bp, bp->b_rcred, NULL); - else - (void) nfs_doio(bp, bp->b_wcred, NULL); + (void) nfs_doio(bp, NULL); /* * If there are more than one iod on this mount, then defect * so that the iods can be shared out fairly between the mounts diff --git a/sys/vfs/nfs/nfs_vfsops.c b/sys/vfs/nfs/nfs_vfsops.c index 72788480dd..2c1d91f951 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.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ #include "opt_bootp.h" @@ -111,7 +111,7 @@ static int nfs_root __P(( struct mount *mp, struct vnode **vpp)); static int nfs_statfs __P(( struct mount *mp, struct statfs *sbp, struct thread *td)); static int nfs_sync __P(( struct mount *mp, int waitfor, - struct ucred *cred, struct thread *td)); + struct thread *td)); /* * nfs vfs operations. @@ -269,7 +269,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) cred = crget(); cred->cr_ngroups = 1; if (v3 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) - (void)nfs_fsinfo(nmp, vp, cred, td); + (void)nfs_fsinfo(nmp, vp, td); nfsstats.rpccnt[NFSPROC_FSSTAT]++; nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3)); nfsm_fhtom(vp, v3); @@ -319,8 +319,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) * nfs version 3 fsinfo rpc call */ int -nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, - struct ucred *cred, struct thread *td) +nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct thread *td) { register struct nfsv3_fsinfo *fsp; register caddr_t cp; @@ -334,7 +333,7 @@ nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, nfsstats.rpccnt[NFSPROC_FSINFO]++; nfsm_reqhead(vp, NFSPROC_FSINFO, NFSX_FH(1)); nfsm_fhtom(vp, 1); - nfsm_request(vp, NFSPROC_FSINFO, td, cred); + nfsm_request(vp, NFSPROC_FSINFO, td, NFSVPCRED(vp)); nfsm_postop_attr(vp, retattr); if (!error) { nfsm_dissect(fsp, struct nfsv3_fsinfo *, NFSX_V3FSINFO); @@ -903,6 +902,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, /* Set up the sockets and per-host congestion */ nmp->nm_sotype = argp->sotype; nmp->nm_soproto = argp->proto; + nmp->nm_cred = crhold(proc0.p_ucred); nfs_decode_args(nmp, argp); @@ -938,7 +938,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, * Get file attributes for the mountpoint. This has the side * effect of filling in (*vpp)->v_type with the correct value. */ - VOP_GETATTR(*vpp, &attrs, curproc->p_ucred, curthread); + VOP_GETATTR(*vpp, &attrs, curthread); /* * Lose the lock but keep the ref. @@ -948,7 +948,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, return (0); bad: nfs_disconnect(nmp); - zfree(nfsmount_zone, nmp); + nfs_free_mount(nmp); FREE(nam, M_SONAME); return (error); } @@ -1002,10 +1002,20 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td) FREE(nmp->nm_nam, M_SONAME); if ((nmp->nm_flag & (NFSMNT_NQNFS | NFSMNT_KERB)) == 0) - zfree(nfsmount_zone, nmp); + nfs_free_mount(nmp); return (0); } +void +nfs_free_mount(struct nfsmount *nmp) +{ + if (nmp->nm_cred) { + crfree(nmp->nm_cred); + nmp->nm_cred = NULL; + } + zfree(nfsmount_zone, nmp); +} + /* * Return root of a filesystem */ @@ -1038,7 +1048,7 @@ extern int syncprt; */ /* ARGSUSED */ static int -nfs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct thread *td) +nfs_sync(struct mount *mp, int waitfor, struct thread *td) { struct vnode *vp; int error, allerror = 0; @@ -1061,7 +1071,7 @@ loop: continue; if (vget(vp, LK_EXCLUSIVE, td)) goto loop; - error = VOP_FSYNC(vp, cred, waitfor, td); + error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; vput(vp); diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index 0bac6450eb..824b42e159 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.4 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.5 2003/06/26 05:55:18 dillon Exp $ */ @@ -105,7 +105,7 @@ static int nfsfifo_write __P((struct vop_write_args *)); static int nfsspec_close __P((struct vop_close_args *)); static int nfsfifo_close __P((struct vop_close_args *)); #define nfs_poll vop_nopoll -static int nfs_flush __P((struct vnode *,struct ucred *,int,struct thread *,int)); +static int nfs_flush __P((struct vnode *,int,struct thread *,int)); static int nfs_setattrrpc __P((struct vnode *,struct vattr *,struct ucred *,struct thread *)); static int nfs_lookup __P((struct vop_lookup_args *)); static int nfs_create __P((struct vop_create_args *)); @@ -426,16 +426,16 @@ nfs_access(ap) auio.uio_td = ap->a_td; if (vp->v_type == VREG) - error = nfs_readrpc(vp, &auio, ap->a_cred); + error = nfs_readrpc(vp, &auio); else if (vp->v_type == VDIR) { char* bp; bp = malloc(NFS_DIRBLKSIZ, M_TEMP, M_WAITOK); aiov.iov_base = bp; aiov.iov_len = auio.uio_resid = NFS_DIRBLKSIZ; - error = nfs_readdirrpc(vp, &auio, ap->a_cred); + error = nfs_readdirrpc(vp, &auio); free(bp, M_TEMP); } else if (vp->v_type == VLNK) - error = nfs_readlinkrpc(vp, &auio, ap->a_cred); + error = nfs_readlinkrpc(vp, &auio); else error = EACCES; } @@ -478,41 +478,43 @@ nfs_open(ap) if (nmp->nm_flag & NFSMNT_NQNFS) { if (NQNFS_CKINVALID(vp, np, ND_READ)) { do { - error = nqnfs_getlease(vp, ND_READ, ap->a_cred, - ap->a_td); + error = nqnfs_getlease(vp, ND_READ, ap->a_td); } while (error == NQNFS_EXPIRED); if (error) return (error); if (np->n_lrev != np->n_brev || (np->n_flag & NQNFSNONCACHE)) { - if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, - ap->a_td, 1)) == EINTR) + if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) + == EINTR) { return (error); + } np->n_brev = np->n_lrev; } } } else { if (np->n_flag & NMODIFIED) { - if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, - ap->a_td, 1)) == EINTR) + if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) + == EINTR) { return (error); + } np->n_attrstamp = 0; if (vp->v_type == VDIR) np->n_direofoffset = 0; - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_td); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_td); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { if (vp->v_type == VDIR) np->n_direofoffset = 0; if ((error = nfs_vinvalbuf(vp, V_SAVE, - ap->a_cred, ap->a_td, 1)) == EINTR) + ap->a_td, 1)) == EINTR) { return (error); + } np->n_mtime = vattr.va_mtime.tv_sec; } } @@ -585,10 +587,10 @@ nfs_close(ap) * cannot clear it if we don't commit. */ int cm = nfsv3_commit_on_close ? 1 : 0; - error = nfs_flush(vp, ap->a_cred, MNT_WAIT, ap->a_td, cm); + error = nfs_flush(vp, MNT_WAIT, ap->a_td, cm); /* np->n_flag &= ~NMODIFIED; */ } else { - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); } np->n_attrstamp = 0; } @@ -635,7 +637,7 @@ nfs_getattr(ap) if (v3 && nfsaccess_cache_timeout > 0) { nfsstats.accesscache_misses++; - nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_td, ap->a_cred); + nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_td, NFSVPCRED(vp)); if (nfs_getattrcache(vp, ap->a_vap) == 0) return (0); } @@ -643,7 +645,7 @@ nfs_getattr(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, ap->a_cred); + nfsm_request(vp, NFSPROC_GETATTR, ap->a_td, NFSVPCRED(vp)); if (!error) { nfsm_loadattr(vp, ap->a_vap); } @@ -720,16 +722,13 @@ nfs_setattr(ap) */ tsize = np->n_size; - error = nfs_meta_setsize(vp, ap->a_cred, - ap->a_td, vap->va_size); + error = nfs_meta_setsize(vp, ap->a_td, vap->va_size); if (np->n_flag & NMODIFIED) { if (vap->va_size == 0) - error = nfs_vinvalbuf(vp, 0, - ap->a_cred, ap->a_td, 1); + error = nfs_vinvalbuf(vp, 0, ap->a_td, 1); else - error = nfs_vinvalbuf(vp, V_SAVE, - ap->a_cred, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error) { np->n_size = tsize; vnode_pager_setsize(vp, np->n_size); @@ -741,8 +740,7 @@ nfs_setattr(ap) } else if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED) && vp->v_type == VREG && - (error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, - ap->a_td, 1)) == EINTR) + (error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) return (error); error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_td); if (error && vap->va_size != VNOVAL) { @@ -874,7 +872,7 @@ nfs_lookup(ap) } if (!error) { if (vpid == newvp->v_id) { - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) + if (!VOP_GETATTR(newvp, &vattr, td) && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && @@ -1014,7 +1012,7 @@ nfs_read(ap) if (vp->v_type != VREG) return (EPERM); - return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred)); + return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag)); } /* @@ -1032,7 +1030,7 @@ nfs_readlink(ap) if (vp->v_type != VLNK) return (EINVAL); - return (nfs_bioread(vp, ap->a_uio, 0, ap->a_cred)); + return (nfs_bioread(vp, ap->a_uio, 0)); } /* @@ -1040,10 +1038,7 @@ nfs_readlink(ap) * Called by nfs_doio() from below the buffer cache. */ int -nfs_readlinkrpc(vp, uiop, cred) - register struct vnode *vp; - struct uio *uiop; - struct ucred *cred; +nfs_readlinkrpc(struct vnode *vp, struct uio *uiop) { register u_int32_t *tl; register caddr_t cp; @@ -1056,7 +1051,7 @@ nfs_readlinkrpc(vp, uiop, cred) nfsstats.rpccnt[NFSPROC_READLINK]++; nfsm_reqhead(vp, NFSPROC_READLINK, NFSX_FH(v3)); nfsm_fhtom(vp, v3); - nfsm_request(vp, NFSPROC_READLINK, uiop->uio_td, cred); + nfsm_request(vp, NFSPROC_READLINK, uiop->uio_td, NFSVPCRED(vp)); if (v3) nfsm_postop_attr(vp, attrflag); if (!error) { @@ -1077,10 +1072,7 @@ nfs_readlinkrpc(vp, uiop, cred) * Ditto above */ int -nfs_readrpc(vp, uiop, cred) - register struct vnode *vp; - struct uio *uiop; - struct ucred *cred; +nfs_readrpc(struct vnode *vp, struct uio *uiop) { register u_int32_t *tl; register caddr_t cp; @@ -1112,7 +1104,7 @@ nfs_readrpc(vp, uiop, cred) *tl++ = txdr_unsigned(len); *tl = 0; } - nfsm_request(vp, NFSPROC_READ, uiop->uio_td, cred); + nfsm_request(vp, NFSPROC_READ, uiop->uio_td, NFSVPCRED(vp)); if (v3) { nfsm_postop_attr(vp, attrflag); if (error) { @@ -1143,10 +1135,9 @@ nfsmout: * nfs write call */ int -nfs_writerpc(vp, uiop, cred, iomode, must_commit) +nfs_writerpc(vp, uiop, iomode, must_commit) register struct vnode *vp; register struct uio *uiop; - struct ucred *cred; int *iomode, *must_commit; { register u_int32_t *tl; @@ -1192,7 +1183,7 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit) *tl = x; /* size of this write */ } nfsm_uiotom(uiop, len); - nfsm_request(vp, NFSPROC_WRITE, uiop->uio_td, cred); + nfsm_request(vp, NFSPROC_WRITE, uiop->uio_td, NFSVPCRED(vp)); if (v3) { wccflag = NFSV3_WCCCHK; nfsm_wcc_data(vp, wccflag); @@ -1285,7 +1276,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap) else { return (EOPNOTSUPP); } - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td)) != 0) { return (error); } nfsstats.rpccnt[NFSPROC_MKNOD]++; @@ -1393,7 +1384,7 @@ nfs_create(ap) if (vap->va_type == VSOCK) return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap)); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td)) != 0) { return (error); } if (vap->va_vaflags & VA_EXCLUSIVE) @@ -1515,7 +1506,7 @@ nfs_remove(ap) if (vp->v_type == VDIR) error = EPERM; else if (vp->v_usecount == 1 || (np->n_sillyrename && - VOP_GETATTR(vp, &vattr, cnp->cn_cred, cnp->cn_td) == 0 && + VOP_GETATTR(vp, &vattr, cnp->cn_td) == 0 && vattr.va_nlink > 1)) { /* * Purge the name cache so that the chance of a lookup for @@ -1529,7 +1520,7 @@ nfs_remove(ap) * throw away biocache buffers, mainly to avoid * unnecessary delayed writes later. */ - error = nfs_vinvalbuf(vp, 0, cnp->cn_cred, cnp->cn_td, 1); + error = nfs_vinvalbuf(vp, 0, cnp->cn_td, 1); /* Do the rpc */ if (error != EINTR) error = nfs_removerpc(dvp, cnp->cn_nameptr, @@ -1636,9 +1627,9 @@ nfs_rename(ap) * often. */ - VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_td); + VOP_FSYNC(fvp, MNT_WAIT, fcnp->cn_td); if (tvp) - VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_td); + VOP_FSYNC(tvp, MNT_WAIT, tcnp->cn_td); /* * If the tvp exists and is in use, sillyrename it before doing the @@ -1767,7 +1758,7 @@ nfs_link(ap) * doesn't get "out of sync" with the server. * XXX There should be a better way! */ - VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_td); + VOP_FSYNC(vp, MNT_WAIT, cnp->cn_td); v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_LINK]++; @@ -1923,7 +1914,7 @@ nfs_mkdir(ap) struct vattr vattr; int v3 = NFS_ISV3(dvp); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td)) != 0) { return (error); } len = cnp->cn_namelen; @@ -2052,7 +2043,7 @@ nfs_readdir(ap) nfsstats.direofcache_hits++; return (0); } - } else if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_td) == 0 && + } else if (VOP_GETATTR(vp, &vattr, uio->uio_td) == 0 && np->n_mtime == vattr.va_mtime.tv_sec) { nfsstats.direofcache_hits++; return (0); @@ -2063,7 +2054,7 @@ nfs_readdir(ap) * Call nfs_bioread() to do the real work. */ tresid = uio->uio_resid; - error = nfs_bioread(vp, uio, 0, ap->a_cred); + error = nfs_bioread(vp, uio, 0); if (!error && uio->uio_resid == tresid) nfsstats.direofcache_misses++; @@ -2075,11 +2066,7 @@ nfs_readdir(ap) * Called from below the buffer cache by nfs_doio(). */ int -nfs_readdirrpc(vp, uiop, cred) - struct vnode *vp; - register struct uio *uiop; - struct ucred *cred; - +nfs_readdirrpc(struct vnode *vp, struct uio *uiop) { register int len, left; register struct dirent *dp = NULL; @@ -2132,7 +2119,7 @@ nfs_readdirrpc(vp, uiop, cred) *tl++ = cookie.nfsuquad[0]; } *tl = txdr_unsigned(nmp->nm_readdirsize); - nfsm_request(vp, NFSPROC_READDIR, uiop->uio_td, cred); + nfsm_request(vp, NFSPROC_READDIR, uiop->uio_td, NFSVPCRED(vp)); if (v3) { nfsm_postop_attr(vp, attrflag); if (!error) { @@ -2262,10 +2249,7 @@ nfsmout: * NFS V3 readdir plus RPC. Used in place of nfs_readdirrpc(). */ int -nfs_readdirplusrpc(vp, uiop, cred) - struct vnode *vp; - register struct uio *uiop; - struct ucred *cred; +nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop) { register int len, left; register struct dirent *dp; @@ -2322,7 +2306,7 @@ nfs_readdirplusrpc(vp, uiop, cred) *tl++ = dnp->n_cookieverf.nfsuquad[1]; *tl++ = txdr_unsigned(nmp->nm_readdirsize); *tl = txdr_unsigned(nmp->nm_rsize); - nfsm_request(vp, NFSPROC_READDIRPLUS, uiop->uio_td, cred); + nfsm_request(vp, NFSPROC_READDIRPLUS, uiop->uio_td, NFSVPCRED(vp)); nfsm_postop_attr(vp, attrflag); if (error) { m_freem(mrep); @@ -2634,12 +2618,7 @@ nfs_lookitup(dvp, name, len, cred, td, npp) * Nfs Version 3 commit rpc */ int -nfs_commit(vp, offset, cnt, cred, td) - struct vnode *vp; - u_quad_t offset; - int cnt; - struct ucred *cred; - struct thread *td; +nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct thread *td) { register caddr_t cp; register u_int32_t *tl; @@ -2658,7 +2637,7 @@ nfs_commit(vp, offset, cnt, cred, td) txdr_hyper(offset, tl); tl += 2; *tl = txdr_unsigned(cnt); - nfsm_request(vp, NFSPROC_COMMIT, td, cred); + nfsm_request(vp, NFSPROC_COMMIT, td, NFSVPCRED(vp)); nfsm_wcc_data(vp, wccflag); if (!error) { nfsm_dissect(tl, u_int32_t *, NFSX_V3WRITEVERF); @@ -2717,7 +2696,6 @@ nfs_strategy(ap) struct vop_strategy_args *ap; { register struct buf *bp = ap->a_bp; - struct ucred *cr; struct thread *td; int error = 0; @@ -2732,19 +2710,14 @@ nfs_strategy(ap) else td = curthread; /* XXX */ - if (bp->b_flags & B_READ) - cr = bp->b_rcred; - else - cr = bp->b_wcred; - /* * If the op is asynchronous and an i/o daemon is waiting * queue the request, wake it up and wait for completion * otherwise just do it ourselves. */ if ((bp->b_flags & B_ASYNC) == 0 || - nfs_asyncio(bp, NOCRED, td)) - error = nfs_doio(bp, cr, td); + nfs_asyncio(bp, td)) + error = nfs_doio(bp, td); return (error); } @@ -2782,7 +2755,7 @@ nfs_fsync(ap) } */ *ap; { - return (nfs_flush(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_td, 1)); + return (nfs_flush(ap->a_vp, ap->a_waitfor, ap->a_td, 1)); } /* @@ -2791,9 +2764,8 @@ nfs_fsync(ap) * associated with the vnode. */ static int -nfs_flush(vp, cred, waitfor, td, commit) +nfs_flush(vp, waitfor, td, commit) register struct vnode *vp; - struct ucred *cred; int waitfor; struct thread *td; int commit; @@ -2806,7 +2778,6 @@ nfs_flush(vp, cred, waitfor, td, commit) int s, error = 0, slptimeo = 0, slpflag = 0, retv, bvecpos; int passone = 1; u_quad_t off, endoff, toff; - struct ucred* wcred = NULL; struct buf **bvec = NULL; #ifndef NFS_COMMITBVECSIZ #define NFS_COMMITBVECSIZ 20 @@ -2873,9 +2844,6 @@ again: continue; bremfree(bp); /* - * Work out if all buffers are using the same cred - * so we can deal with them all with one commit. - * * NOTE: we are not clearing B_DONE here, so we have * to do it later on in this routine if we intend to * initiate I/O on the bp. @@ -2883,10 +2851,6 @@ again: * Note: to avoid loopback deadlocks, we do not * assign b_runningbufspace. */ - if (wcred == NULL) - wcred = bp->b_wcred; - else if (wcred != bp->b_wcred) - wcred = NOCRED; bp->b_flags |= B_WRITEINPROG; vfs_busy_pages(bp, 1); @@ -2917,28 +2881,10 @@ again: } if (bvecpos > 0) { /* - * Commit data on the server, as required. - * If all bufs are using the same wcred, then use that with - * one call for all of them, otherwise commit each one - * separately. + * Commit data on the server, as required. Note that + * nfs_commit will use the vnode's cred for the commit. */ - if (wcred != NOCRED) - retv = nfs_commit(vp, off, (int)(endoff - off), - wcred, td); - else { - retv = 0; - for (i = 0; i < bvecpos; i++) { - off_t off, size; - bp = bvec[i]; - off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + - bp->b_dirtyoff; - size = (u_quad_t)(bp->b_dirtyend - - bp->b_dirtyoff); - retv = nfs_commit(vp, off, (int)size, - bp->b_wcred, td); - if (retv) break; - } - } + retv = nfs_commit(vp, off, (int)(endoff - off), td); if (retv == NFSERR_STALEWRITEVERF) nfs_clearcommit(vp->v_mount); @@ -3224,7 +3170,7 @@ nfsspec_access(ap) if (cred->cr_uid == 0) return (0); vap = &vattr; - error = VOP_GETATTR(vp, vap, cred, ap->a_td); + error = VOP_GETATTR(vp, vap, ap->a_td); if (error) return (error); /* @@ -3317,7 +3263,7 @@ nfsspec_close(ap) vattr.va_atime = np->n_atim; if (np->n_flag & NUPD) vattr.va_mtime = np->n_mtim; - (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td); + (void)VOP_SETATTR(vp, &vattr, NFSVPCRED(vp), ap->a_td); } } return (VOCALL(spec_vnodeop_p, VOFFSET(vop_close), ap)); @@ -3377,7 +3323,6 @@ nfsfifo_close(ap) struct vop_close_args /* { struct vnode *a_vp; int a_fflag; - struct ucred *a_cred; struct thread *a_td; } */ *ap; { @@ -3400,7 +3345,7 @@ nfsfifo_close(ap) vattr.va_atime = np->n_atim; if (np->n_flag & NUPD) vattr.va_mtime = np->n_mtim; - (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td); + (void)VOP_SETATTR(vp, &vattr, NFSVPCRED(vp), ap->a_td); } } return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_close), ap)); diff --git a/sys/vfs/nfs/nfsmount.h b/sys/vfs/nfs/nfsmount.h index 888aa662d4..38514ae4c1 100644 --- a/sys/vfs/nfs/nfsmount.h +++ b/sys/vfs/nfs/nfsmount.h @@ -35,7 +35,7 @@ * * @(#)nfsmount.h 8.3 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nfsmount.h,v 1.17 1999/12/29 04:54:54 peter Exp $ - * $DragonFly: src/sys/vfs/nfs/nfsmount.h,v 1.2 2003/06/17 04:28:54 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfsmount.h,v 1.3 2003/06/26 05:55:18 dillon Exp $ */ @@ -94,13 +94,17 @@ struct nfsmount { short nm_bufqwant; /* process wants to add to the queue */ int nm_bufqiods; /* number of iods processing queue */ u_int64_t nm_maxfilesize; /* maximum file size */ + struct ucred *nm_cred; /* 'root' credential */ }; + #if defined(_KERNEL) /* * Convert mount ptr to nfsmount ptr. */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) +#define NFSVPCRED(vp) (VFSTONFS((vp)->v_mount)->nm_cred) +extern void nfs_free_mount(struct nfsmount *nmp); #endif diff --git a/sys/vfs/nfs/nqnfs.h b/sys/vfs/nfs/nqnfs.h index 6f3586a2f6..a3428c81d3 100644 --- a/sys/vfs/nfs/nqnfs.h +++ b/sys/vfs/nfs/nqnfs.h @@ -35,7 +35,7 @@ * * @(#)nqnfs.h 8.3 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nqnfs.h,v 1.22 2000/02/13 03:32:07 peter Exp $ - * $DragonFly: src/sys/vfs/nfs/Attic/nqnfs.h,v 1.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/Attic/nqnfs.h,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ @@ -196,7 +196,7 @@ int nqsrv_getlease __P((struct vnode *, u_int32_t *, int, struct nfssvc_sock *, struct thread *, struct sockaddr *, int *, u_quad_t *, struct ucred *)); -int nqnfs_getlease __P((struct vnode *,int,struct ucred *,struct thread *)); +int nqnfs_getlease __P((struct vnode *,int,struct thread *)); int nqnfs_callback __P((struct nfsmount *,struct mbuf *,struct mbuf *,caddr_t)); int nqnfs_clientd __P((struct nfsmount *,struct ucred *,struct nfsd_cargs *,int,caddr_t,struct thread *)); struct nfsnode; diff --git a/sys/vfs/ntfs/ntfs_subr.c b/sys/vfs/ntfs/ntfs_subr.c index 459edbd51d..c440190a1c 100644 --- a/sys/vfs/ntfs/ntfs_subr.c +++ b/sys/vfs/ntfs/ntfs_subr.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs_subr.c,v 1.7.2.4 2001/10/12 22:08:49 semenu Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs_subr.c,v 1.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_subr.c,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ #include @@ -284,8 +284,7 @@ ntfs_loadntnode( ntmp->ntm_bpmftrec * ip->i_number; error = bread(ntmp->ntm_devvp, - bn, ntfs_bntob(ntmp->ntm_bpmftrec), - NOCRED, &bp); + bn, ntfs_bntob(ntmp->ntm_bpmftrec), &bp); if (error) { printf("ntfs_loadntnode: BREAD FAILED\n"); brelse(bp); @@ -1467,7 +1466,7 @@ ntfs_writentvattr_plain( clrbuf(bp); } else { error = bread(ntmp->ntm_devvp, ntfs_cntobn(cn), - ntfs_cntob(cl), NOCRED, &bp); + ntfs_cntob(cl), &bp); if (error) { brelse(bp); return (error); @@ -1572,7 +1571,7 @@ ntfs_readntvattr_plain( error = bread(ntmp->ntm_devvp, ntfs_cntobn(cn), ntfs_cntob(cl), - NOCRED, &bp); + &bp); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/ntfs/ntfs_vfsops.c b/sys/vfs/ntfs/ntfs_vfsops.c index 0d652149fa..7389f77e78 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.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.4 2003/06/26 05:55:18 dillon Exp $ */ @@ -454,10 +454,10 @@ ntfs_mountfs(devvp, mp, argsp, td) return (EBUSY); #if defined(__FreeBSD__) VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, td, 0, 0); VOP__UNLOCK(devvp, 0, td); #else - error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, td, 0, 0); #endif if (error) return (error); @@ -471,7 +471,7 @@ ntfs_mountfs(devvp, mp, argsp, td) bp = NULL; - error = bread(devvp, BBLOCK, BBSIZE, NOCRED, &bp); + error = bread(devvp, BBLOCK, BBSIZE, &bp); if (error) goto out; ntmp = malloc( sizeof *ntmp, M_NTFSMNT, M_WAITOK ); @@ -630,10 +630,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, NOCRED, td); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); VOP__UNLOCK(devvp, 0, td); #else - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, td); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); #endif return (error); @@ -694,17 +694,15 @@ ntfs_unmount( if (ntmp->ntm_devvp->v_type != VBAD) ntmp->ntm_devvp->v_specmountpoint = NULL; - vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, td, 0, 0); + vinvalbuf(ntmp->ntm_devvp, V_SAVE, td, 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, - NOCRED, td); + error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, td); VOP__UNLOCK(ntmp->ntm_devvp, 0, td); #else - error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, - NOCRED, td); + error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, td); #endif vrele(ntmp->ntm_devvp); diff --git a/sys/vfs/ntfs/ntfs_vnops.c b/sys/vfs/ntfs/ntfs_vnops.c index 3e54a0fb6b..b51ecf25fc 100644 --- a/sys/vfs/ntfs/ntfs_vnops.c +++ b/sys/vfs/ntfs/ntfs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs_vnops.c,v 1.9.2.4 2002/08/06 19:35:18 semenu Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs_vnops.c,v 1.3 2003/06/25 03:56:07 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_vnops.c,v 1.4 2003/06/26 05:55:18 dillon Exp $ * */ @@ -188,7 +188,7 @@ ntfs_read(ap) toread = min(off + resid, ntfs_cntob(1)); - error = bread(vp, cn, ntfs_cntob(1), NOCRED, &bp); + error = bread(vp, cn, ntfs_cntob(1), &bp); if (error) { brelse(bp); break; diff --git a/sys/vfs/nullfs/null_vfsops.c b/sys/vfs/nullfs/null_vfsops.c index 69c7965710..52c47bdabb 100644 --- a/sys/vfs/nullfs/null_vfsops.c +++ b/sys/vfs/nullfs/null_vfsops.c @@ -37,7 +37,7 @@ * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 * $FreeBSD: src/sys/miscfs/nullfs/null_vfsops.c,v 1.35.2.3 2001/07/26 20:37:11 iedowse Exp $ - * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.3 2003/06/25 03:55:59 dillon Exp $ + * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.4 2003/06/26 05:55:15 dillon Exp $ */ /* @@ -69,8 +69,7 @@ static int nullfs_root(struct mount *mp, struct vnode **vpp); static int nullfs_start(struct mount *mp, int flags, struct thread *td); static int nullfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td); -static int nullfs_sync(struct mount *mp, int waitfor, - struct ucred *cred, struct thread *td); +static int nullfs_sync(struct mount *mp, int waitfor, struct thread *td); static int nullfs_unmount(struct mount *mp, int mntflags, struct thread *td); static int nullfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp); static int nullfs_vptofh(struct vnode *vp, struct fid *fhp); @@ -319,10 +318,9 @@ nullfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) } static int -nullfs_sync(mp, waitfor, cred, td) +nullfs_sync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { /* diff --git a/sys/vfs/nullfs/null_vnops.c b/sys/vfs/nullfs/null_vnops.c index 472aaf4883..b3f0bedc11 100644 --- a/sys/vfs/nullfs/null_vnops.c +++ b/sys/vfs/nullfs/null_vnops.c @@ -38,7 +38,7 @@ * Ancestors: * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 * $FreeBSD: src/sys/miscfs/nullfs/null_vnops.c,v 1.38.2.6 2002/07/31 00:32:28 semenu Exp $ - * $DragonFly: src/sys/vfs/nullfs/null_vnops.c,v 1.3 2003/06/25 03:55:59 dillon Exp $ + * $DragonFly: src/sys/vfs/nullfs/null_vnops.c,v 1.4 2003/06/26 05:55:15 dillon Exp $ * ...and... * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project * @@ -790,7 +790,7 @@ null_createvobject(ap) if (vp->v_type == VNON || lowervp == NULL) return 0; - error = VOP_CREATEVOBJECT(lowervp, ap->a_cred, ap->a_td); + error = VOP_CREATEVOBJECT(lowervp, ap->a_td); if (error) return (error); vp->v_flag |= VOBJBUF; diff --git a/sys/vfs/nwfs/nwfs.h b/sys/vfs/nwfs/nwfs.h index dca764e1bb..3c8e22f9a6 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.3 2003/06/25 03:56:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs.h,v 1.4 2003/06/26 05:55:19 dillon Exp $ */ #ifndef _NWFS_H_ @@ -77,8 +77,7 @@ struct nwmount { int ncp_conn_logged_in(struct nwmount *); int nwfs_ioctl(struct vop_ioctl_args *ap); int nwfs_doio(struct buf *bp, struct ucred *cr, struct thread *td); -int nwfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, - struct thread *td, int intrflg); +int nwfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg); #endif /* _KERNEL */ #endif /* _NWFS_H_ */ diff --git a/sys/vfs/nwfs/nwfs_io.c b/sys/vfs/nwfs/nwfs_io.c index 26acd249d5..7acb087c4e 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.3 2003/06/25 03:56:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_io.c,v 1.4 2003/06/26 05:55:19 dillon Exp $ * */ #include @@ -179,14 +179,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, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { - error = nwfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } @@ -220,7 +220,7 @@ nwfs_writevnode(vp, uiop, cred, ioflag) if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { nwfs_attr_cacheremove(vp); - error = nwfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); } if (ioflag & IO_APPEND) { @@ -229,7 +229,7 @@ nwfs_writevnode(vp, uiop, cred, ioflag) * the correct size. */ #if notyet nwfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); #endif uiop->uio_offset = np->n_size; @@ -584,10 +584,9 @@ nwfs_putpages(ap) * doing the flush, just wait for completion. */ int -nwfs_vinvalbuf(vp, flags, cred, td, intrflg) +nwfs_vinvalbuf(vp, flags, td, intrflg) struct vnode *vp; int flags; - struct ucred *cred; struct thread *td; int intrflg; { @@ -613,7 +612,7 @@ nwfs_vinvalbuf(vp, flags, cred, td, intrflg) return EINTR; } np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, cred, td, slpflag, 0); + error = vinvalbuf(vp, flags, td, slpflag, 0); while (error) { if (intrflg && (error == ERESTART || error == EINTR)) { np->n_flag &= ~NFLUSHINPROG; @@ -623,7 +622,7 @@ nwfs_vinvalbuf(vp, flags, cred, td, intrflg) } return EINTR; } - error = vinvalbuf(vp, flags, cred, td, slpflag, 0); + error = vinvalbuf(vp, flags, td, slpflag, 0); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { diff --git a/sys/vfs/nwfs/nwfs_node.c b/sys/vfs/nwfs/nwfs_node.c index 33ee21030d..bbc0025bba 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.3 2003/06/25 03:56:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_node.c,v 1.4 2003/06/26 05:55:19 dillon Exp $ */ #include #include @@ -265,7 +265,7 @@ nwfs_inactive(ap) NCPVNDEBUG("%s: %d\n", VTONW(vp)->n_name, vp->v_usecount); if (np->opened) { - error = nwfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, td, 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 cbd214a30f..339b577e31 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.4 2003/06/25 03:56:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.5 2003/06/26 05:55:19 dillon Exp $ */ #include "opt_ncp.h" #ifndef NCP @@ -73,7 +73,7 @@ static int nwfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); static int nwfs_root(struct mount *, struct vnode **); static int nwfs_start(struct mount *, int, struct thread *); static int nwfs_statfs(struct mount *, struct statfs *, struct thread *); -static int nwfs_sync(struct mount *, int, struct ucred *, struct thread *); +static int nwfs_sync(struct mount *, int, struct thread *); static int nwfs_unmount(struct mount *, int, struct thread *); static int nwfs_init(struct vfsconf *vfsp); static int nwfs_uninit(struct vfsconf *vfsp); @@ -480,10 +480,9 @@ nwfs_statfs(mp, sbp, td) */ /* ARGSUSED */ static int -nwfs_sync(mp, waitfor, cred, td) +nwfs_sync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { struct vnode *vp; @@ -506,7 +505,7 @@ loop: continue; if (vget(vp, LK_EXCLUSIVE, td)) goto loop; - error = VOP_FSYNC(vp, cred, waitfor, td); + error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; vput(vp); diff --git a/sys/vfs/nwfs/nwfs_vnops.c b/sys/vfs/nwfs/nwfs_vnops.c index 432f71e1d7..cad9d62932 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.3 2003/06/25 03:56:08 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.4 2003/06/26 05:55:19 dillon Exp $ */ #include #include @@ -190,17 +190,17 @@ nwfs_open(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_cred, ap->a_td, 1)) == EINTR) + if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) return (error); np->n_atime = 0; - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_td); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_td); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { - if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1)) == EINTR) + if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } @@ -254,7 +254,7 @@ nwfs_close(ap) return 0; } simple_unlock(&vp->v_interlock); - error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1); + error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); simple_lock(&vp->v_interlock); if (np->opened == 0) { simple_unlock(&vp->v_interlock); @@ -263,7 +263,7 @@ nwfs_close(ap) if (--np->opened == 0) { simple_unlock(&vp->v_interlock); error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, - ap->a_td, ap->a_cred); + ap->a_td, proc0.p_ucred); } else simple_unlock(&vp->v_interlock); np->n_atime = 0; @@ -297,10 +297,10 @@ nwfs_getattr(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,ap->a_cred); + ap->a_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, ap->a_cred); + np->n_name, &fattr, ap->a_td, proc0.p_ucred); } if (error) { NCPVNDEBUG("error %d\n", error); @@ -365,7 +365,7 @@ nwfs_setattr(ap) vnode_pager_setsize(vp, (u_long)tsize); } np->n_atime = 0; /* invalidate cache */ - VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td); + VOP_GETATTR(vp, vap, ap->a_td); np->n_mtime = vap->va_mtime.tv_sec; return (0); } @@ -445,7 +445,7 @@ nwfs_create(ap) *vpp = NULL; if (vap->va_type == VSOCK) return (EOPNOTSUPP); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td))) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) { return (error); } fmode = AR_READ | AR_WRITE; @@ -658,7 +658,7 @@ nwfs_mkdir(ap) struct vattr vattr; char *name=cnp->cn_nameptr; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td))) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) { return (error); } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) { @@ -809,7 +809,6 @@ static int nwfs_strategy (ap) } */ *ap; { struct buf *bp=ap->a_bp; - struct ucred *cr; int error = 0; struct thread *td = NULL; @@ -818,17 +817,13 @@ static int nwfs_strategy (ap) panic("nwfs physio"); if ((bp->b_flags & B_ASYNC) == 0) td = curthread; /* YYY dunno if this is legal */ - if (bp->b_flags & B_READ) - cr = bp->b_rcred; - else - cr = bp->b_wcred; /* * If the op is asynchronous and an i/o daemon is waiting * queue the request, wake it up and wait for completion * otherwise just do it ourselves. */ if ((bp->b_flags & B_ASYNC) == 0 ) - error = nwfs_doio(bp, cr, td); + error = nwfs_doio(bp, proc0.p_ucred, td); return (error); } @@ -975,7 +970,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & ISDOTDO } if (!error) { if (vpid == vp->v_id) { - if (!VOP_GETATTR(vp, &vattr, cnp->cn_cred, td) + if (!VOP_GETATTR(vp, &vattr, td) && vattr.va_ctime.tv_sec == VTONW(vp)->n_ctime) { if (nameiop != LOOKUP && islastcn) cnp->cn_flags |= SAVENAME; diff --git a/sys/vfs/procfs/procfs_vnops.c b/sys/vfs/procfs/procfs_vnops.c index 22a09bd14f..6bb049db8c 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.4 2003/06/25 03:56:00 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.5 2003/06/26 05:55:15 dillon Exp $ */ /* @@ -652,7 +652,7 @@ procfs_access(ap) return (0); vap = &vattr; - error = VOP_GETATTR(ap->a_vp, vap, ap->a_cred, ap->a_td); + error = VOP_GETATTR(ap->a_vp, vap, ap->a_td); if (error) return (error); diff --git a/sys/vfs/smbfs/smbfs.h b/sys/vfs/smbfs/smbfs.h index 57756d685f..2e8f3d7350 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.3 2003/06/25 03:55:52 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs.h,v 1.4 2003/06/26 05:55:12 dillon Exp $ */ #ifndef _SMBFS_SMBFS_H_ #define _SMBFS_SMBFS_H_ @@ -102,7 +102,7 @@ struct smbmount { int smbfs_ioctl(struct vop_ioctl_args *ap); int smbfs_doio(struct buf *bp, struct ucred *cr, struct thread *td); -int smbfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, +int smbfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg); #endif /* KERNEL */ diff --git a/sys/vfs/smbfs/smbfs_io.c b/sys/vfs/smbfs/smbfs_io.c index 58e7626478..8e1fcb00fd 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.3 2003/06/25 03:55:52 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_io.c,v 1.4 2003/06/26 05:55:12 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, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return error; if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) { - error = smbfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, td, 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, cred, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, td, 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, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return (error); #endif uiop->uio_offset = np->n_size; @@ -615,10 +615,9 @@ smbfs_putpages(ap) * doing the flush, just wait for completion. */ int -smbfs_vinvalbuf(vp, flags, cred, td, intrflg) +smbfs_vinvalbuf(vp, flags, td, intrflg) struct vnode *vp; int flags; - struct ucred *cred; struct thread *td; int intrflg; { @@ -642,7 +641,7 @@ smbfs_vinvalbuf(vp, flags, cred, td, intrflg) return EINTR; } np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, cred, td, slpflag, 0); + error = vinvalbuf(vp, flags, td, slpflag, 0); while (error) { if (intrflg && (error == ERESTART || error == EINTR)) { np->n_flag &= ~NFLUSHINPROG; @@ -652,7 +651,7 @@ smbfs_vinvalbuf(vp, flags, cred, td, intrflg) } return EINTR; } - error = vinvalbuf(vp, flags, cred, td, slpflag, 0); + error = vinvalbuf(vp, flags, td, 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 e4dca72e9b..aac93538a9 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.3 2003/06/25 03:55:52 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_node.c,v 1.4 2003/06/26 05:55:12 dillon Exp $ */ #include #include @@ -353,7 +353,7 @@ smbfs_inactive(ap) SMBVDEBUG("%s: %d\n", VTOSMB(vp)->n_name, vp->v_usecount); if (np->n_opencount) { - error = smbfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, td, 1); smb_makescred(&scred, td, cred); error = smbfs_smb_close(np->n_mount->sm_share, np->n_fid, &np->n_mtime, &scred); diff --git a/sys/vfs/smbfs/smbfs_vfsops.c b/sys/vfs/smbfs/smbfs_vfsops.c index 2b4598a38e..d61a565160 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.3 2003/06/25 03:55:52 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.4 2003/06/26 05:55:12 dillon Exp $ */ #include "opt_netsmb.h" #ifndef NETSMB @@ -85,7 +85,7 @@ static int smbfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); static int smbfs_root(struct mount *, struct vnode **); static int smbfs_start(struct mount *, int, struct thread *); static int smbfs_statfs(struct mount *, struct statfs *, struct thread *); -static int smbfs_sync(struct mount *, int, struct ucred *, struct thread *); +static int smbfs_sync(struct mount *, int, struct thread *); static int smbfs_unmount(struct mount *, int, struct thread *); static int smbfs_init(struct vfsconf *vfsp); static int smbfs_uninit(struct vfsconf *vfsp); @@ -433,10 +433,9 @@ smbfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) */ /* ARGSUSED */ static int -smbfs_sync(mp, waitfor, cred, td) +smbfs_sync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { struct vnode *vp; @@ -459,7 +458,7 @@ loop: continue; if (vget(vp, LK_EXCLUSIVE, td)) goto loop; - error = VOP_FSYNC(vp, cred, waitfor, td); + error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; vput(vp); diff --git a/sys/vfs/smbfs/smbfs_vnops.c b/sys/vfs/smbfs/smbfs_vnops.c index 4c4f1cc7cc..a00cd4b7a9 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.4 2003/06/25 03:55:52 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vnops.c,v 1.5 2003/06/26 05:55:12 dillon Exp $ */ #include #include @@ -192,19 +192,19 @@ smbfs_open(ap) return 0; } if (np->n_flag & NMODIFIED) { - if ((error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1)) == EINTR) + if ((error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) == EINTR) return error; smbfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_td); if (error) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; } else { - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_td); if (error) return error; if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) { - error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR) return error; np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; @@ -244,7 +244,7 @@ smbfs_closel(struct vop_close_args *ap) SMBVDEBUG("name=%s, pid=%d, c=%d\n",np->n_name, p->p_pid, np->n_opencount); - smb_makescred(&scred, td, ap->a_cred); + smb_makescred(&scred, td, proc0.p_ucred); if (np->n_opencount == 0) { if (vp->v_type != VDIR) @@ -261,10 +261,10 @@ smbfs_closel(struct vop_close_args *ap) } error = 0; } else { - error = smbfs_vinvalbuf(vp, V_SAVE, ap->a_cred, td, 1); + error = smbfs_vinvalbuf(vp, V_SAVE, td, 1); if (np->n_opencount) return error; - VOP_GETATTR(vp, &vattr, ap->a_cred, td); + VOP_GETATTR(vp, &vattr, td); error = smbfs_smb_close(np->n_mount->sm_share, np->n_fid, &np->n_mtime, &scred); } @@ -310,7 +310,6 @@ smbfs_getattr(ap) struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; - struct ucred *a_cred; struct thread *a_td; } */ *ap; { @@ -327,7 +326,7 @@ smbfs_getattr(ap) if (!error) return 0; SMBVDEBUG("not in the cache\n"); - smb_makescred(&scred, ap->a_td, ap->a_cred); + smb_makescred(&scred, ap->a_td, proc0.p_ucred); oldsize = np->n_size; error = smbfs_smb_lookup(np, NULL, 0, &fattr, &scred); if (error) { @@ -428,10 +427,10 @@ smbfs_setattr(ap) error = VOP_OPEN(vp, FWRITE, ap->a_cred, ap->a_td); if (!error) { /* error = smbfs_smb_setfattrNT(np, 0, mtime, atime, &scred); - VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);*/ + VOP_GETATTR(vp, &vattr, ap->a_td);*/ if (mtime) np->n_mtime = *mtime; - VOP_CLOSE(vp, FWRITE, ap->a_cred, ap->a_td); + VOP_CLOSE(vp, FWRITE, ap->a_td); } } else if ((vcp->vc_sopt.sv_caps & SMB_CAP_NT_SMBS)) { error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred); @@ -461,7 +460,7 @@ smbfs_setattr(ap) * required attributes. */ smbfs_attr_cacheremove(vp); /* invalidate cache */ - VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td); + VOP_GETATTR(vp, vap, ap->a_td); np->n_mtime.tv_sec = vap->va_mtime.tv_sec; return error; } @@ -537,7 +536,7 @@ smbfs_create(ap) *vpp = NULL; if (vap->va_type != VREG) return EOPNOTSUPP; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td))) + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) return error; smb_makescred(&scred, cnp->cn_td, cnp->cn_cred); @@ -733,7 +732,7 @@ smbfs_mkdir(ap) int len = cnp->cn_namelen; int error; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_td))) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_td))) { return error; } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) @@ -886,7 +885,6 @@ smbfs_strategy (ap) } */ *ap; { struct buf *bp=ap->a_bp; - struct ucred *cr; struct thread *td = NULL; int error = 0; @@ -895,13 +893,9 @@ smbfs_strategy (ap) panic("smbfs physio"); if ((bp->b_flags & B_ASYNC) == 0) td = curthread; /* XXX */ - if (bp->b_flags & B_READ) - cr = bp->b_rcred; - else - cr = bp->b_wcred; if ((bp->b_flags & B_ASYNC) == 0 ) - error = smbfs_doio(bp, cr, td); + error = smbfs_doio(bp, proc0.p_ucred, td); return error; } @@ -968,7 +962,7 @@ smbfs_getextattr(struct vop_getextattr_args *ap) error = VOP_ACCESS(vp, VREAD, cred, td); if (error) return error; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, td); if (error) return error; if (strcmp(name, "dosattr") == 0) { @@ -1208,7 +1202,7 @@ smbfs_lookup(ap) } if (!error) { if (vpid == vp->v_id) { - if (!VOP_GETATTR(vp, &vattr, cnp->cn_cred, td) + if (!VOP_GETATTR(vp, &vattr, td) /* && vattr.va_ctime.tv_sec == VTOSMB(vp)->n_ctime*/) { if (nameiop != LOOKUP && islastcn) cnp->cn_flags |= SAVENAME; diff --git a/sys/vfs/specfs/spec_vnops.c b/sys/vfs/specfs/spec_vnops.c index c01d666680..1090cc8a9e 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.6 2003/06/26 02:17:45 dillon Exp $ + * $DragonFly: src/sys/vfs/specfs/spec_vnops.c,v 1.7 2003/06/26 05:55:16 dillon Exp $ */ #include @@ -704,8 +704,6 @@ spec_getpages(ap) bp->b_iodone = spec_getpages_iodone; /* B_PHYS is not set, but it is nice to fill this in. */ - bp->b_rcred = crhold(curproc->p_ucred); - bp->b_wcred = crhold(curproc->p_ucred); bp->b_blkno = blkno; bp->b_lblkno = blkno; pbgetvp(ap->a_vp, bp); diff --git a/sys/vfs/ufs/ffs_alloc.c b/sys/vfs/ufs/ffs_alloc.c index 07e059ed2c..8dd3161b68 100644 --- a/sys/vfs/ufs/ffs_alloc.c +++ b/sys/vfs/ufs/ffs_alloc.c @@ -32,7 +32,7 @@ * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 * $FreeBSD: src/sys/ufs/ffs/ffs_alloc.c,v 1.64.2.2 2001/09/21 19:15:21 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.3 2003/06/26 05:55:20 dillon Exp $ */ #include "opt_quota.h" @@ -208,7 +208,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) /* * Allocate the extra space in the buffer. */ - error = bread(ITOV(ip), lbprev, osize, NOCRED, &bp); + error = bread(ITOV(ip), lbprev, osize, &bp); if (error) { brelse(bp); return (error); @@ -411,7 +411,7 @@ ffs_reallocblks(ap) soff = start_lbn; } else { idp = &start_ap[start_lvl - 1]; - if (bread(vp, idp->in_lbn, (int)fs->fs_bsize, NOCRED, &sbp)) { + if (bread(vp, idp->in_lbn, (int)fs->fs_bsize, &sbp)) { brelse(sbp); return (ENOSPC); } @@ -433,7 +433,7 @@ ffs_reallocblks(ap) panic("ffs_reallocblk: start == end"); #endif ssize = len - (idp->in_off + 1); - if (bread(vp, idp->in_lbn, (int)fs->fs_bsize, NOCRED, &ebp)) + if (bread(vp, idp->in_lbn, (int)fs->fs_bsize, &ebp)) goto fail; ebap = (ufs_daddr_t *)ebp->b_data; } @@ -923,7 +923,7 @@ ffs_fragextend(ip, cg, bprev, osize, nsize) return (0); } error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, &bp); if (error) { brelse(bp); return (0); @@ -992,7 +992,7 @@ ffs_alloccg(ip, cg, bpref, size) if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize) return (0); error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, &bp); if (error) { brelse(bp); return (0); @@ -1213,7 +1213,7 @@ ffs_clusteralloc(ip, cg, bpref, len) if (fs->fs_maxcluster[cg] < len) return (0); if (bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, - NOCRED, &bp)) + &bp)) goto fail; cgp = (struct cg *)bp->b_data; if (!cg_chkmagic(cgp)) @@ -1325,7 +1325,7 @@ ffs_nodealloccg(ip, cg, ipref, mode) if (fs->fs_cs(fs, cg).cs_nifree == 0) return (0); error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, &bp); if (error) { brelse(bp); return (0); @@ -1423,7 +1423,7 @@ ffs_blkfree(ip, bno, size) return; } error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, &bp); if (error) { brelse(bp); return; @@ -1527,7 +1527,7 @@ ffs_checkblk(ip, bno, size) if ((u_int)bno >= fs->fs_size) panic("ffs_checkblk: bad block %d", bno); error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, dtog(fs, bno))), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, &bp); if (error) panic("ffs_checkblk: cg bread failed"); cgp = (struct cg *)bp->b_data; @@ -1591,7 +1591,7 @@ ffs_vfree( pvp, ino, mode) major(pip->i_dev), minor(pip->i_dev), ino, fs->fs_fsmnt); cg = ino_to_cg(fs, ino); error = bread(pip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, &bp); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/ufs/ffs_balloc.c b/sys/vfs/ufs/ffs_balloc.c index 2ec5875699..7c40369b51 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.4 2003/06/25 03:56:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_balloc.c,v 1.5 2003/06/26 05:55:20 dillon Exp $ */ #include @@ -128,7 +128,7 @@ ffs_balloc(ap) if (lbn < NDADDR) { nb = ip->i_db[lbn]; if (nb != 0 && ip->i_size >= smalllblktosize(fs, lbn + 1)) { - error = bread(vp, lbn, fs->fs_bsize, NOCRED, &bp); + error = bread(vp, lbn, fs->fs_bsize, &bp); if (error) { brelse(bp); return (error); @@ -144,7 +144,7 @@ ffs_balloc(ap) osize = fragroundup(fs, blkoff(fs, ip->i_size)); nsize = fragroundup(fs, size); if (nsize <= osize) { - error = bread(vp, lbn, osize, NOCRED, &bp); + error = bread(vp, lbn, osize, &bp); if (error) { brelse(bp); return (error); @@ -233,8 +233,7 @@ ffs_balloc(ap) * Fetch through the indirect blocks, allocating as necessary. */ for (i = 1;;) { - error = bread(vp, - indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp); + error = bread(vp, indirs[i].in_lbn, (int)fs->fs_bsize, &bp); if (error) { brelse(bp); goto fail; @@ -336,10 +335,10 @@ ffs_balloc(ap) if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { error = cluster_read(vp, ip->i_size, lbn, - (int)fs->fs_bsize, NOCRED, + (int)fs->fs_bsize, MAXBSIZE, seqcount, &nbp); } else { - error = bread(vp, lbn, (int)fs->fs_bsize, NOCRED, &nbp); + error = bread(vp, lbn, (int)fs->fs_bsize, &nbp); } if (error) { brelse(nbp); @@ -363,7 +362,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, cred, MNT_WAIT, td); + (void) VOP_FSYNC(vp, MNT_WAIT, td); for (deallocated = 0, blkp = allociblk; blkp < allocblk; blkp++) { ffs_blkfree(ip, *blkp, fs->fs_bsize); deallocated += fs->fs_bsize; @@ -373,8 +372,7 @@ fail: } else if (unwindidx >= 0) { int r; - r = bread(vp, indirs[unwindidx].in_lbn, - (int)fs->fs_bsize, NOCRED, &bp); + r = bread(vp, indirs[unwindidx].in_lbn, (int)fs->fs_bsize, &bp); if (r) { panic("Could not unwind indirect block, error %d", r); brelse(bp); @@ -400,6 +398,6 @@ fail: ip->i_blocks -= btodb(deallocated); ip->i_flag |= IN_CHANGE | IN_UPDATE; } - (void) VOP_FSYNC(vp, cred, MNT_WAIT, td); + (void) VOP_FSYNC(vp, MNT_WAIT, td); return (error); } diff --git a/sys/vfs/ufs/ffs_extern.h b/sys/vfs/ufs/ffs_extern.h index fa6b593610..551cf3b057 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.3 2003/06/25 03:56:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_extern.h,v 1.4 2003/06/26 05:55:20 dillon Exp $ */ #ifndef _UFS_FFS_EXTERN_H @@ -92,7 +92,7 @@ int ffs_realloccg __P((struct inode *, ufs_daddr_t, ufs_daddr_t, int, int, struct ucred *, struct buf **)); void ffs_setblock __P((struct fs *, u_char *, ufs_daddr_t)); int ffs_statfs __P((struct mount *, struct statfs *, struct thread *)); -int ffs_sync __P((struct mount *, int, struct ucred *, struct thread *)); +int ffs_sync __P((struct mount *, int, struct thread *)); int ffs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct thread *)); int ffs_unmount __P((struct mount *, int, struct thread *)); int ffs_update __P((struct vnode *, int)); @@ -110,8 +110,7 @@ extern vop_t **ffs_fifoop_p; * Soft update function prototypes. */ void softdep_initialize __P((void)); -int softdep_mount __P((struct vnode *, struct mount *, struct fs *, - struct ucred *)); +int softdep_mount __P((struct vnode *, struct mount *, struct fs *)); int softdep_flushfiles __P((struct mount *, int, struct thread *)); void softdep_update_inodeblock __P((struct inode *, struct buf *, int)); void softdep_load_inodeblock __P((struct inode *)); diff --git a/sys/vfs/ufs/ffs_inode.c b/sys/vfs/ufs/ffs_inode.c index 4a4aa21f31..e65c5d16bf 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.3 2003/06/25 03:56:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_inode.c,v 1.4 2003/06/26 05:55:20 dillon Exp $ */ #include "opt_quota.h" @@ -98,7 +98,7 @@ ffs_update(vp, waitfor) ip->i_din.di_ogid = ip->i_gid; /* XXX */ } /* XXX */ error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->fs_bsize, NOCRED, &bp); + (int)fs->fs_bsize, &bp); if (error) { brelse(bp); return (error); @@ -189,15 +189,14 @@ ffs_truncate(vp, length, flags, cred, td) * rarely, we solve the problem by syncing the file * so that it will have no data structures left. */ - if ((error = VOP_FSYNC(ovp, cred, MNT_WAIT, - td)) != 0) + if ((error = VOP_FSYNC(ovp, MNT_WAIT, td)) != 0) return (error); } else { #ifdef QUOTA (void) chkdq(oip, -oip->i_blocks, NOCRED, 0); #endif softdep_setup_freeblocks(oip, length); - vinvalbuf(ovp, 0, cred, td, 0, 0); + vinvalbuf(ovp, 0, td, 0, 0); oip->i_flag |= IN_CHANGE | IN_UPDATE; return (ffs_update(ovp, 0)); } @@ -257,7 +256,7 @@ ffs_truncate(vp, length, flags, cred, td) */ if (DOINGSOFTDEP(ovp) && lbn < NDADDR && fragroundup(fs, blkoff(fs, length)) < fs->fs_bsize && - (error = VOP_FSYNC(ovp, cred, MNT_WAIT, td)) != 0) { + (error = VOP_FSYNC(ovp, MNT_WAIT, td)) != 0) { return (error); } oip->i_size = length; @@ -312,7 +311,7 @@ ffs_truncate(vp, length, flags, cred, td) bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks); oip->i_size = osize; - error = vtruncbuf(ovp, cred, td, length, fs->fs_bsize); + error = vtruncbuf(ovp, td, length, fs->fs_bsize); if (error && (allerror == 0)) allerror = error; diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index e4ac01a8ed..b19ad92670 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.4 2003/06/25 03:56:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.5 2003/06/26 05:55:20 dillon Exp $ */ /* @@ -825,7 +825,7 @@ softdep_flushfiles(struct mount *oldmnt, int flags, struct thread *td) break; } vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = VOP_FSYNC(devvp, cred, MNT_WAIT, td); + error = VOP_FSYNC(devvp, MNT_WAIT, td); VOP_UNLOCK(devvp, 0, td); if (error) break; @@ -1099,11 +1099,10 @@ softdep_initialize() * filesystem wishes to use it. */ int -softdep_mount(devvp, mp, fs, cred) +softdep_mount(devvp, mp, fs) struct vnode *devvp; struct mount *mp; struct fs *fs; - struct ucred *cred; { struct csum cstotal; struct cg *cgp; @@ -1122,7 +1121,7 @@ softdep_mount(devvp, mp, fs, cred) bzero(&cstotal, sizeof cstotal); for (cyl = 0; cyl < fs->fs_ncg; cyl++) { if ((error = bread(devvp, fsbtodb(fs, cgtod(fs, cyl)), - fs->fs_cgsize, cred, &bp)) != 0) { + fs->fs_cgsize, &bp)) != 0) { brelse(bp); return (error); } @@ -1777,7 +1776,7 @@ softdep_setup_freeblocks(ip, length) */ if ((error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->fs_bsize, NOCRED, &bp)) != 0) + (int)fs->fs_bsize, &bp)) != 0) softdep_error("softdep_setup_freeblocks", error); *((struct dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = ip->i_din; @@ -2217,7 +2216,7 @@ indir_trunc(ip, dbn, level, lbn, countp) FREE_LOCK(&lk); } else { FREE_LOCK(&lk); - error = bread(ip->i_devvp, dbn, (int)fs->fs_bsize, NOCRED, &bp); + error = bread(ip->i_devvp, dbn, (int)fs->fs_bsize, &bp); if (error) return (error); } @@ -4002,8 +4001,7 @@ softdep_fsync(vp) /* * Flush directory page containing the inode's name. */ - error = bread(pvp, lbn, blksize(fs, VTOI(pvp), lbn), p->p_ucred, - &bp); + error = bread(pvp, lbn, blksize(fs, VTOI(pvp), lbn), &bp); if (error == 0) error = VOP_BWRITE(bp->b_vp, bp); vput(pvp); @@ -4323,8 +4321,7 @@ loop: drain_output(vp, 1); if (vn_isdisk(vp, NULL) && vp->v_specmountpoint && !VOP_ISLOCKED(vp, NULL) && - (error = VFS_SYNC(vp->v_specmountpoint, MNT_WAIT, ap->a_cred, - ap->a_td)) != 0) + (error = VFS_SYNC(vp->v_specmountpoint, MNT_WAIT, ap->a_td)) != 0) return (error); return (0); } @@ -4479,8 +4476,8 @@ flush_pagedep_deps(pvp, mp, diraddhdp) FREE_LOCK(&lk); if ((error = VFS_VGET(mp, inum, &vp)) != 0) break; - if ((error=VOP_FSYNC(vp, cr, MNT_NOWAIT, td)) || - (error=VOP_FSYNC(vp, cr, MNT_NOWAIT, td))) { + if ((error=VOP_FSYNC(vp, MNT_NOWAIT, td)) || + (error=VOP_FSYNC(vp, MNT_NOWAIT, td))) { vput(vp); break; } @@ -4533,7 +4530,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp) FREE_LOCK(&lk); if ((error = bread(ump->um_devvp, fsbtodb(ump->um_fs, ino_to_fsba(ump->um_fs, inum)), - (int)ump->um_fs->fs_bsize, NOCRED, &bp)) != 0) + (int)ump->um_fs->fs_bsize, &bp)) != 0) break; if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) break; @@ -4704,7 +4701,7 @@ clear_remove(struct thread *td) softdep_error("clear_remove: vget", error); return; } - if ((error = VOP_FSYNC(vp, cred, MNT_NOWAIT, td))) + if ((error = VOP_FSYNC(vp, MNT_NOWAIT, td))) softdep_error("clear_remove: fsync", error); drain_output(vp, 0); vput(vp); @@ -4777,10 +4774,10 @@ clear_inodedeps(struct thread *td) return; } if (ino == lastino) { - if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, td))) + if ((error = VOP_FSYNC(vp, MNT_WAIT, td))) softdep_error("clear_inodedeps: fsync1", error); } else { - if ((error = VOP_FSYNC(vp, cred, MNT_NOWAIT, td))) + if ((error = VOP_FSYNC(vp, MNT_NOWAIT, td))) softdep_error("clear_inodedeps: fsync2", error); drain_output(vp, 0); } diff --git a/sys/vfs/ufs/ffs_subr.c b/sys/vfs/ufs/ffs_subr.c index f6c670ba42..348ecd169f 100644 --- a/sys/vfs/ufs/ffs_subr.c +++ b/sys/vfs/ufs/ffs_subr.c @@ -32,7 +32,7 @@ * * @(#)ffs_subr.c 8.5 (Berkeley) 3/21/95 * $FreeBSD: src/sys/ufs/ffs/ffs_subr.c,v 1.25 1999/12/29 04:55:04 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_subr.c,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_subr.c,v 1.3 2003/06/26 05:55:20 dillon Exp $ */ #include @@ -81,7 +81,7 @@ ffs_blkatoff(vp, offset, res, bpp) bsize = blksize(fs, ip, lbn); *bpp = NULL; - error = bread(vp, lbn, bsize, NOCRED, &bp); + error = bread(vp, lbn, bsize, &bp); if (error) { brelse(bp); return (error); diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c index 47a30225df..d40026f76c 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.3 2003/06/25 03:56:11 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.4 2003/06/26 05:55:20 dillon Exp $ */ #include "opt_quota.h" @@ -198,7 +198,7 @@ ffs_mount( mp, path, data, ndp, td) /* * Flush any dirty data. */ - VFS_SYNC(mp, MNT_WAIT, cred, td); + VFS_SYNC(mp, MNT_WAIT, td); /* * Check for and optionally get rid of files open * for writing. @@ -251,7 +251,7 @@ ffs_mount( mp, path, data, ndp, td) /* check to see if we need to start softdep */ if (fs->fs_flags & FS_DOSOFTDEP) { - err = softdep_mount(devvp, mp, fs, cred); + err = softdep_mount(devvp, mp, fs); if (err) goto error_1; } @@ -441,7 +441,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) */ devvp = VFSTOUFS(mp)->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = vinvalbuf(devvp, 0, cred, td, 0, 0); + error = vinvalbuf(devvp, 0, td, 0, 0); VOP_UNLOCK(devvp, 0, td); if (error) panic("ffs_reload: dirty1"); @@ -454,7 +454,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) */ if (devvp->v_tag != VT_MFS && vn_isdisk(devvp, NULL)) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); - vfs_object_create(devvp, td, cred); + vfs_object_create(devvp, td); simple_lock(&devvp->v_interlock); VOP_UNLOCK(devvp, LK_INTERLOCK, td); } @@ -466,7 +466,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) size = DEV_BSIZE; else size = dpart.disklab->d_secsize; - if ((error = bread(devvp, (ufs_daddr_t)(SBOFF/size), SBSIZE, NOCRED,&bp)) != 0) + if ((error = bread(devvp, (ufs_daddr_t)(SBOFF/size), SBSIZE, &bp)) != 0) return (error); newfs = (struct fs *)bp->b_data; if (newfs->fs_magic != FS_MAGIC || newfs->fs_bsize > MAXBSIZE || @@ -504,8 +504,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) size = fs->fs_bsize; if (i + fs->fs_frag > blks) size = (blks - i) * fs->fs_fsize; - error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - NOCRED, &bp); + error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, &bp); if (error) return (error); bcopy(bp->b_data, space, (u_int)size); @@ -542,7 +541,7 @@ loop: if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { goto loop; } - if (vinvalbuf(vp, 0, cred, td, 0, 0)) + if (vinvalbuf(vp, 0, td, 0, 0)) panic("ffs_reload: dirty2"); /* * Step 6: re-read inode data for all active vnodes. @@ -550,7 +549,7 @@ loop: ip = VTOI(vp); error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->fs_bsize, NOCRED, &bp); + (int)fs->fs_bsize, &bp); if (error) { vput(vp); return (error); @@ -584,13 +583,11 @@ ffs_mountfs(devvp, mp, td, malloctype) void *space; int error, i, blks, size, ronly; int32_t *lp; - struct ucred *cred; u_int64_t maxfilesize; /* XXX */ size_t strsize; int ncount; dev = devvp->v_rdev; - cred = td->td_proc ? td->td_proc->p_ucred : NOCRED; /* XXX */ /* * Disallow multiple mounts of the same device. * Disallow mounting of a device that is currently in use @@ -605,7 +602,7 @@ ffs_mountfs(devvp, mp, td, malloctype) if (ncount > 1 && devvp != rootvp) return (EBUSY); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0); + error = vinvalbuf(devvp, V_SAVE, td, 0, 0); VOP_UNLOCK(devvp, 0, td); if (error) return (error); @@ -618,7 +615,7 @@ ffs_mountfs(devvp, mp, td, malloctype) */ if (devvp->v_tag != VT_MFS && vn_isdisk(devvp, NULL)) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); - vfs_object_create(devvp, td, cred); + vfs_object_create(devvp, td); simple_lock(&devvp->v_interlock); VOP_UNLOCK(devvp, LK_INTERLOCK, td); } @@ -634,14 +631,14 @@ ffs_mountfs(devvp, mp, td, malloctype) if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, cred, td) != 0) + if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, proc0.p_ucred, td) != 0) size = DEV_BSIZE; else size = dpart.disklab->d_secsize; bp = NULL; ump = NULL; - if ((error = bread(devvp, SBLOCK, SBSIZE, cred, &bp)) != 0) + if ((error = bread(devvp, SBLOCK, SBSIZE, &bp)) != 0) goto out; fs = (struct fs *)bp->b_data; if (fs->fs_magic != FS_MAGIC || fs->fs_bsize > MAXBSIZE || @@ -700,7 +697,7 @@ ffs_mountfs(devvp, mp, td, malloctype) if (i + fs->fs_frag > blks) size = (blks - i) * fs->fs_fsize; if ((error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - cred, &bp)) != 0) { + &bp)) != 0) { free(fs->fs_csp, M_UFSMNT); goto out; } @@ -769,7 +766,7 @@ ffs_mountfs(devvp, mp, td, malloctype) fs->fs_maxfilesize = maxfilesize; /* XXX */ if (ronly == 0) { if ((fs->fs_flags & FS_DOSOFTDEP) && - (error = softdep_mount(devvp, mp, fs, cred)) != 0) { + (error = softdep_mount(devvp, mp, fs)) != 0) { free(fs->fs_csp, M_UFSMNT); goto out; } @@ -782,7 +779,7 @@ out: devvp->v_specmountpoint = NULL; if (bp) brelse(bp); - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, td); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); if (ump) { free(ump->um_fs, M_UFSMNT); free(ump, M_UFSMNT); @@ -856,9 +853,8 @@ ffs_unmount(struct mount *mp, int mntflags, struct thread *td) } ump->um_devvp->v_specmountpoint = NULL; - vinvalbuf(ump->um_devvp, V_SAVE, NOCRED, td, 0, 0); - error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, - NOCRED, td); + vinvalbuf(ump->um_devvp, V_SAVE, td, 0, 0); + error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, td); vrele(ump->um_devvp); @@ -910,7 +906,7 @@ ffs_flushfiles(struct mount *mp, int flags, struct thread *td) * Flush filesystem metadata. */ vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); - error = VOP_FSYNC(ump->um_devvp, cred, MNT_WAIT, td); + error = VOP_FSYNC(ump->um_devvp, MNT_WAIT, td); VOP_UNLOCK(ump->um_devvp, 0, td); return (error); } @@ -954,7 +950,7 @@ ffs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) * Note: we are always called with the filesystem marked `MPBUSY'. */ int -ffs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct thread *td) +ffs_sync(struct mount *mp, int waitfor, struct thread *td) { struct vnode *nvp, *vp; struct inode *ip; @@ -1001,7 +997,7 @@ loop: if (error == ENOENT) goto loop; } else { - if ((error = VOP_FSYNC(vp, cred, waitfor, td)) != 0) + if ((error = VOP_FSYNC(vp, waitfor, td)) != 0) allerror = error; VOP_UNLOCK(vp, 0, td); vrele(vp); @@ -1032,7 +1028,7 @@ loop: if (ump->um_mountp->mnt_flag & MNT_SOFTDEP) waitfor = MNT_NOWAIT; vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); - if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, td)) != 0) + if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) allerror = error; VOP_UNLOCK(ump->um_devvp, 0, td); } @@ -1142,7 +1138,7 @@ restart: /* Read in the disk contents for the inode, copy into the inode. */ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), - (int)fs->fs_bsize, NOCRED, &bp); + (int)fs->fs_bsize, &bp); if (error) { /* * The inode does not contain anything useful, so it would diff --git a/sys/vfs/ufs/ufs_quota.c b/sys/vfs/ufs/ufs_quota.c index 0846f37243..c8668ad7be 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.4 2003/06/26 02:17:47 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_quota.c,v 1.5 2003/06/26 05:55:21 dillon Exp $ */ #include @@ -410,7 +410,7 @@ quotaon(td, mp, type, fname) vp = nd.ni_vp; VOP_UNLOCK(vp, 0, td); if (vp->v_type != VREG) { - (void) vn_close(vp, FREAD|FWRITE, cred, td); + (void) vn_close(vp, FREAD|FWRITE, td); return (EACCES); } if (*vpp != vp) @@ -501,7 +501,7 @@ again: } dqflush(qvp); qvp->v_flag &= ~VSYSTEM; - error = vn_close(qvp, FREAD|FWRITE, cred, td); + error = vn_close(qvp, FREAD|FWRITE, td); 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 bd34547ceb..dec2b4ff96 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.3 2003/06/25 03:56:12 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.4 2003/06/26 05:55:21 dillon Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -256,7 +256,7 @@ READ(ap) /* * Don't do readahead if this is the end of the file. */ - error = bread(vp, lbn, size, NOCRED, &bp); + error = bread(vp, lbn, size, &bp); } else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { /* * Otherwise if we are allowed to cluster, @@ -266,7 +266,7 @@ READ(ap) * doing sequential access. */ error = cluster_read(vp, ip->i_size, lbn, - size, NOCRED, uio->uio_resid, seqcount, &bp); + size, uio->uio_resid, seqcount, &bp); } else if (seqcount > 1) { /* * If we are NOT allowed to cluster, then @@ -278,14 +278,14 @@ READ(ap) */ int nextsize = BLKSIZE(fs, ip, nextlbn); error = breadn(vp, lbn, - size, &nextlbn, &nextsize, 1, NOCRED, &bp); + size, &nextlbn, &nextsize, 1, &bp); } else { /* * Failing all of the above, just read what the * user asked for. Interestingly, the same as * the first option above. */ - error = bread(vp, lbn, size, NOCRED, &bp); + error = bread(vp, lbn, size, &bp); } if (error) { brelse(bp); diff --git a/sys/vfs/ufs/ufs_vnops.c b/sys/vfs/ufs/ufs_vnops.c index dd84297253..423b2234cd 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.4 2003/06/25 03:56:12 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.5 2003/06/26 05:55:21 dillon Exp $ */ #include "opt_quota.h" @@ -391,7 +391,6 @@ ufs_getattr(ap) struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; - struct ucred *a_cred; struct thread *a_td; } */ *ap; { diff --git a/sys/vfs/umapfs/umap_vfsops.c b/sys/vfs/umapfs/umap_vfsops.c index e9ad0fb0f0..180412e93d 100644 --- a/sys/vfs/umapfs/umap_vfsops.c +++ b/sys/vfs/umapfs/umap_vfsops.c @@ -36,7 +36,7 @@ * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/umapfs/umap_vfsops.c,v 1.31.2.2 2001/09/11 09:49:53 kris Exp $ - * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vfsops.c,v 1.4 2003/06/25 03:56:01 dillon Exp $ + * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vfsops.c,v 1.5 2003/06/26 05:55:16 dillon Exp $ */ /* @@ -70,7 +70,7 @@ static int umapfs_start __P((struct mount *mp, int flags, struct thread *td)); static int umapfs_statfs __P((struct mount *mp, struct statfs *sbp, struct thread *td)); static int umapfs_sync __P((struct mount *mp, int waitfor, - struct ucred *cred, struct thread *td)); + struct thread *td)); static int umapfs_unmount __P((struct mount *mp, int mntflags, struct thread *td)); static int umapfs_vget __P((struct mount *mp, ino_t ino, @@ -356,7 +356,7 @@ umapfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) } static int -umapfs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct thread *td) +umapfs_sync(struct mount *mp, int waitfor, struct thread *td) { /* * XXX - Assumes no data cached at umap layer. diff --git a/sys/vfs/union/union_subr.c b/sys/vfs/union/union_subr.c index 89cfe8c339..9f15b0a60e 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.3 2003/06/25 03:56:01 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_subr.c,v 1.4 2003/06/26 05:55:16 dillon Exp $ */ #include @@ -770,11 +770,11 @@ union_copyup(un, docopy, cred, td) vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_OPEN(lvp, FREAD, cred, td); if (error == 0 && vn_canvmio(lvp) == TRUE) - error = vfs_object_create(lvp, td, cred); + error = vfs_object_create(lvp, td); if (error == 0) { error = union_copyfile(lvp, uvp, cred, td); VOP_UNLOCK(lvp, 0, td); - (void) VOP_CLOSE(lvp, FREAD, cred, td); + (void) VOP_CLOSE(lvp, FREAD, td); } if (error == 0) UDEBUG(("union: copied up %s\n", un->un_path)); @@ -797,12 +797,12 @@ union_copyup(un, docopy, cred, td) int i; for (i = 0; i < un->un_openl; i++) { - (void) VOP_CLOSE(lvp, FREAD, cred, td); + (void) VOP_CLOSE(lvp, FREAD, td); (void) VOP_OPEN(uvp, FREAD, cred, td); } if (un->un_openl) { if (vn_canvmio(uvp) == TRUE) - error = vfs_object_create(uvp, td, cred); + error = vfs_object_create(uvp, td); } un->un_openl = 0; } @@ -1107,7 +1107,7 @@ union_vn_create(vpp, un, td) error = VOP_OPEN(vp, fmode, cred, td); if (error == 0 && vn_canvmio(vp) == TRUE) - error = vfs_object_create(vp, td, cred); + error = vfs_object_create(vp, td); if (error) { vput(vp); return (error); @@ -1127,7 +1127,7 @@ union_vn_close(vp, fmode, cred, td) if (fmode & FWRITE) --vp->v_writecount; - return (VOP_CLOSE(vp, fmode, cred, td)); + return (VOP_CLOSE(vp, fmode, td)); } #if 0 @@ -1177,7 +1177,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, cred, td) == 0 && + if (VOP_GETATTR(un->un_uppervp, &va, td) == 0 && (va.va_flags & OPAQUE)) return (1); @@ -1318,7 +1318,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, fp->f_cred, td); + error = VOP_GETATTR(*vp, &va, td); if (va.va_flags & OPAQUE) { vput(lvp); lvp = NULL; @@ -1328,7 +1328,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) if (lvp != NULLVP) { error = VOP_OPEN(lvp, FREAD, fp->f_cred, td); if (error == 0 && vn_canvmio(lvp) == TRUE) - error = vfs_object_create(lvp, td, fp->f_cred); + error = vfs_object_create(lvp, td); if (error) { vput(lvp); return (error); @@ -1336,7 +1336,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) VOP_UNLOCK(lvp, 0, td); fp->f_data = (caddr_t) lvp; fp->f_offset = 0; - error = vn_close(*vp, FREAD, fp->f_cred, td); + error = vn_close(*vp, FREAD, td); if (error) return (error); *vp = lvp; diff --git a/sys/vfs/union/union_vnops.c b/sys/vfs/union/union_vnops.c index bb89cd76b2..4fcad046e8 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.3 2003/06/25 03:56:01 dillon Exp $ + * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.4 2003/06/26 05:55:16 dillon Exp $ */ #include @@ -403,8 +403,7 @@ union_lookup(ap) } else if (lowerdvp != NULLVP) { int terror; - terror = VOP_GETATTR(upperdvp, &va, - cnp->cn_cred, cnp->cn_td); + terror = VOP_GETATTR(upperdvp, &va, cnp->cn_td); if (terror == 0 && (va.va_flags & OPAQUE)) iswhiteout = 1; } @@ -773,7 +772,7 @@ union_open(ap) * Absolutely necessary or UFS will blowup */ if (error == 0 && vn_canvmio(tvp) == TRUE) { - error = vfs_object_create(tvp, td, cred); + error = vfs_object_create(tvp, td); } /* @@ -934,7 +933,7 @@ union_getattr(ap) vap = ap->a_vap; if ((vp = un->un_uppervp) != NULLVP) { - error = VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, vap, ap->a_td); if (error) return (error); /* XXX isn't this dangerouso without a lock? */ @@ -951,7 +950,7 @@ union_getattr(ap) } if (vp != NULLVP) { - error = VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, vap, ap->a_td); if (error) return (error); /* XXX isn't this dangerous without a lock? */ @@ -1237,7 +1236,7 @@ union_fsync(ap) struct union_node *un = VTOUNION(ap->a_vp); if ((targetvp = union_lock_other(un, td)) != NULLVP) { - error = VOP_FSYNC(targetvp, ap->a_cred, ap->a_waitfor, td); + error = VOP_FSYNC(targetvp, ap->a_waitfor, td); union_unlock_other(targetvp, td); } @@ -1799,10 +1798,12 @@ union_unlock(ap) struct thread *a_td; } */ *ap; { - struct union_node *un = VTOUNION(ap->a_vp); int error; +#if 0 + struct union_node *un = VTOUNION(ap->a_vp); KASSERT((un->un_uppervp == NULL || un->un_uppervp->v_usecount > 0), ("uppervp usecount is 0")); +#endif error = vop_stdunlock(ap); #if 0 diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 59f64a0b5a..90e6eae58b 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -65,7 +65,7 @@ * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 * * $FreeBSD: src/sys/vm/swap_pager.c,v 1.130.2.12 2002/08/31 21:15:55 dillon Exp $ - * $DragonFly: src/sys/vm/swap_pager.c,v 1.5 2003/06/26 02:17:47 dillon Exp $ + * $DragonFly: src/sys/vm/swap_pager.c,v 1.6 2003/06/26 05:55:21 dillon Exp $ */ #include @@ -1111,8 +1111,6 @@ swap_pager_getpages(object, m, count, reqpage) bp->b_flags = B_READ | B_CALL; bp->b_iodone = swp_pager_async_iodone; bp->b_data = (caddr_t) kva; - bp->b_rcred = crhold(proc0.p_ucred); - bp->b_wcred = crhold(proc0.p_ucred); bp->b_blkno = blk - (reqpage - i); bp->b_bcount = PAGE_SIZE * (j - i); bp->b_bufsize = PAGE_SIZE * (j - i); @@ -1363,9 +1361,6 @@ swap_pager_putpages(object, m, count, sync, rtvals) bp->b_bufsize = PAGE_SIZE * n; bp->b_blkno = blk; - bp->b_rcred = crhold(proc0.p_ucred); - bp->b_wcred = crhold(proc0.p_ucred); - pbgetvp(swapdev_vp, bp); for (j = 0; j < n; ++j) { diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 6d41ad1e21..6f143dbabd 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.4 2003/06/25 03:56:13 dillon Exp $ + * $DragonFly: src/sys/vm/vm_mmap.c,v 1.5 2003/06/26 05:55:21 dillon Exp $ */ /* @@ -356,8 +356,7 @@ mmap(struct mmap_args *uap) (vp->v_type == VCHR && disablexworkaround)) { if ((fp->f_flag & FWRITE) != 0) { struct vattr va; - if ((error = - VOP_GETATTR(vp, &va, p->p_ucred, td))) { + if ((error = VOP_GETATTR(vp, &va, td))) { goto done; } if ((va.va_flags & @@ -1032,7 +1031,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, p->p_ucred, td); + error = VOP_GETATTR(vp, &vat, td); if (error) return (error); objsize = round_page(vat.va_size); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 03a1090ab4..fc4b1a1fd8 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.3 2003/06/25 03:56:13 dillon Exp $ + * $DragonFly: src/sys/vm/vm_object.c,v 1.4 2003/06/26 05:55:21 dillon Exp $ */ /* @@ -447,7 +447,7 @@ vm_object_terminate(object) vm_object_page_clean(object, 0, 0, OBJPC_SYNC); vp = (struct vnode *) object->handle; - vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0); + vinvalbuf(vp, V_SAVE, NULL, 0, 0); } /* diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index aa5f076f08..61ca0d89e4 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -62,7 +62,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm_pager.c,v 1.54.2.2 2001/11/18 07:11:00 dillon Exp $ - * $DragonFly: src/sys/vm/vm_pager.c,v 1.4 2003/06/26 02:17:47 dillon Exp $ + * $DragonFly: src/sys/vm/vm_pager.c,v 1.5 2003/06/26 05:55:21 dillon Exp $ */ /* @@ -224,7 +224,6 @@ vm_pager_bufferinit() TAILQ_INSERT_HEAD(&bswlist, bp, b_freelist); BUF_LOCKINIT(bp); LIST_INIT(&bp->b_dep); - bp->b_rcred = bp->b_wcred = NOCRED; bp->b_xflags = 0; } @@ -345,8 +344,6 @@ vm_pager_object_lookup(pg_list, handle) static void initpbuf(struct buf *bp) { - bp->b_rcred = NOCRED; - bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_NONE; bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva; bp->b_kvabase = bp->b_data; @@ -449,15 +446,6 @@ relpbuf(bp, pfreecnt) s = splvm(); - if (bp->b_rcred != NOCRED) { - crfree(bp->b_rcred); - bp->b_rcred = NOCRED; - } - if (bp->b_wcred != NOCRED) { - crfree(bp->b_wcred); - bp->b_wcred = NOCRED; - } - if (bp->b_vp) pbrelvp(bp); @@ -554,9 +542,6 @@ getchainbuf(struct buf *bp, struct vnode *vp, int flags) nbp->b_flags = B_CALL | (bp->b_flags & B_ORDERED) | flags; nbp->b_iodone = vm_pager_chain_iodone; - nbp->b_rcred = crhold(proc0.p_ucred); - nbp->b_wcred = crhold(proc0.p_ucred); - if (vp) pbgetvp(vp, nbp); return(nbp); diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 003eae2812..d27c48f107 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.4 2003/06/25 03:56:13 dillon Exp $ + * $DragonFly: src/sys/vm/vm_swap.c,v 1.5 2003/06/26 05:55:21 dillon Exp $ */ #include "opt_swap.h" @@ -206,7 +206,7 @@ swapon(struct swapon_args *uap) if (vn_isdisk(vp, &error)) error = swaponvp(td, vp, vp->v_rdev, 0); else if (vp->v_type == VREG && vp->v_tag == VT_NFS && - (error = VOP_GETATTR(vp, &attr, cred, td)) == 0) { + (error = VOP_GETATTR(vp, &attr, td)) == 0) { /* * Allow direct swapping to NFS regular files in the same * way that nfs_mountroot() sets up diskless swapping. @@ -272,11 +272,11 @@ swaponvp(struct thread *td, struct vnode *vp, dev_t dev, u_long nblks) if (nblks == 0 && dev != NODEV && (devsw(dev)->d_psize == 0 || (nblks = (*devsw(dev)->d_psize) (dev)) == -1)) { - (void) VOP_CLOSE(vp, FREAD | FWRITE, cred, td); + (void) VOP_CLOSE(vp, FREAD | FWRITE, td); return (ENXIO); } if (nblks == 0) { - (void) VOP_CLOSE(vp, FREAD | FWRITE, cred, td); + (void) VOP_CLOSE(vp, FREAD | FWRITE, td); return (ENXIO); } @@ -287,7 +287,7 @@ swaponvp(struct thread *td, struct vnode *vp, dev_t dev, 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); - (void) VOP_CLOSE(vp, FREAD | FWRITE, cred, td); + (void) VOP_CLOSE(vp, FREAD | FWRITE, td); return (ENXIO); } /* diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 52458f5395..ec2876210f 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.4 2003/06/26 02:17:47 dillon Exp $ + * $DragonFly: src/sys/vm/vnode_pager.c,v 1.5 2003/06/26 05:55:21 dillon Exp $ */ /* @@ -459,8 +459,6 @@ vnode_pager_input_smlfs(object, m) /* build a minimal buffer header */ bp->b_flags = B_READ | B_CALL; bp->b_iodone = vnode_pager_iodone; - bp->b_rcred = crhold(curproc->p_ucred); - bp->b_wcred = crhold(curproc->p_ucred); bp->b_data = (caddr_t) kva + i * bsize; bp->b_blkno = fileaddr; pbgetvp(dp, bp); @@ -777,8 +775,6 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) bp->b_flags = B_READ | B_CALL; bp->b_iodone = vnode_pager_iodone; /* B_PHYS is not set, but it is nice to fill this in */ - bp->b_rcred = crhold(curproc->p_ucred); - bp->b_wcred = crhold(curproc->p_ucred); bp->b_blkno = firstaddr; pbgetvp(dp, bp); bp->b_bcount = size; -- 2.41.0