--- //depot/vendor/freebsd/src/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c 2008/03/28 22:20:20 +++ //depot/user/attilio/attilio_vfs/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c 2008/08/27 14:28:14 @@ -119,12 +119,11 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size) { struct vnode *vp = file->ptr; - struct thread *td = curthread; struct vattr va; int error; vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &va, td->td_ucred, td); + error = VOP_GETATTR(vp, &va, curthread->td_ucred); VOP_UNLOCK(vp, 0); if (error == 0) *size = (uint64_t)va.va_size; --- //depot/vendor/freebsd/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c 2008/03/27 20:36:23 +++ //depot/user/attilio/attilio_vfs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c 2008/08/27 14:28:14 @@ -85,7 +85,7 @@ * Determine the physical size of the file. */ vattr.va_mask = AT_SIZE; - error = VOP_GETATTR(vp, &vattr, 0, kcred); + error = VOP_GETATTR(vp, &vattr, 0); if (error) { vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (error); --- //depot/vendor/freebsd/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c 2008/03/27 20:36:23 +++ //depot/user/attilio/attilio_vfs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c 2008/08/27 14:28:14 @@ -358,7 +358,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -799,7 +798,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -924,10 +922,11 @@ } static int -zfsctl_traverse_begin(vnode_t **vpp, int lktype, kthread_t *td) +zfsctl_traverse_begin(vnode_t **vpp, int lktype) { VN_HOLD(*vpp); + /* Snapshot should be already mounted, but just in case. */ if (vn_mountedvfs(*vpp) == NULL) return (ENOENT); @@ -950,15 +949,14 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { vnode_t *vp = ap->a_vp; int err; - err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY, ap->a_td); + err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY); if (err == 0) - err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td); + err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred); zfsctl_traverse_end(vp, err); return (err); } @@ -973,7 +971,7 @@ vnode_t *vp = ap->a_vp; int err; - err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY, curthread); + err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY); if (err == 0) err = VOP_VPTOFH(vp, (void *)ap->a_fid); zfsctl_traverse_end(vp, err); --- //depot/vendor/freebsd/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c 2008/03/27 20:36:23 +++ //depot/user/attilio/attilio_vfs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c 2008/08/27 14:28:14 @@ -361,7 +361,7 @@ vp = ZTOV(zp); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_SETATTR(vp, &va, kcred, curthread); + error = VOP_SETATTR(vp, &va, kcred); VOP_UNLOCK(vp, 0); VN_RELE(vp); --- //depot/vendor/freebsd/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 2008/08/27 14:28:14 @@ -3336,7 +3336,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { @@ -3349,7 +3348,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { vattr_t *vap = ap->a_vap; --- //depot/vendor/freebsd/src/sys/compat/linprocfs/linprocfs.c 2008/08/25 05:00:28 +++ //depot/user/attilio/attilio_vfs/sys/compat/linprocfs/linprocfs.c 2008/08/27 14:32:39 @@ -937,7 +937,7 @@ vn_fullpath(td, vp, &name, &freename); locked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); - VOP_GETATTR(vp, &vat, td->td_ucred, td); + VOP_GETATTR(vp, &vat, td->td_ucred); ino = vat.va_fileid; vput(vp); VFS_UNLOCK_GIANT(locked); --- //depot/vendor/freebsd/src/sys/compat/linux/linux_getcwd.c 2008/01/10 01:16:12 +++ //depot/user/attilio/attilio_vfs/sys/compat/linux/linux_getcwd.c 2008/08/27 14:28:14 @@ -142,7 +142,7 @@ * current directory is still locked. */ if (bufp != NULL) { - error = VOP_GETATTR(lvp, &va, td->td_ucred, td); + error = VOP_GETATTR(lvp, &va, td->td_ucred); if (error) { vput(lvp); *lvpp = NULL; --- //depot/vendor/freebsd/src/sys/compat/linux/linux_misc.c 2008/08/17 23:30:17 +++ //depot/user/attilio/attilio_vfs/sys/compat/linux/linux_misc.c 2008/08/27 14:28:14 @@ -277,7 +277,7 @@ } /* Executable? */ - error = VOP_GETATTR(vp, &attr, td->td_ucred, td); + error = VOP_GETATTR(vp, &attr, td->td_ucred); if (error) goto cleanup; --- //depot/vendor/freebsd/src/sys/compat/ndis/subr_ndis.c 2008/06/11 08:00:22 +++ //depot/user/attilio/attilio_vfs/sys/compat/ndis/subr_ndis.c 2008/08/27 14:28:14 @@ -2973,7 +2973,7 @@ NDFREE(&nd, NDF_ONLY_PNBUF); /* Get the file size. */ - VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td); + VOP_GETATTR(nd.ni_vp, vap, td->td_ucred); VOP_UNLOCK(nd.ni_vp, 0); VFS_UNLOCK_GIANT(vfslocked); --- //depot/vendor/freebsd/src/sys/compat/svr4/svr4_fcntl.c 2008/03/26 15:25:17 +++ //depot/user/attilio/attilio_vfs/sys/compat/svr4/svr4_fcntl.c 2008/08/27 14:28:14 @@ -279,7 +279,7 @@ goto out; #endif - if ((error = VOP_GETATTR(vp, &vattr, td->td_ucred, td)) != 0) + if ((error = VOP_GETATTR(vp, &vattr, td->td_ucred)) != 0) goto out; if (td->td_ucred->cr_uid != vattr.va_uid && @@ -325,7 +325,7 @@ return ESPIPE; } - if ((error = VOP_GETATTR(vp, &vattr, td->td_ucred, td)) != 0) { + if ((error = VOP_GETATTR(vp, &vattr, td->td_ucred)) != 0) { fdrop(fp, td); return error; } --- //depot/vendor/freebsd/src/sys/dev/md/md.c 2008/05/29 12:56:24 +++ //depot/user/attilio/attilio_vfs/sys/dev/md/md.c 2008/08/27 14:28:14 @@ -928,7 +928,7 @@ vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp->v_type != VREG || - (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) { + (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred))) { VOP_UNLOCK(nd.ni_vp, 0); (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); VFS_UNLOCK_GIANT(vfslocked); --- //depot/vendor/freebsd/src/sys/dev/xen/blkback/blkback.c 2008/08/12 20:05:14 +++ //depot/user/attilio/attilio_vfs/sys/dev/xen/blkback/blkback.c 2008/08/27 14:28:14 @@ -1100,7 +1100,7 @@ blkif->csw = dev_refthread(blkif->cdev); PANIC_IF(blkif->csw == NULL); - err = VOP_GETATTR(blkif->vn, &vattr, NOCRED, curthread); + err = VOP_GETATTR(blkif->vn, &vattr, NOCRED); if (err) { xenbus_dev_fatal(blkif->xdev, err, "error getting vnode attributes for device %s", blkif->dev_name); --- //depot/vendor/freebsd/src/sys/fs/cd9660/cd9660_vnops.c 2008/06/11 12:50:14 +++ //depot/user/attilio/attilio_vfs/sys/fs/cd9660/cd9660_vnops.c 2008/08/27 14:28:14 @@ -86,7 +86,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -182,7 +181,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { @@ -217,7 +215,7 @@ auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = ap->a_td; + auio.uio_td = curthread; auio.uio_resid = MAXPATHLEN; rdlnk.a_uio = &auio; rdlnk.a_vp = ap->a_vp; --- //depot/vendor/freebsd/src/sys/fs/coda/coda_venus.c 2008/02/10 11:20:20 +++ //depot/user/attilio/attilio_vfs/sys/fs/coda/coda_venus.c 2008/08/27 14:28:14 @@ -304,15 +304,16 @@ } int -venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p, - /*out*/ struct vattr *vap) +venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct vattr *vap) { + struct proc *p; DECL(coda_getattr); /* sets Isize & Osize */ ALLOC(coda_getattr); /* sets inp & outp */ /* * Send the open to venus. */ + p = curthread->td_proc; INIT_IN(&inp->ih, CODA_GETATTR, cred, p); inp->Fid = *fid; @@ -325,15 +326,16 @@ } int -venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred, - struct proc *p) +venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred) { + struct proc *p; DECL_NO_OUT(coda_setattr); /* sets Isize & Osize */ ALLOC_NO_OUT(coda_setattr); /* sets inp & outp */ /* * Send the open to venus. */ + p = curthread->td_proc; INIT_IN(&inp->ih, CODA_SETATTR, cred, p); inp->Fid = *fid; CNV_V2VV_ATTR(&inp->attr, vap); --- //depot/vendor/freebsd/src/sys/fs/coda/coda_venus.h 2008/02/10 11:20:20 +++ //depot/user/attilio/attilio_vfs/sys/fs/coda/coda_venus.h 2008/08/27 14:28:14 @@ -44,9 +44,9 @@ int venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data, struct ucred *cred, struct proc *p); int venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, - struct proc *p, /*out*/ struct vattr *vap); + struct vattr *vap); int venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, - struct ucred *cred, struct proc *p); + struct ucred *cred); int venus_access(void *mdp, CodaFid *fid, int mode, struct ucred *cred, struct proc *p); int venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred, --- //depot/vendor/freebsd/src/sys/fs/coda/coda_vnops.c 2008/02/15 12:02:32 +++ //depot/user/attilio/attilio_vfs/sys/fs/coda/coda_vnops.c 2008/08/27 14:28:14 @@ -382,7 +382,7 @@ */ { struct vattr attr; - if (VOP_GETATTR(cfvp, &attr, cred, td) == 0) + if (VOP_GETATTR(cfvp, &attr, cred) == 0) vnode_pager_setsize(vp, attr.va_size); } } @@ -504,7 +504,6 @@ struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; /* locals */ struct vnode *convp; int error, size; @@ -533,7 +532,7 @@ MARK_INT_SAT(CODA_GETATTR_STATS); return (0); } - error = venus_getattr(vtomi(vp), &cp->c_fid, cred, td->td_proc, vap); + error = venus_getattr(vtomi(vp), &cp->c_fid, cred, vap); if (!error) { CODADEBUG(CODA_GETATTR, myprintf(("getattr miss %s: result " "%d\n", coda_f2s(&cp->c_fid), error));); @@ -568,7 +567,6 @@ struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; /* locals */ struct vnode *convp; int error, size; @@ -584,7 +582,7 @@ } if (codadebug & CODADBGMSK(CODA_SETATTR)) coda_print_vattr(vap); - error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, td->td_proc); + error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred); if (!error) cp->c_flags &= ~(C_VATTR | C_ACCCACHE); --- //depot/vendor/freebsd/src/sys/fs/devfs/devfs_vnops.c 2008/08/20 08:40:16 +++ //depot/user/attilio/attilio_vfs/sys/fs/devfs/devfs_vnops.c 2008/08/27 14:28:14 @@ -1227,12 +1227,14 @@ struct devfs_dirent *de; struct vattr *vap; struct vnode *vp; + struct thread *td; int c, error; uid_t uid; gid_t gid; vap = ap->a_vap; vp = ap->a_vp; + td = curthread; if ((vap->va_type != VNON) || (vap->va_nlink != VNOVAL) || (vap->va_fsid != VNOVAL) || @@ -1261,7 +1263,7 @@ if (uid != de->de_uid || gid != de->de_gid) { if ((ap->a_cred->cr_uid != de->de_uid) || uid != de->de_uid || (gid != de->de_gid && !groupmember(gid, ap->a_cred))) { - error = priv_check(ap->a_td, PRIV_VFS_CHOWN); + error = priv_check(td, PRIV_VFS_CHOWN); if (error) return (error); } @@ -1272,7 +1274,7 @@ if (vap->va_mode != (mode_t)VNOVAL) { if (ap->a_cred->cr_uid != de->de_uid) { - error = priv_check(ap->a_td, PRIV_VFS_ADMIN); + error = priv_check(td, PRIV_VFS_ADMIN); if (error) return (error); } @@ -1282,9 +1284,9 @@ if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { /* See the comment in ufs_vnops::ufs_setattr(). */ - if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td)) && + if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td)))) + (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) { if (vp->v_type == VCHR) --- //depot/vendor/freebsd/src/sys/fs/fdescfs/fdesc_vnops.c 2008/05/24 14:57:09 +++ //depot/user/attilio/attilio_vfs/sys/fs/fdescfs/fdesc_vnops.c 2008/08/27 14:28:14 @@ -379,11 +379,11 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; + struct thread *td = curthread; struct file *fp; struct stat stb; u_int fd; @@ -414,12 +414,12 @@ case Fdesc: fd = VTOFDESC(vp)->fd_fd; - if ((error = fget(ap->a_td, fd, &fp)) != 0) + if ((error = fget(td, fd, &fp)) != 0) return (error); bzero(&stb, sizeof(stb)); - error = fo_stat(fp, &stb, ap->a_td->td_ucred, ap->a_td); - fdrop(fp, ap->a_td); + error = fo_stat(fp, &stb, td->td_ucred, td); + fdrop(fp, td); if (error == 0) { VATTR_NULL(vap); vap->va_type = IFTOVT(stb.st_mode); @@ -475,13 +475,13 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vattr *vap = ap->a_vap; struct vnode *vp; struct mount *mp; struct file *fp; + struct thread *td = curthread; unsigned fd; int error; @@ -496,7 +496,7 @@ /* * Allow setattr where there is an underlying vnode. */ - error = getvnode(ap->a_td->td_proc->p_fd, fd, &fp); + error = getvnode(td->td_proc->p_fd, fd, &fp); if (error) { /* * getvnode() returns EINVAL if the file descriptor is not @@ -514,11 +514,11 @@ vp = fp->f_vnode; if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) == 0) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td); + error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); } - fdrop(fp, ap->a_td); + fdrop(fp, td); return (error); } --- //depot/vendor/freebsd/src/sys/fs/hpfs/hpfs_vnops.c 2008/01/13 14:45:30 +++ //depot/user/attilio/attilio_vfs/sys/fs/hpfs/hpfs_vnops.c 2008/08/27 14:28:14 @@ -409,7 +409,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -457,14 +456,13 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct hpfsnode *hp = VTOHP(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; int error; dprintf(("hpfs_setattr(0x%x):\n", hp->h_no)); --- //depot/vendor/freebsd/src/sys/fs/msdosfs/msdosfs_vnops.c 2008/07/04 09:45:13 +++ //depot/user/attilio/attilio_vfs/sys/fs/msdosfs/msdosfs_vnops.c 2008/08/27 14:28:14 @@ -289,7 +289,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct denode *dep = VTODE(ap->a_vp); @@ -366,7 +365,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -374,11 +372,12 @@ struct msdosfsmount *pmp = dep->de_pmp; struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; + struct thread *td = curthread; int error = 0; #ifdef MSDOSFS_DEBUG - printf("msdosfs_setattr(): vp %p, vap %p, cred %p, p %p\n", - ap->a_vp, vap, cred, ap->a_td); + printf("msdosfs_setattr(): vp %p, vap %p, cred %p\n", + ap->a_vp, vap, cred); #endif /* @@ -480,7 +479,7 @@ */ break; } - error = detrunc(dep, vap->va_size, 0, cred, ap->a_td); + error = detrunc(dep, vap->va_size, 0, cred, td); if (error) return error; } @@ -488,12 +487,11 @@ if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (vap->va_vaflags & VA_UTIMES_NULL) { - error = VOP_ACCESS(vp, VADMIN, cred, ap->a_td); + error = VOP_ACCESS(vp, VADMIN, cred, td); if (error) - error = VOP_ACCESS(vp, VWRITE, cred, - ap->a_td); + error = VOP_ACCESS(vp, VWRITE, cred, td); } else - error = VOP_ACCESS(vp, VADMIN, cred, ap->a_td); + error = VOP_ACCESS(vp, VADMIN, cred, td); if (vp->v_type != VDIR) { if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && vap->va_atime.tv_sec != VNOVAL) { --- //depot/vendor/freebsd/src/sys/fs/nwfs/nwfs_io.c 2007/06/01 14:37:18 +++ //depot/user/attilio/attilio_vfs/sys/fs/nwfs/nwfs_io.c 2008/08/27 14:28:14 @@ -178,11 +178,11 @@ 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, cred); 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, cred); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { error = nwfs_vinvalbuf(vp, td); @@ -228,7 +228,7 @@ * the correct size. */ #ifdef notyet nwfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); #endif uiop->uio_offset = np->n_size; --- //depot/vendor/freebsd/src/sys/fs/nwfs/nwfs_vnops.c 2008/01/13 14:45:30 +++ //depot/user/attilio/attilio_vfs/sys/fs/nwfs/nwfs_vnops.c 2008/08/27 14:28:14 @@ -175,11 +175,11 @@ if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == 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_cred); 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_cred); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR) @@ -262,13 +262,13 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *td; } */ *ap; { struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); struct vattr *va=ap->a_vap; struct nwmount *nmp = VTONWFS(vp); + struct thread *td = curthread; struct nw_entry_info fattr; int error; u_int32_t oldsize; @@ -280,10 +280,10 @@ 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); + td, ap->a_cred); } 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, td, ap->a_cred); } if (error) { NCPVNDEBUG("error %d\n", error); @@ -304,7 +304,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -342,13 +341,13 @@ return EINVAL; }; } - error = ncp_setattr(vp, vap, ap->a_cred, ap->a_td); + error = ncp_setattr(vp, vap, ap->a_cred, curthread); if (error && vap->va_size != VNOVAL) { np->n_size = tsize; vnode_pager_setsize(vp, (u_long)tsize); } np->n_atime = 0; /* invalidate cache */ - VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td); + VOP_GETATTR(vp, vap, ap->a_cred); np->n_mtime = vap->va_mtime.tv_sec; return (0); } @@ -428,9 +427,8 @@ *vpp = NULL; if (vap->va_type == VSOCK) return (EOPNOTSUPP); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) return (error); - } fmode = AR_READ | AR_WRITE; /* if (vap->va_vaflags & VA_EXCLUSIVE) fmode |= AR_DENY_READ | AR_DENY_WRITE;*/ @@ -636,9 +634,8 @@ struct vattr vattr; char *name=cnp->cn_nameptr; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) return (error); - } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) { return EEXIST; } @@ -875,7 +872,7 @@ struct vattr vattr; vp = *vpp; - if (VOP_GETATTR(vp, &vattr, cnp->cn_cred, td) == 0 && + if (!VOP_GETATTR(vp, &vattr, cnp->cn_cred) && vattr.va_ctime.tv_sec == VTONW(vp)->n_ctime) { if (nameiop != LOOKUP && islastcn) cnp->cn_flags |= SAVENAME; --- //depot/vendor/freebsd/src/sys/fs/portalfs/portal_vnops.c 2008/01/10 01:16:12 +++ //depot/user/attilio/attilio_vfs/sys/fs/portalfs/portal_vnops.c 2008/08/27 14:28:14 @@ -447,7 +447,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -492,7 +491,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { --- //depot/vendor/freebsd/src/sys/fs/pseudofs/pseudofs_vnops.c 2008/01/13 14:45:30 +++ //depot/user/attilio/attilio_vfs/sys/fs/pseudofs/pseudofs_vnops.c 2008/08/27 14:28:14 @@ -128,7 +128,7 @@ PFS_TRACE(("%s", pvd->pvd_pn->pn_name)); (void)pvd; - error = VOP_GETATTR(vn, &vattr, va->a_cred, va->a_td); + error = VOP_GETATTR(vn, &vattr, va->a_cred); if (error) PFS_RETURN (error); error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid, @@ -227,7 +227,7 @@ vap->va_uid = proc->p_ucred->cr_ruid; vap->va_gid = proc->p_ucred->cr_rgid; if (pn->pn_attr != NULL) - error = pn_attr(va->a_td, proc, pn, vap); + error = pn_attr(curthread, proc, pn, vap); PROC_UNLOCK(proc); } else { vap->va_uid = 0; --- //depot/vendor/freebsd/src/sys/fs/smbfs/smbfs_io.c 2008/02/25 18:50:26 +++ //depot/user/attilio/attilio_vfs/sys/fs/smbfs/smbfs_io.c 2008/08/27 14:28:14 @@ -215,12 +215,12 @@ /* 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, cred); 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, cred); if (error) return error; if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) { @@ -269,7 +269,7 @@ * File size can be changed by another client */ smbfs_attr_cacheremove(vp); - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); #endif uiop->uio_offset = np->n_size; --- //depot/vendor/freebsd/src/sys/fs/smbfs/smbfs_node.c 2008/07/01 07:55:14 +++ //depot/user/attilio/attilio_vfs/sys/fs/smbfs/smbfs_node.c 2008/08/27 14:28:14 @@ -205,7 +205,7 @@ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0) goto retry; /* Force cached attributes to be refreshed if stale. */ - (void)VOP_GETATTR(vp, &vattr, td->td_ucred, td); + (void)VOP_GETATTR(vp, &vattr, td->td_ucred); /* * If the file type on the server is inconsistent with * what it was when we created the vnode, kill the @@ -366,7 +366,7 @@ smb_makescred(&scred, td, cred); smbfs_vinvalbuf(vp, td); if (vp->v_type == VREG) { - VOP_GETATTR(vp, &va, cred, td); + VOP_GETATTR(vp, &va, cred); smbfs_smb_close(np->n_mount->sm_share, np->n_fid, &np->n_mtime, &scred); } else if (vp->v_type == VDIR) { --- //depot/vendor/freebsd/src/sys/fs/smbfs/smbfs_vnops.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/fs/smbfs/smbfs_vnops.c 2008/08/27 14:28:14 @@ -177,12 +177,12 @@ if ((error = smbfs_vinvalbuf(vp, ap->a_td)) == 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_cred); 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_cred); if (error) return error; if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) { @@ -254,7 +254,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -270,7 +269,7 @@ if (!error) return 0; SMBVDEBUG("not in the cache\n"); - smb_makescred(&scred, ap->a_td, ap->a_cred); + smb_makescred(&scred, curthread, ap->a_cred); oldsize = np->n_size; error = smbfs_smb_lookup(np, NULL, 0, &fattr, &scred); if (error) { @@ -290,7 +289,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -300,6 +298,7 @@ struct smb_cred scred; struct smb_share *ssp = np->n_mount->sm_share; struct smb_vc *vcp = SSTOVC(ssp); + struct thread *td = curthread; u_quad_t tsize = 0; int isreadonly, doclose, error = 0; int old_n_dosattr; @@ -315,7 +314,7 @@ vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) && isreadonly) return EROFS; - smb_makescred(&scred, ap->a_td, ap->a_cred); + smb_makescred(&scred, td, ap->a_cred); if (vap->va_size != VNOVAL) { switch (vp->v_type) { case VDIR: @@ -367,12 +366,11 @@ atime = &vap->va_atime; if (mtime != atime) { if (vap->va_vaflags & VA_UTIMES_NULL) { - error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td); + error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td); if (error) - error = VOP_ACCESS(vp, VWRITE, ap->a_cred, - ap->a_td); + error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td); } else - error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td); + error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td); #if 0 if (mtime == NULL) mtime = &np->n_mtime; @@ -385,13 +383,15 @@ */ if ((np->n_flag & NOPEN) == 0) { if (vcp->vc_flags & SMBV_WIN95) { - error = VOP_OPEN(vp, FWRITE, ap->a_cred, ap->a_td, NULL); + error = VOP_OPEN(vp, FWRITE, ap->a_cred, td, + NULL); if (!error) { -/* error = smbfs_smb_setfattrNT(np, 0, mtime, atime, &scred); - VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);*/ - if (mtime) - np->n_mtime = *mtime; - VOP_CLOSE(vp, FWRITE, ap->a_cred, ap->a_td); +/* error = smbfs_smb_setfattrNT(np, 0, + mtime, atime, &scred); + VOP_GETATTR(vp, &vattr, ap->a_cred); */ + if (mtime) + np->n_mtime = *mtime; + VOP_CLOSE(vp, FWRITE, ap->a_cred, td); } } else if ((vcp->vc_sopt.sv_caps & SMB_CAP_NT_SMBS)) { error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred); @@ -421,7 +421,7 @@ * required attributes. */ smbfs_attr_cacheremove(vp); /* invalidate cache */ - VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td); + VOP_GETATTR(vp, vap, ap->a_cred); np->n_mtime.tv_sec = vap->va_mtime.tv_sec; return error; } @@ -497,7 +497,7 @@ *vpp = NULL; if (vap->va_type != VREG) return EOPNOTSUPP; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) return error; smb_makescred(&scred, cnp->cn_thread, cnp->cn_cred); @@ -696,7 +696,7 @@ int len = cnp->cn_namelen; int error; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) { return error; } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) @@ -906,7 +906,7 @@ error = VOP_ACCESS(vp, VREAD, cred, td); if (error) return error; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) return error; if (strcmp(name, "dosattr") == 0) { @@ -1147,7 +1147,7 @@ killit = 0; vp = *vpp; - error = VOP_GETATTR(vp, &vattr, cnp->cn_cred, td); + error = VOP_GETATTR(vp, &vattr, cnp->cn_cred); /* * If the file type on the server is inconsistent * with what it was when we created the vnode, --- //depot/vendor/freebsd/src/sys/fs/tmpfs/tmpfs_vfsops.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/fs/tmpfs/tmpfs_vfsops.c 2008/08/27 14:28:14 @@ -217,7 +217,7 @@ "feature in FreeBSD.\n"); vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred, td); + error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); VOP_UNLOCK(mp->mnt_vnodecovered, 0); if (error) return (error); --- //depot/vendor/freebsd/src/sys/fs/tmpfs/tmpfs_vnops.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/fs/tmpfs/tmpfs_vnops.c 2008/08/27 14:28:14 @@ -390,7 +390,7 @@ struct vnode *vp = v->a_vp; struct vattr *vap = v->a_vap; struct ucred *cred = v->a_cred; - struct thread *l = v->a_td; + struct thread *td = curthread; int error; @@ -410,17 +410,16 @@ error = EINVAL; if (error == 0 && (vap->va_flags != VNOVAL)) - error = tmpfs_chflags(vp, vap->va_flags, cred, l); + error = tmpfs_chflags(vp, vap->va_flags, cred, td); if (error == 0 && (vap->va_size != VNOVAL)) - error = tmpfs_chsize(vp, vap->va_size, cred, l); + error = tmpfs_chsize(vp, vap->va_size, cred, td); if (error == 0 && (vap->va_uid != VNOVAL || vap->va_gid != VNOVAL)) - error = tmpfs_chown(vp, vap->va_uid, vap->va_gid, cred, - l); + error = tmpfs_chown(vp, vap->va_uid, vap->va_gid, cred, td); if (error == 0 && (vap->va_mode != (mode_t)VNOVAL)) - error = tmpfs_chmod(vp, vap->va_mode, cred, l); + error = tmpfs_chmod(vp, vap->va_mode, cred, td); if (error == 0 && ((vap->va_atime.tv_sec != VNOVAL && vap->va_atime.tv_nsec != VNOVAL) || @@ -429,7 +428,7 @@ (vap->va_birthtime.tv_sec != VNOVAL && vap->va_birthtime.tv_nsec != VNOVAL))) error = tmpfs_chtimes(vp, &vap->va_atime, &vap->va_mtime, - &vap->va_birthtime, vap->va_vaflags, cred, l); + &vap->va_birthtime, vap->va_vaflags, cred, td); /* Update the node times. We give preference to the error codes * generated by this function rather than the ones that may arise --- //depot/vendor/freebsd/src/sys/fs/unionfs/union_subr.c 2008/05/07 05:35:17 +++ //depot/user/attilio/attilio_vfs/sys/fs/unionfs/union_subr.c 2008/08/27 14:28:14 @@ -523,7 +523,7 @@ int error; struct vattr lva; - if ((error = VOP_GETATTR(lvp, &lva, cred, td))) + if ((error = VOP_GETATTR(lvp, &lva, cred))) return (error); unionfs_create_uppervattr_core(ump, &lva, uva, td); @@ -802,7 +802,7 @@ memset(&cn, 0, sizeof(cn)); - if ((error = VOP_GETATTR(lvp, &lva, cnp->cn_cred, td))) + if ((error = VOP_GETATTR(lvp, &lva, cnp->cn_cred))) goto unionfs_mkshadowdir_abort; if ((error = unionfs_relookup(udvp, &uvp, cnp, &cn, td, cnp->cn_nameptr, cnp->cn_namelen, CREATE))) @@ -835,7 +835,7 @@ * Ignore errors. */ va.va_type = VNON; - VOP_SETATTR(uvp, &va, cn.cn_cred, td); + VOP_SETATTR(uvp, &va, cn.cn_cred); } vn_finished_write(mp); @@ -931,7 +931,7 @@ fmode = FFLAGS(O_WRONLY | O_CREAT | O_TRUNC | O_EXCL); error = 0; - if ((error = VOP_GETATTR(lvp, &lva, cred, td)) != 0) + if ((error = VOP_GETATTR(lvp, &lva, cred)) != 0) return (error); unionfs_create_uppervattr_core(ump, &lva, uvap, td); @@ -1119,7 +1119,7 @@ if (error == 0) { /* Reset the attributes. Ignore errors. */ uva.va_type = VNON; - VOP_SETATTR(uvp, &uva, cred, td); + VOP_SETATTR(uvp, &uva, cred); } unionfs_node_update(unp, uvp, td); @@ -1160,7 +1160,7 @@ lvp = UNIONFSVPTOLOWERVP(vp); /* check opaque */ - if ((error = VOP_GETATTR(uvp, &va, cred, td)) != 0) + if ((error = VOP_GETATTR(uvp, &va, cred)) != 0) return (error); if (va.va_flags & OPAQUE) return (0); --- //depot/vendor/freebsd/src/sys/fs/unionfs/union_vfsops.c 2008/03/31 12:06:01 +++ //depot/user/attilio/attilio_vfs/sys/fs/unionfs/union_vfsops.c 2008/08/27 14:28:14 @@ -192,7 +192,7 @@ ufile = udir; vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred, td); + error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); if (!error) { if (udir == 0) udir = va.va_mode; --- //depot/vendor/freebsd/src/sys/fs/unionfs/union_vnops.c 2008/04/25 11:44:57 +++ //depot/user/attilio/attilio_vfs/sys/fs/unionfs/union_vnops.c 2008/08/27 14:28:14 @@ -206,7 +206,7 @@ if (cnp->cn_flags & ISWHITEOUT) iswhiteout = 1; /* don't lookup lower */ if (iswhiteout == 0 && ldvp != NULLVP) - if (VOP_GETATTR(udvp, &va, cnp->cn_cred, td) == 0 && + if (!VOP_GETATTR(udvp, &va, cnp->cn_cred) && (va.va_flags & OPAQUE)) iswhiteout = 1; /* don't lookup lower */ #if 0 @@ -731,10 +731,10 @@ ump = MOUNTTOUNIONFSMOUNT(ap->a_vp->v_mount); uvp = unp->un_uppervp; lvp = unp->un_lowervp; - td = ap->a_td; + td = curthread; if (uvp != NULLVP) { - if ((error = VOP_GETATTR(uvp, ap->a_vap, ap->a_cred, td)) == 0) + if ((error = VOP_GETATTR(uvp, ap->a_vap, ap->a_cred)) == 0) ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0]; UNIONFS_INTERNAL_DEBUG("unionfs_getattr: leave mode=%o, uid=%d, gid=%d (%d)\n", @@ -744,7 +744,7 @@ return (error); } - error = VOP_GETATTR(lvp, ap->a_vap, ap->a_cred, td); + error = VOP_GETATTR(lvp, ap->a_vap, ap->a_cred); if (error == 0 && !(ump->um_uppervp->v_mount->mnt_flag & MNT_RDONLY)) { /* correct the attr toward shadow file/dir. */ @@ -781,7 +781,7 @@ unp = VTOUNIONFS(ap->a_vp); uvp = unp->un_uppervp; lvp = unp->un_lowervp; - td = ap->a_td; + td = curthread; vap = ap->a_vap; if ((ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) && @@ -799,7 +799,7 @@ } if (uvp != NULLVP) - error = VOP_SETATTR(uvp, vap, ap->a_cred, td); + error = VOP_SETATTR(uvp, vap, ap->a_cred); UNIONFS_INTERNAL_DEBUG("unionfs_setattr: leave (%d)\n", error); @@ -1264,7 +1264,7 @@ if (udvp != NULLVP) { /* check opaque */ if (!(cnp->cn_flags & ISWHITEOUT)) { - error = VOP_GETATTR(udvp, &va, cnp->cn_cred, td); + error = VOP_GETATTR(udvp, &va, cnp->cn_cred); if (error != 0) return (error); if (va.va_flags & OPAQUE) @@ -1412,7 +1412,7 @@ /* check opaque */ if (uvp != NULLVP && lvp != NULLVP) { - if ((error = VOP_GETATTR(uvp, &va, ap->a_cred, td)) != 0) + if ((error = VOP_GETATTR(uvp, &va, ap->a_cred)) != 0) goto unionfs_readdir_exit; if (va.va_flags & OPAQUE) lvp = NULLVP; --- //depot/vendor/freebsd/src/sys/gnu/fs/ext2fs/ext2_vnops.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/gnu/fs/ext2fs/ext2_vnops.c 2008/08/27 14:28:14 @@ -335,7 +335,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -378,14 +377,13 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vattr *vap = ap->a_vap; struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; int error; /* --- //depot/vendor/freebsd/src/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c 2008/08/27 14:28:14 @@ -230,7 +230,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap) { struct vnode *vp = ap->a_vp; @@ -293,7 +292,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap) { struct vnode *vp = ap->a_vp; --- //depot/vendor/freebsd/src/sys/i386/ibcs2/imgact_coff.c 2008/03/12 10:16:51 +++ //depot/user/attilio/attilio_vfs/sys/i386/ibcs2/imgact_coff.c 2008/08/27 14:28:14 @@ -188,7 +188,7 @@ goto fail; } - if ((error = VOP_GETATTR(vp, &attr, td->td_ucred, td)) != 0) + if ((error = VOP_GETATTR(vp, &attr, td->td_ucred)) != 0) goto fail; if ((vp->v_mount->mnt_flag & MNT_NOEXEC) --- //depot/vendor/freebsd/src/sys/kern/imgact_shell.c 2008/08/26 11:00:22 +++ //depot/user/attilio/attilio_vfs/sys/kern/imgact_shell.c 2008/08/27 14:32:39 @@ -121,7 +121,7 @@ * valid -- the actual file might be much shorter than the page. * So find out the file size. */ - error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred, curthread); + error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred); if (error) return (error); --- //depot/vendor/freebsd/src/sys/kern/kern_exec.c 2008/08/25 13:55:13 +++ //depot/user/attilio/attilio_vfs/sys/kern/kern_exec.c 2008/08/27 14:32:39 @@ -797,7 +797,7 @@ exec_setregs(td, imgp->entry_addr, (u_long)(uintptr_t)stack_base, imgp->ps_strings); - vfs_mark_atime(imgp->vp, td); + vfs_mark_atime(imgp->vp, td->td_ucred); done1: @@ -1287,7 +1287,7 @@ td = curthread; /* Get file attributes */ - error = VOP_GETATTR(vp, attr, td->td_ucred, td); + error = VOP_GETATTR(vp, attr, td->td_ucred); if (error) return (error); --- //depot/vendor/freebsd/src/sys/kern/kern_linker.c 2008/05/23 07:10:15 +++ //depot/user/attilio/attilio_vfs/sys/kern/kern_linker.c 2008/08/27 14:28:14 @@ -1638,7 +1638,7 @@ NDFREE(&nd, NDF_ONLY_PNBUF); type = nd.ni_vp->v_type; if (vap) - VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td); + VOP_GETATTR(nd.ni_vp, vap, td->td_ucred); VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, td->td_ucred, td); VFS_UNLOCK_GIANT(vfslocked); @@ -1691,7 +1691,7 @@ if (nd.ni_vp->v_type != VREG) goto bad; best = cp = NULL; - error = VOP_GETATTR(nd.ni_vp, &vattr, cred, td); + error = VOP_GETATTR(nd.ni_vp, &vattr, cred); if (error) goto bad; /* --- //depot/vendor/freebsd/src/sys/kern/kern_sig.c 2008/08/05 20:05:14 +++ //depot/user/attilio/attilio_vfs/sys/kern/kern_sig.c 2008/08/27 14:28:14 @@ -2962,7 +2962,7 @@ /* 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, cred) || vattr.va_nlink != 1) { VOP_UNLOCK(vp, 0); error = EFAULT; goto close; @@ -2993,7 +2993,7 @@ vattr.va_flags = UF_NODUMP; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VOP_LEASE(vp, td, cred, LEASE_WRITE); - VOP_SETATTR(vp, &vattr, cred, td); + VOP_SETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); PROC_LOCK(p); --- //depot/vendor/freebsd/src/sys/kern/uipc_mqueue.c 2008/03/29 23:31:38 +++ //depot/user/attilio/attilio_vfs/sys/kern/uipc_mqueue.c 2008/08/27 14:28:14 @@ -1100,7 +1100,7 @@ struct vattr vattr; int error; - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) return (error); error = vaccess(vp->v_type, vattr.va_mode, vattr.va_uid, @@ -1114,7 +1114,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; }; #endif @@ -1159,7 +1158,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; }; #endif /* @@ -1171,10 +1169,12 @@ struct mqfs_node *pn; struct vattr *vap; struct vnode *vp; + struct thread *td; int c, error; uid_t uid; gid_t gid; + td = curthread; vap = ap->a_vap; vp = ap->a_vp; if ((vap->va_type != VNON) || @@ -1206,7 +1206,7 @@ * To modify the ownership of a file, must possess VADMIN * for that file. */ - if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td))) + if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td))) return (error); /* @@ -1216,7 +1216,7 @@ */ if (((ap->a_cred->cr_uid != pn->mn_uid) || uid != pn->mn_uid || (gid != pn->mn_gid && !groupmember(gid, ap->a_cred))) && - (error = priv_check(ap->a_td, PRIV_MQ_ADMIN)) != 0) + (error = priv_check(td, PRIV_MQ_ADMIN)) != 0) return (error); pn->mn_uid = uid; pn->mn_gid = gid; @@ -1225,7 +1225,7 @@ if (vap->va_mode != (mode_t)VNOVAL) { if ((ap->a_cred->cr_uid != pn->mn_uid) && - (error = priv_check(ap->a_td, PRIV_MQ_ADMIN))) + (error = priv_check(td, PRIV_MQ_ADMIN))) return (error); pn->mn_mode = vap->va_mode; c = 1; @@ -1233,9 +1233,9 @@ if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { /* See the comment in ufs_vnops::ufs_setattr(). */ - if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td)) && + if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td)))) + (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) { pn->mn_atime = vap->va_atime; --- //depot/vendor/freebsd/src/sys/kern/vfs_default.c 2008/04/16 11:35:15 +++ //depot/user/attilio/attilio_vfs/sys/kern/vfs_default.c 2008/08/27 14:28:14 @@ -208,13 +208,15 @@ int vop_stdadvlock(struct vop_advlock_args *ap) { - struct vnode *vp = ap->a_vp; - struct thread *td = curthread; + struct vnode *vp; + struct ucred *cred; struct vattr vattr; int error; + vp = ap->a_vp; + cred = curthread->td_ucred; vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_GETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); if (error) return (error); @@ -225,13 +227,15 @@ int vop_stdadvlockasync(struct vop_advlockasync_args *ap) { - struct vnode *vp = ap->a_vp; - struct thread *td = curthread; + struct vnode *vp; + struct ucred *cred; struct vattr vattr; int error; + vp = ap->a_vp; + cred = curthread->td_ucred; vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_GETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); if (error) return (error); --- //depot/vendor/freebsd/src/sys/kern/vfs_mount.c 2008/08/23 01:20:13 +++ //depot/user/attilio/attilio_vfs/sys/kern/vfs_mount.c 2008/08/27 14:28:14 @@ -958,7 +958,7 @@ * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. */ - error = VOP_GETATTR(vp, &va, td->td_ucred, td); + error = VOP_GETATTR(vp, &va, td->td_ucred); if (error) { vput(vp); return (error); --- //depot/vendor/freebsd/src/sys/kern/vfs_subr.c 2008/08/24 20:20:13 +++ //depot/user/attilio/attilio_vfs/sys/kern/vfs_subr.c 2008/08/27 14:32:39 @@ -2368,7 +2368,7 @@ * vnodes open for writing. */ if (flags & WRITECLOSE) { - error = VOP_GETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_GETATTR(vp, &vattr, td->td_ucred); VI_LOCK(vp); if ((vp->v_type == VNON || @@ -4096,7 +4096,7 @@ return (1); } - if (VOP_GETATTR(vp, &va, curthread->td_ucred, curthread)) + if (VOP_GETATTR(vp, &va, curthread->td_ucred)) return (0); kn->kn_data = va.va_size - kn->kn_fp->f_offset; @@ -4166,13 +4166,13 @@ * directly setting va_atime for the sake of efficiency. */ void -vfs_mark_atime(struct vnode *vp, struct thread *td) +vfs_mark_atime(struct vnode *vp, struct ucred *cred) { struct vattr atimeattr; if ((vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) { VATTR_NULL(&atimeattr); atimeattr.va_vaflags |= VA_MARK_ATIME; - (void)VOP_SETATTR(vp, &atimeattr, td->td_ucred, td); + (void)VOP_SETATTR(vp, &atimeattr, cred); } } --- //depot/vendor/freebsd/src/sys/kern/vfs_syscalls.c 2008/06/22 21:55:13 +++ //depot/user/attilio/attilio_vfs/sys/kern/vfs_syscalls.c 2008/08/27 14:28:14 @@ -1147,7 +1147,7 @@ error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); if (error == 0) #endif - error = VOP_SETATTR(vp, &vat, td->td_ucred, td); + error = VOP_SETATTR(vp, &vat, td->td_ucred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); if (error) @@ -1507,7 +1507,7 @@ "groups"); static int -can_hardlink(struct vnode *vp, struct thread *td, struct ucred *cred) +can_hardlink(struct vnode *vp, struct ucred *cred) { struct vattr va; int error; @@ -1515,7 +1515,7 @@ if (!hardlink_check_uid && !hardlink_check_gid) return (0); - error = VOP_GETATTR(vp, &va, cred, td); + error = VOP_GETATTR(vp, &va, cred); if (error != 0) return (error); @@ -1586,7 +1586,7 @@ == 0) { VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); - error = can_hardlink(vp, td, td->td_ucred); + error = can_hardlink(vp, td->td_ucred); if (error == 0) #ifdef MAC error = mac_vnode_check_link(td->td_ucred, @@ -1939,7 +1939,7 @@ break; case L_XTND: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); if (error) break; @@ -2637,7 +2637,7 @@ error = mac_vnode_check_setflags(td->td_ucred, vp, vattr.va_flags); if (error == 0) #endif - error = VOP_SETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_SETATTR(vp, &vattr, td->td_ucred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); return (error); @@ -2765,7 +2765,7 @@ error = mac_vnode_check_setmode(td->td_ucred, vp, vattr.va_mode); if (error == 0) #endif - error = VOP_SETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_SETATTR(vp, &vattr, td->td_ucred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); return (error); @@ -2930,7 +2930,7 @@ vattr.va_gid); if (error == 0) #endif - error = VOP_SETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_SETATTR(vp, &vattr, td->td_ucred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); return (error); @@ -3137,7 +3137,7 @@ VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); setbirthtime = 0; - if (numtimes < 3 && VOP_GETATTR(vp, &vattr, td->td_ucred, td) == 0 && + if (numtimes < 3 && !VOP_GETATTR(vp, &vattr, td->td_ucred) && timespeccmp(&ts[1], &vattr.va_birthtime, < )) setbirthtime = 1; VATTR_NULL(&vattr); @@ -3154,7 +3154,7 @@ vattr.va_mtime); #endif if (error == 0) - error = VOP_SETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_SETATTR(vp, &vattr, td->td_ucred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); return (error); @@ -3377,7 +3377,7 @@ (error = VOP_ACCESS(vp, VWRITE, td->td_ucred, td)) == 0) { VATTR_NULL(&vattr); vattr.va_size = length; - error = VOP_SETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_SETATTR(vp, &vattr, td->td_ucred); } vput(vp); vn_finished_write(mp); @@ -4172,7 +4172,7 @@ if (error) goto out; #endif - error = VOP_GETATTR(vp, &vattr, td->td_ucred, td); + error = VOP_GETATTR(vp, &vattr, td->td_ucred); if (error) goto out; if (td->td_ucred->cr_uid != vattr.va_uid) { @@ -4418,7 +4418,7 @@ #endif VATTR_NULL(vap); vap->va_size = 0; - error = VOP_SETATTR(vp, vap, td->td_ucred, td); + error = VOP_SETATTR(vp, vap, td->td_ucred); #ifdef MAC } #endif --- //depot/vendor/freebsd/src/sys/kern/vfs_vnops.c 2008/08/03 15:45:13 +++ //depot/user/attilio/attilio_vfs/sys/kern/vfs_vnops.c 2008/08/27 14:28:14 @@ -648,7 +648,7 @@ if (error == 0) { VATTR_NULL(&vattr); vattr.va_size = length; - error = VOP_SETATTR(vp, &vattr, fp->f_cred, td); + error = VOP_SETATTR(vp, &vattr, fp->f_cred); } out: VOP_UNLOCK(vp, 0); @@ -703,7 +703,7 @@ #endif vap = &vattr; - error = VOP_GETATTR(vp, vap, active_cred, td); + error = VOP_GETATTR(vp, vap, active_cred); if (error) return (error); @@ -803,7 +803,7 @@ case VDIR: if (com == FIONREAD) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, active_cred, td); + error = VOP_GETATTR(vp, &vattr, active_cred); VOP_UNLOCK(vp, 0); if (!error) *(int *)data = vattr.va_size - fp->f_offset; --- //depot/vendor/freebsd/src/sys/kern/vnode_if.src 2008/03/26 15:25:17 +++ //depot/user/attilio/attilio_vfs/sys/kern/vnode_if.src 2008/08/27 14:28:14 @@ -159,7 +159,6 @@ IN struct vnode *vp; OUT struct vattr *vap; IN struct ucred *cred; - IN struct thread *td; }; @@ -170,7 +169,6 @@ IN struct vnode *vp; IN struct vattr *vap; IN struct ucred *cred; - IN struct thread *td; }; --- //depot/vendor/freebsd/src/sys/nfs4client/nfs4_vnops.c 2008/05/27 00:21:39 +++ //depot/user/attilio/attilio_vfs/sys/nfs4client/nfs4_vnops.c 2008/08/27 14:28:14 @@ -128,9 +128,8 @@ static int nfs4_flush(struct vnode *, int, struct thread *, int); -static int nfs4_setattrrpc(struct vnode *, struct vattr *, struct ucred *, - struct thread *); -static int nfs4_closerpc(struct vnode *, struct ucred *, struct thread *, int); +static int nfs4_setattrrpc(struct vnode *, struct vattr *, struct ucred *); +static int nfs4_closerpc(struct vnode *, struct ucred *, int); static vop_lookup_t nfs4_lookup; static vop_create_t nfs4_create; @@ -528,8 +527,7 @@ VATTR_NULL(&va); va.va_size = 0; - error = nfs4_setattrrpc(vp, &va, - cnp->cn_cred, cnp->cn_thread); + error = nfs4_setattrrpc(vp, &va, cnp->cn_cred); } np->n_attrstamp = 0; } @@ -621,15 +619,17 @@ } static int -nfs4_closerpc(struct vnode *vp, struct ucred *cred, struct thread *td, int flags) +nfs4_closerpc(struct vnode *vp, struct ucred *cred, int flags) { caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep = NULL, *md, *mb; + struct thread *td; struct nfs4_fctx *fcp; struct nfs4_compound cp; struct nfsnode *np = VTONFS(vp); + td = curthread; fcp = flags & FWRITE ? &np->n_wfc : &np->n_rfc; nfs_v4initcompound(&cp); @@ -687,7 +687,7 @@ np->n_attrstamp = 0; } - error = nfs4_closerpc(vp, ap->a_cred, ap->a_td, ap->a_fflag); + error = nfs4_closerpc(vp, ap->a_cred, ap->a_fflag); if (!error && np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; @@ -735,7 +735,7 @@ nfsm_v4build_getattr(&cp, &ga); nfsm_v4build_finalize(&cp); - nfsm_request(vp, NFSV4PROC_COMPOUND, ap->a_td, ap->a_cred); + nfsm_request(vp, NFSV4PROC_COMPOUND, curthread, ap->a_cred); if (error != 0) goto nfsmout; @@ -762,6 +762,7 @@ struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); struct vattr *vap = ap->a_vap; + struct thread *td = curthread; int error = 0; u_quad_t tsize; @@ -815,14 +816,14 @@ */ 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_cred, td, + vap->va_size); if (np->n_flag & NMODIFIED) { if (vap->va_size == 0) - error = nfs_vinvalbuf(vp, 0, ap->a_td, 1); + error = nfs_vinvalbuf(vp, 0, td, 1); else - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) { vnode_pager_setsize(vp, np->n_size); return (error); @@ -839,7 +840,7 @@ } 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_td, 1)) == EINTR) + (error = nfs_vinvalbuf(vp, V_SAVE, td, 1)) == EINTR) return (error); if (vap->va_size != VNOVAL && np->n_wfc.refcnt == 0) { @@ -849,14 +850,14 @@ cn.cn_nameptr = np->n_name; cn.cn_namelen = np->n_namelen; cn.cn_cred = ap->a_cred; - cn.cn_thread = ap->a_td; + cn.cn_thread = td; error = nfs4_openrpc(np->n_dvp, &vp, &cn, FWRITE, NULL); if (error) return error; np->n_flag |= NTRUNCATE; } - error = nfs4_setattrrpc(vp, vap, ap->a_cred, ap->a_td); + error = nfs4_setattrrpc(vp, vap, ap->a_cred); if (error && vap->va_size != VNOVAL) { np->n_size = np->n_vattr.va_size = tsize; vnode_pager_setsize(vp, np->n_size); @@ -868,17 +869,18 @@ * Do an nfs setattr rpc. */ static int -nfs4_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred, - struct thread *td) +nfs4_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred) { caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep = NULL, *md, *mb; + struct thread *td; struct nfs4_compound cp; struct nfs4_oparg_getattr ga; struct nfsnode *np = VTONFS(vp); struct nfs4_fctx *fcp; + td = curthread; nfsstats.rpccnt[NFSPROC_SETATTR]++; mreq = nfsm_reqhead(vp, NFSV4PROC_COMPOUND, 0); mb = mreq; @@ -907,7 +909,7 @@ /* TODO: do the settatr and close in a single compound rpc */ if (np->n_flag & NTRUNCATE) { - error = nfs4_closerpc(vp, cred, td, FWRITE); + error = nfs4_closerpc(vp, cred, FWRITE); np->n_flag &= ~NTRUNCATE; } @@ -965,7 +967,7 @@ struct vattr vattr; newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) + if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && @@ -1532,7 +1534,7 @@ int error = 0, fmode = (O_CREAT | FREAD | FWRITE); struct vattr vattr; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)) != 0) + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) return (error); if (vap->va_vaflags & VA_EXCLUSIVE) @@ -1586,8 +1588,7 @@ if (vp->v_type == VDIR) error = EPERM; else if (vrefcnt(vp) == 1 || (np->n_sillyrename && - VOP_GETATTR(vp, &vattr, cnp->cn_cred, cnp->cn_thread) == 0 && - vattr.va_nlink > 1)) { + !VOP_GETATTR(vp, &vattr, cnp->cn_cred) && vattr.va_nlink > 1)) { /* * Purge the name cache so that the chance of a lookup for * the name succeeding while the remove is in progress is @@ -1925,7 +1926,7 @@ */ if (np->n_direofoffset > 0 && uio->uio_offset >= np->n_direofoffset && (np->n_flag & NMODIFIED) == 0) { - if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_td) == 0 && + if (!VOP_GETATTR(vp, &vattr, ap->a_cred) && !NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { nfsstats.direofcache_hits++; return (0); --- //depot/vendor/freebsd/src/sys/nfsclient/nfs_bio.c 2008/02/09 20:16:21 +++ //depot/user/attilio/attilio_vfs/sys/nfsclient/nfs_bio.c 2008/08/27 14:28:14 @@ -403,7 +403,7 @@ goto out; } np->n_attrstamp = 0; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; mtx_lock(&np->n_mtx); @@ -411,7 +411,7 @@ mtx_unlock(&np->n_mtx); } else { mtx_unlock(&np->n_mtx); - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); mtx_lock(&np->n_mtx); @@ -928,7 +928,7 @@ */ if (ioflag & IO_APPEND) { np->n_attrstamp = 0; - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); mtx_lock(&np->n_mtx); --- //depot/vendor/freebsd/src/sys/nfsclient/nfs_vfsops.c 2008/08/17 23:30:17 +++ //depot/user/attilio/attilio_vfs/sys/nfsclient/nfs_vfsops.c 2008/08/27 14:28:14 @@ -982,7 +982,7 @@ if (argp->flags & NFSMNT_NFSV3) nfs_fsinfo(nmp, *vpp, curthread->td_ucred, curthread); else - VOP_GETATTR(*vpp, &attrs, curthread->td_ucred, curthread); + VOP_GETATTR(*vpp, &attrs, curthread->td_ucred); /* * Lose the lock but keep the ref. --- //depot/vendor/freebsd/src/sys/nfsclient/nfs_vnops.c 2008/08/17 23:30:17 +++ //depot/user/attilio/attilio_vfs/sys/nfsclient/nfs_vnops.c 2008/08/27 14:28:14 @@ -100,10 +100,8 @@ static vop_read_t nfsfifo_read; static vop_write_t nfsfifo_write; static vop_close_t nfsfifo_close; -static int nfs_flush(struct vnode *, int, struct thread *, - int); -static int nfs_setattrrpc(struct vnode *, struct vattr *, struct ucred *, - struct thread *); +static int nfs_flush(struct vnode *, int, int); +static int nfs_setattrrpc(struct vnode *, struct vattr *, struct ucred *); static vop_lookup_t nfs_lookup; static vop_create_t nfs_create; static vop_mknod_t nfs_mknod; @@ -471,7 +469,7 @@ 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_cred); if (error) return (error); mtx_lock(&np->n_mtx); @@ -487,7 +485,7 @@ np->n_attrstamp = 0; } mtx_unlock(&np->n_mtx); - error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); + error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) return (error); mtx_lock(&np->n_mtx); @@ -589,7 +587,7 @@ * cannot clear it if we don't commit. */ int cm = nfsv3_commit_on_close ? 1 : 0; - error = nfs_flush(vp, MNT_WAIT, ap->a_td, cm); + error = nfs_flush(vp, MNT_WAIT, cm); /* np->n_flag &= ~NMODIFIED; */ } else error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); @@ -632,6 +630,7 @@ { struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); + struct thread *td = curthread; caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep, *md, *mb; @@ -651,7 +650,7 @@ goto nfsmout; 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, td, ap->a_cred); if (nfs_getattrcache(vp, ap->a_vap) == 0) goto nfsmout; } @@ -660,7 +659,7 @@ mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); - nfsm_request(vp, NFSPROC_GETATTR, ap->a_td, ap->a_cred); + nfsm_request(vp, NFSPROC_GETATTR, td, ap->a_cred); if (!error) { nfsm_loadattr(vp, ap->a_vap); } @@ -678,6 +677,7 @@ struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); struct vattr *vap = ap->a_vap; + struct thread *td = curthread; int error = 0; u_quad_t tsize; @@ -733,16 +733,16 @@ mtx_lock(&np->n_mtx); tsize = np->n_size; mtx_unlock(&np->n_mtx); - error = nfs_meta_setsize(vp, ap->a_cred, - ap->a_td, vap->va_size); + error = nfs_meta_setsize(vp, ap->a_cred, td, + vap->va_size); mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { tsize = np->n_size; mtx_unlock(&np->n_mtx); if (vap->va_size == 0) - error = nfs_vinvalbuf(vp, 0, ap->a_td, 1); + error = nfs_vinvalbuf(vp, 0, td, 1); else - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, td, 1); if (error) { vnode_pager_setsize(vp, tsize); goto out; @@ -764,13 +764,13 @@ if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED) && vp->v_type == VREG) { mtx_unlock(&np->n_mtx); - if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1)) != 0 && + if ((error = nfs_vinvalbuf(vp, V_SAVE, td, 1)) != 0 && (error == EINTR || error == EIO)) return error; } else mtx_unlock(&np->n_mtx); } - error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_td); + error = nfs_setattrrpc(vp, vap, ap->a_cred); if (error && vap->va_size != VNOVAL) { mtx_lock(&np->n_mtx); np->n_size = np->n_vattr.va_size = tsize; @@ -785,8 +785,7 @@ * Do an nfs setattr rpc. */ static int -nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred, - struct thread *td) +nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred) { struct nfsv2_sattr *sp; struct nfsnode *np = VTONFS(vp); @@ -823,7 +822,7 @@ txdr_nfsv2time(&vap->va_atime, &sp->sa_atime); txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime); } - nfsm_request(vp, NFSPROC_SETATTR, td, cred); + nfsm_request(vp, NFSPROC_SETATTR, curthread, cred); if (v3) { np->n_modestamp = 0; nfsm_wcc_data(vp, wccflag); @@ -873,7 +872,7 @@ struct vattr vattr; newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) + if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && @@ -1276,9 +1275,8 @@ else { return (EOPNOTSUPP); } - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) return (error); - } nfsstats.rpccnt[NFSPROC_MKNOD]++; mreq = nfsm_reqhead(dvp, NFSPROC_MKNOD, NFSX_FH(v3) + 4 * NFSX_UNSIGNED + + nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3)); @@ -1375,9 +1373,8 @@ 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_thread)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) return (error); - } if (vap->va_vaflags & VA_EXCLUSIVE) fmode |= O_EXCL; again: @@ -1451,7 +1448,7 @@ vfs_timestamp(&vap->va_mtime); if (vap->va_atime.tv_sec == VNOVAL) vap->va_atime = vap->va_mtime; - error = nfs_setattrrpc(newvp, vap, cnp->cn_cred, cnp->cn_thread); + error = nfs_setattrrpc(newvp, vap, cnp->cn_cred); if (error) vput(newvp); } @@ -1498,8 +1495,7 @@ if (vp->v_type == VDIR) error = EPERM; else if (vrefcnt(vp) == 1 || (np->n_sillyrename && - VOP_GETATTR(vp, &vattr, cnp->cn_cred, cnp->cn_thread) == 0 && - vattr.va_nlink > 1)) { + !VOP_GETATTR(vp, &vattr, cnp->cn_cred) && vattr.va_nlink > 1)) { /* * Purge the name cache so that the chance of a lookup for * the name succeeding while the remove is in progress is @@ -1883,9 +1879,8 @@ struct vattr vattr; int v3 = NFS_ISV3(dvp); - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)) != 0) { + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) return (error); - } len = cnp->cn_namelen; nfsstats.rpccnt[NFSPROC_MKDIR]++; mreq = nfsm_reqhead(dvp, NFSPROC_MKDIR, @@ -1997,7 +1992,7 @@ */ if (np->n_direofoffset > 0 && uio->uio_offset >= np->n_direofoffset && (np->n_flag & NMODIFIED) == 0) { - if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_td) == 0) { + if (VOP_GETATTR(vp, &vattr, ap->a_cred) == 0) { mtx_lock(&np->n_mtx); if (!NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { mtx_unlock(&np->n_mtx); @@ -2724,7 +2719,8 @@ static int nfs_fsync(struct vop_fsync_args *ap) { - return (nfs_flush(ap->a_vp, ap->a_waitfor, ap->a_td, 1)); + + return (nfs_flush(ap->a_vp, ap->a_waitfor, 1)); } /* @@ -2733,8 +2729,7 @@ * associated with the vnode. */ static int -nfs_flush(struct vnode *vp, int waitfor, struct thread *td, - int commit) +nfs_flush(struct vnode *vp, int waitfor, int commit) { struct nfsnode *np = VTONFS(vp); struct buf *bp; @@ -2747,6 +2742,7 @@ struct ucred* wcred = NULL; struct buf **bvec = NULL; struct bufobj *bo; + struct thread *td = curthread; #ifndef NFS_COMMITBVECSIZ #define NFS_COMMITBVECSIZ 20 #endif @@ -3198,7 +3194,7 @@ } } vap = &vattr; - error = VOP_GETATTR(vp, vap, cred, ap->a_td); + error = VOP_GETATTR(vp, vap, cred); if (error) goto out; error = vaccess(vp->v_type, vap->va_mode, vap->va_uid, vap->va_gid, @@ -3274,7 +3270,7 @@ if (np->n_flag & NUPD) vattr.va_mtime = np->n_mtim; mtx_unlock(&np->n_mtx); - (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td); + (void)VOP_SETATTR(vp, &vattr, ap->a_cred); goto out; } } --- //depot/vendor/freebsd/src/sys/nfsserver/nfs_serv.c 2008/05/28 16:26:10 +++ //depot/user/attilio/attilio_vfs/sys/nfsserver/nfs_serv.c 2008/08/27 14:28:14 @@ -241,7 +241,7 @@ 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, cred); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED); @@ -288,7 +288,7 @@ error = 0; goto nfsmout; } - error = VOP_GETATTR(vp, vap, cred, td); + error = VOP_GETATTR(vp, vap, cred); vput(vp); vp = NULL; nfsm_reply(NFSX_FATTR(nfsd->nd_flag & ND_NFSV3)); @@ -405,7 +405,7 @@ * vp now an active resource, pay careful attention to cleanup */ if (v3) { - error = preat_ret = VOP_GETATTR(vp, &preat, cred, td); + error = preat_ret = VOP_GETATTR(vp, &preat, cred); if (!error && gcheck && (preat.va_ctime.tv_sec != guard.tv_sec || preat.va_ctime.tv_nsec != guard.tv_nsec)) @@ -438,8 +438,8 @@ td, 0)) != 0) goto out; } - error = VOP_SETATTR(vp, vap, cred, td); - postat_ret = VOP_GETATTR(vp, vap, cred, td); + error = VOP_SETATTR(vp, vap, cred); + postat_ret = VOP_GETATTR(vp, vap, cred); if (!error) error = postat_ret; out: @@ -612,7 +612,7 @@ fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VOP_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, cred, td); + error = VOP_GETATTR(vp, vap, cred); vput(vp); vrele(ndp->ni_startdir); @@ -729,7 +729,7 @@ error = ENXIO; } else error = VOP_READLINK(vp, uiop, cred); - getret = VOP_GETATTR(vp, &attr, cred, td); + getret = VOP_GETATTR(vp, &attr, cred); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_UNSIGNED); @@ -832,7 +832,7 @@ error = nfsrv_access(vp, VEXEC, cred, rdonly, td, 1); } - getret = VOP_GETATTR(vp, vap, cred, td); + getret = VOP_GETATTR(vp, vap, cred); if (!error) error = getret; if (error) { @@ -972,7 +972,7 @@ 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, cred))) { if (!error) error = getret; m_freem(mreq); @@ -1124,7 +1124,7 @@ goto nfsmout; } if (v3) - forat_ret = VOP_GETATTR(vp, &forat, cred, td); + forat_ret = VOP_GETATTR(vp, &forat, cred); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1181,7 +1181,7 @@ nfsrvstats.srvvop_writes++; FREE((caddr_t)iv, M_TEMP); } - aftat_ret = VOP_GETATTR(vp, vap, cred, td); + aftat_ret = VOP_GETATTR(vp, vap, cred); vput(vp); vp = NULL; if (!error) @@ -1436,7 +1436,7 @@ slp, nfsd->nd_nam, &rdonly, TRUE); if (!error) { if (v3) - forat_ret = VOP_GETATTR(vp, &forat, cred, td); + forat_ret = VOP_GETATTR(vp, &forat, cred); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1501,7 +1501,7 @@ } m_freem(mrep); if (vp) { - aftat_ret = VOP_GETATTR(vp, &va, cred, td); + aftat_ret = VOP_GETATTR(vp, &va, cred); vput(vp); vp = NULL; } @@ -1790,8 +1790,8 @@ VATTR_NULL(vap); bcopy(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF); - error = VOP_SETATTR(nd.ni_vp, vap, cred, - td); + error = VOP_SETATTR(nd.ni_vp, vap, + cred); } } } else if (vap->va_type == VCHR || vap->va_type == VBLK || @@ -1858,8 +1858,7 @@ tempsize = vap->va_size; VATTR_NULL(vap); vap->va_size = tempsize; - error = VOP_SETATTR(nd.ni_vp, vap, cred, - td); + error = VOP_SETATTR(nd.ni_vp, vap, cred); } } } @@ -1869,14 +1868,14 @@ fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; error = VOP_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, cred); } if (v3) { if (exclusive_flag && !error && bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF)) error = EEXIST; if (dirp == nd.ni_dvp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); else { /* Drop the other locks to avoid deadlock. */ if (nd.ni_dvp) { @@ -1891,7 +1890,7 @@ nd.ni_vp = NULL; vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } } @@ -2072,7 +2071,7 @@ fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VOP_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, cred, td); + error = VOP_GETATTR(vp, vap, cred); } if (nd.ni_dvp) { if (nd.ni_dvp == nd.ni_vp) @@ -2093,7 +2092,7 @@ NDFREE(&nd, NDF_ONLY_PNBUF); if (dirp) { vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } ereply: @@ -2195,7 +2194,7 @@ } if (dirp && v3) { if (dirp == nd.ni_dvp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); else { /* Drop the other locks to avoid deadlock. */ if (nd.ni_dvp) { @@ -2210,7 +2209,7 @@ nd.ni_vp = NULL; vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } vrele(dirp); @@ -2421,12 +2420,12 @@ if (fdirp) { vn_lock(fdirp, LK_EXCLUSIVE | LK_RETRY); - fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, cred, td); + fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, cred); VOP_UNLOCK(fdirp, 0); } if (tdirp) { vn_lock(tdirp, LK_EXCLUSIVE | LK_RETRY); - tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, cred, td); + tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, cred); VOP_UNLOCK(tdirp, 0); } nfsm_srvwcc_data(fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft); @@ -2525,7 +2524,7 @@ goto nfsmout; } if (v3) - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, cred); if (vp->v_type == VDIR) { error = EPERM; /* POSIX */ goto out1; @@ -2567,11 +2566,11 @@ out1: if (v3) - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, cred); out2: if (dirp) { if (dirp == nd.ni_dvp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); else { /* Release existing locks to prevent deadlock. */ if (nd.ni_dvp) { @@ -2586,7 +2585,7 @@ nd.ni_vp = NULL; vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } } @@ -2744,8 +2743,7 @@ fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; error = VOP_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, cred); vput(nd.ni_vp); nd.ni_vp = NULL; } @@ -2762,7 +2760,7 @@ } if (dirp) { vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } if (nd.ni_startdir) { @@ -2900,12 +2898,12 @@ fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; error = VOP_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, cred); } out: if (dirp) { if (dirp == nd.ni_dvp) { - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); } else { /* Release existing locks to prevent deadlock. */ if (nd.ni_dvp) { @@ -2924,7 +2922,7 @@ nd.ni_dvp = NULL; nd.ni_vp = NULL; vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } } @@ -3047,7 +3045,7 @@ if (dirp) { if (dirp == nd.ni_dvp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); else { /* Release existing locks to prevent deadlock. */ if (nd.ni_dvp) { @@ -3061,7 +3059,7 @@ nd.ni_dvp = NULL; nd.ni_vp = NULL; vn_lock(dirp, LK_EXCLUSIVE | LK_RETRY); - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred); VOP_UNLOCK(dirp, 0); } } @@ -3199,7 +3197,7 @@ * Obtain lock on vnode for this section of the code */ if (v3) { - error = getret = VOP_GETATTR(vp, &at, cred, td); + error = getret = VOP_GETATTR(vp, &at, cred); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3246,7 +3244,7 @@ if (!cookies && !error) error = NFSERR_PERM; if (v3) { - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, cred); if (!error) error = getret; } @@ -3487,7 +3485,7 @@ error = 0; goto nfsmout; } - error = getret = VOP_GETATTR(vp, &at, cred, td); + error = getret = VOP_GETATTR(vp, &at, cred); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3525,7 +3523,7 @@ } 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, cred); VOP_UNLOCK(vp, 0); if (!cookies && !error) error = NFSERR_PERM; @@ -3653,7 +3651,7 @@ nvp = NULL; goto invalid; } - if (VOP_GETATTR(nvp, vap, cred, td)) { + if (VOP_GETATTR(nvp, vap, cred)) { vput(nvp); nvp = NULL; goto invalid; @@ -3824,7 +3822,7 @@ error = 0; goto nfsmout; } - for_ret = VOP_GETATTR(vp, &bfor, cred, td); + for_ret = VOP_GETATTR(vp, &bfor, cred); if (cnt > MAX_COMMIT_COUNT) { /* @@ -3908,7 +3906,7 @@ BO_UNLOCK(bo); } - aft_ret = VOP_GETATTR(vp, &aft, cred, td); + aft_ret = VOP_GETATTR(vp, &aft, cred); vput(vp); vp = NULL; ereply: @@ -3971,7 +3969,7 @@ } sf = &statfs; error = VFS_STATFS(vp->v_mount, sf, td); - getret = VOP_GETATTR(vp, &at, cred, td); + getret = VOP_GETATTR(vp, &at, cred); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_STATFS(v3)); @@ -4068,7 +4066,7 @@ 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, cred); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3FSINFO); @@ -4148,7 +4146,7 @@ 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, cred); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3PATHCONF); @@ -4272,7 +4270,7 @@ return (ETXTBSY); } - error = VOP_GETATTR(vp, &vattr, cred, td); + error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); error = VOP_ACCESS(vp, flags, cred, td); --- //depot/vendor/freebsd/src/sys/nfsserver/nfs_srvsubs.c 2008/03/25 09:42:45 +++ //depot/user/attilio/attilio_vfs/sys/nfsserver/nfs_srvsubs.c 2008/08/27 14:28:14 @@ -688,7 +688,7 @@ if (v3) { vn_lock(dp, LK_EXCLUSIVE | LK_RETRY); *retdirattr_retp = VOP_GETATTR(dp, retdirattrp, - ndp->ni_cnd.cn_cred, td); + ndp->ni_cnd.cn_cred); VOP_UNLOCK(dp, 0); } --- //depot/vendor/freebsd/src/sys/security/audit/audit_arg.c 2008/07/31 10:00:16 +++ //depot/user/attilio/attilio_vfs/sys/security/audit/audit_arg.c 2008/08/27 14:28:14 @@ -762,7 +762,7 @@ vnp = &ar->k_ar.ar_arg_vnode2; } - error = VOP_GETATTR(vp, &vattr, curthread->td_ucred, curthread); + error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); if (error) { /* XXX: How to handle this case? */ return; --- //depot/vendor/freebsd/src/sys/security/audit/audit_worker.c 2008/07/31 10:00:16 +++ //depot/user/attilio/attilio_vfs/sys/security/audit/audit_worker.c 2008/08/27 14:28:14 @@ -128,7 +128,7 @@ if (error) goto fail; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred, curthread); + error = VOP_GETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); if (error) goto fail; --- //depot/vendor/freebsd/src/sys/security/mac_bsdextended/mac_bsdextended.c 2008/08/23 15:30:31 +++ //depot/user/attilio/attilio_vfs/sys/security/mac_bsdextended/mac_bsdextended.c 2008/08/27 14:28:14 @@ -436,7 +436,7 @@ if (!ugidfw_enabled) return (0); - error = VOP_GETATTR(vp, &vap, cred, curthread); + error = VOP_GETATTR(vp, &vap, cred); if (error) return (error); return (ugidfw_check(cred, vp, &vap, acc_mode)); --- //depot/vendor/freebsd/src/sys/security/mac_lomac/mac_lomac.c 2008/08/23 15:30:31 +++ //depot/user/attilio/attilio_vfs/sys/security/mac_lomac/mac_lomac.c 2008/08/27 14:28:14 @@ -563,8 +563,7 @@ objlabeltext = sbuf_data(&objlabel_sb); pgid = p->p_pgrp->pg_id; /* XXX could be stale? */ - if (vp != NULL && VOP_GETATTR(vp, &va, curthread->td_ucred, - curthread) == 0) { + if (vp != NULL && VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" " level %s after %s a level-%s %s (inode=%ld, " "mountpount=%s)\n", --- //depot/vendor/freebsd/src/sys/sys/vnode.h 2008/07/31 17:00:23 +++ //depot/user/attilio/attilio_vfs/sys/sys/vnode.h 2008/08/27 14:28:14 @@ -692,8 +692,7 @@ \ osize = ooffset = noffset = 0; \ if (!VN_KNLIST_EMPTY((ap)->a_vp)) { \ - error = VOP_GETATTR((ap)->a_vp, &va, (ap)->a_cred, \ - curthread); \ + error = VOP_GETATTR((ap)->a_vp, &va, (ap)->a_cred); \ if (error) \ return (error); \ ooffset = (ap)->a_uio->uio_offset; \ @@ -739,7 +738,7 @@ void vfs_hash_remove(struct vnode *vp); int vfs_kqfilter(struct vop_kqfilter_args *); -void vfs_mark_atime(struct vnode *vp, struct thread *td); +void vfs_mark_atime(struct vnode *vp, struct ucred *cred); struct dirent; int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); --- //depot/vendor/freebsd/src/sys/ufs/ffs/ffs_snapshot.c 2008/03/31 12:06:01 +++ //depot/user/attilio/attilio_vfs/sys/ufs/ffs/ffs_snapshot.c 2008/08/27 14:28:14 @@ -557,7 +557,7 @@ VI_UNLOCK(xvp); if (snapdebug) vprint("ffs_snapshot: busy vnode", xvp); - if (VOP_GETATTR(xvp, &vat, td->td_ucred, td) == 0 && + if (VOP_GETATTR(xvp, &vat, td->td_ucred) == 0 && vat.va_nlink > 0) { VOP_UNLOCK(xvp, 0); vdrop(xvp); --- //depot/vendor/freebsd/src/sys/ufs/ufs/ufs_vnops.c 2008/08/24 19:10:14 +++ //depot/user/attilio/attilio_vfs/sys/ufs/ufs/ufs_vnops.c 2008/08/27 14:32:39 @@ -402,7 +402,6 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -466,14 +465,13 @@ struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vattr *vap = ap->a_vap; struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); struct ucred *cred = ap->a_cred; - struct thread *td = ap->a_td; + struct thread *td = curthread; int error; /* --- //depot/vendor/freebsd/src/sys/vm/swap_pager.c 2008/07/30 21:15:16 +++ //depot/user/attilio/attilio_vfs/sys/vm/swap_pager.c 2008/08/27 14:28:14 @@ -1965,7 +1965,7 @@ error = swapongeom(td, vp); } else if (vp->v_type == VREG && (vp->v_mount->mnt_vfc->vfc_flags & VFCF_NETWORK) != 0 && - (error = VOP_GETATTR(vp, &attr, td->td_ucred, td)) == 0) { + (error = VOP_GETATTR(vp, &attr, td->td_ucred)) == 0) { /* * Allow direct swapping to NFS regular files in the same * way that nfs_mountroot() sets up diskless swapping. --- //depot/vendor/freebsd/src/sys/vm/vm_mmap.c 2008/08/03 14:30:13 +++ //depot/user/attilio/attilio_vfs/sys/vm/vm_mmap.c 2008/08/27 14:28:14 @@ -1155,10 +1155,12 @@ vm_object_t obj; struct mount *mp; struct cdevsw *dsw; + struct ucred *cred; int error, flags, type; int vfslocked; mp = vp->v_mount; + cred = td->td_ucred; vfslocked = VFS_LOCK_GIANT(mp); if ((error = vget(vp, LK_EXCLUSIVE, td)) != 0) { VFS_UNLOCK_GIANT(vfslocked); @@ -1218,11 +1220,10 @@ error = EINVAL; goto done; } - if ((error = VOP_GETATTR(vp, &va, td->td_ucred, td))) { + if ((error = VOP_GETATTR(vp, &va, cred))) goto done; - } #ifdef MAC - error = mac_vnode_check_mmap(td->td_ucred, vp, prot, flags); + error = mac_vnode_check_mmap(cred, vp, prot, flags); if (error != 0) goto done; #endif @@ -1252,7 +1253,7 @@ } *objp = obj; *flagsp = flags; - vfs_mark_atime(vp, td); + vfs_mark_atime(vp, cred); done: vput(vp); --- //depot/vendor/freebsd/src/sys/vm/vnode_pager.c 2008/07/30 21:20:16 +++ //depot/user/attilio/attilio_vfs/sys/vm/vnode_pager.c 2008/08/27 14:28:14 @@ -122,7 +122,7 @@ if (vn_isdisk(vp, NULL)) { size = IDX_TO_OFF(INT_MAX); } else { - if (VOP_GETATTR(vp, &va, td->td_ucred, td) != 0) + if (VOP_GETATTR(vp, &va, td->td_ucred)) return (0); size = va.va_size; }