Index: share/man/man9/VOP_OPENCLOSE.9 =================================================================== --- share/man/man9/VOP_OPENCLOSE.9 (revision 199789) +++ share/man/man9/VOP_OPENCLOSE.9 (working copy) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2007 +.Dd December 2, 2009 .Os .Dt VOP_OPEN 9 .Sh NAME @@ -41,7 +41,7 @@ .Ft int .Fn VOP_OPEN "struct vnode *vp" "int mode" "struct ucred *cred" "struct thread *td" "struct file *fp" .Ft int -.Fn VOP_CLOSE "struct vnode *vp" "int mode" "struct ucred *cred" "struct thread *td" +.Fn VOP_CLOSE "struct vnode *vp" "int mode" "struct ucred *cred" .Sh DESCRIPTION The .Fn VOP_OPEN Index: cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h =================================================================== --- cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h (revision 199789) +++ cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h (working copy) @@ -413,7 +413,7 @@ typedef struct vsecattr { #define CRCREAT 0 -#define VOP_CLOSE(vp, f, c, o, cr, ct) 0 +#define VOP_CLOSE(vp, f, c, o, cr) 0 #define VOP_PUTPAGE(vp, of, sz, fl, cr, ct) 0 #define VOP_GETATTR(vp, vap, cr) ((vap)->va_size = (vp)->v_size, 0) Index: sys/nfsclient/nfs_vnops.c =================================================================== --- sys/nfsclient/nfs_vnops.c (revision 199789) +++ sys/nfsclient/nfs_vnops.c (working copy) @@ -651,7 +651,7 @@ nfs_close(struct vop_close_args *ap) error = nfs_flush(vp, MNT_WAIT, cm); /* np->n_flag &= ~NMODIFIED; */ } else - error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = nfs_vinvalbuf(vp, V_SAVE, curthread, 1); mtx_lock(&np->n_mtx); } if (np->n_flag & NWRITEERR) { Index: sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c =================================================================== --- sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c (revision 199789) +++ sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c (working copy) @@ -216,7 +216,6 @@ _xfs_close( struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap) { int error = 0; @@ -1440,7 +1439,6 @@ _xfsfifo_close( struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap) { Index: sys/gnu/fs/ext2fs/ext2_vnops.c =================================================================== --- sys/gnu/fs/ext2fs/ext2_vnops.c (revision 199789) +++ sys/gnu/fs/ext2fs/ext2_vnops.c (working copy) @@ -268,7 +268,6 @@ ext2_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -1447,7 +1446,6 @@ ext2fifo_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; Index: sys/ufs/ufs/ufs_vnops.c =================================================================== --- sys/ufs/ufs/ufs_vnops.c (revision 199789) +++ sys/ufs/ufs/ufs_vnops.c (working copy) @@ -283,7 +283,6 @@ ufs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -2072,7 +2071,6 @@ ufsfifo_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; Index: sys/kern/vfs_vnops.c =================================================================== --- sys/kern/vfs_vnops.c (revision 199789) +++ sys/kern/vfs_vnops.c (working copy) @@ -299,7 +299,7 @@ vn_close(vp, flags, file_cred, td) ("vn_close: negative writecount")); vp->v_writecount--; } - error = VOP_CLOSE(vp, flags, file_cred, td); + error = VOP_CLOSE(vp, flags, file_cred); vput(vp); vn_finished_write(mp); return (error); Index: sys/kern/kern_exec.c =================================================================== --- sys/kern/kern_exec.c (revision 199789) +++ sys/kern/kern_exec.c (working copy) @@ -505,7 +505,7 @@ interpret: mac_execve_interpreter_enter(binvp, &interpvplabel); #endif if (imgp->opened) { - VOP_CLOSE(binvp, FREAD, td->td_ucred, td); + VOP_CLOSE(binvp, FREAD, td->td_ucred); imgp->opened = 0; } vput(binvp); @@ -861,7 +861,7 @@ exec_fail_dealloc: if (args->fname) NDFREE(&nd, NDF_ONLY_PNBUF); if (imgp->opened) - VOP_CLOSE(imgp->vp, FREAD, td->td_ucred, td); + VOP_CLOSE(imgp->vp, FREAD, td->td_ucred); vput(imgp->vp); } Index: sys/kern/vnode_if.src =================================================================== --- sys/kern/vnode_if.src (revision 199789) +++ sys/kern/vnode_if.src (working copy) @@ -139,7 +139,6 @@ vop_close { IN struct vnode *vp; IN int fflag; IN struct ucred *cred; - IN struct thread *td; }; Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c (revision 199789) +++ sys/kern/vfs_subr.c (working copy) @@ -2565,7 +2565,7 @@ vgonel(struct vnode *vp) * deactivated before being reclaimed. */ if (active) - VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); + VOP_CLOSE(vp, FNONBLOCK, NOCRED); if (oweinact || active) { VI_LOCK(vp); if ((vp->v_iflag & VI_DOINGINACT) == 0) Index: sys/fs/unionfs/union_subr.c =================================================================== --- sys/fs/unionfs/union_subr.c (revision 199789) +++ sys/fs/unionfs/union_subr.c (working copy) @@ -1078,10 +1078,10 @@ unionfs_copyfile(struct unionfs_node *unp, int doc error = VOP_OPEN(lvp, FREAD, cred, td, NULL); if (error == 0) { error = unionfs_copyfile_core(lvp, uvp, cred, td); - VOP_CLOSE(lvp, FREAD, cred, td); + VOP_CLOSE(lvp, FREAD, cred); } } - VOP_CLOSE(uvp, FWRITE, cred, td); + VOP_CLOSE(uvp, FWRITE, cred); uvp->v_writecount--; vn_finished_write(mp); @@ -1221,7 +1221,7 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred } /* close vnode */ - VOP_CLOSE(vp, FREAD, cred, td); + VOP_CLOSE(vp, FREAD, cred); return (error); } Index: sys/fs/unionfs/union_vnops.c =================================================================== --- sys/fs/unionfs/union_vnops.c (revision 199789) +++ sys/fs/unionfs/union_vnops.c (working copy) @@ -532,7 +532,7 @@ unionfs_open(struct vop_open_args *ap) /* open lower for readdir */ error = VOP_OPEN(lvp, FREAD, cred, td, NULL); if (error != 0) { - VOP_CLOSE(uvp, ap->a_mode, cred, td); + VOP_CLOSE(uvp, ap->a_mode, cred); goto unionfs_open_abort; } unsp->uns_node_flag |= UNS_OPENL_4_READDIR; @@ -563,7 +563,6 @@ unionfs_close(struct vop_close_args *ap) struct unionfs_node *unp; struct unionfs_node_status *unsp; struct ucred *cred; - struct thread *td; struct vnode *ovp; UNIONFS_INTERNAL_DEBUG("unionfs_close: enter\n"); @@ -573,13 +572,12 @@ unionfs_close(struct vop_close_args *ap) locked = 0; unp = VTOUNIONFS(ap->a_vp); cred = ap->a_cred; - td = ap->a_td; if (VOP_ISLOCKED(ap->a_vp) != LK_EXCLUSIVE) { vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY); locked = 1; } - unionfs_get_node_status(unp, td, &unsp); + unionfs_get_node_status(unp, curthread, &unsp); if (unsp->uns_lower_opencnt <= 0 && unsp->uns_upper_opencnt <= 0) { #ifdef DIAGNOSTIC @@ -594,7 +592,7 @@ unionfs_close(struct vop_close_args *ap) else ovp = unp->un_lowervp; - error = VOP_CLOSE(ovp, ap->a_fflag, cred, td); + error = VOP_CLOSE(ovp, ap->a_fflag, cred); if (error != 0) goto unionfs_close_abort; @@ -605,7 +603,7 @@ unionfs_close(struct vop_close_args *ap) unsp->uns_upper_opencnt--; if (unsp->uns_upper_opencnt == 0) { if (unsp->uns_node_flag & UNS_OPENL_4_READDIR) { - VOP_CLOSE(unp->un_lowervp, FREAD, cred, td); + VOP_CLOSE(unp->un_lowervp, FREAD, cred); unsp->uns_node_flag &= ~UNS_OPENL_4_READDIR; unsp->uns_lower_opencnt--; } @@ -2007,7 +2005,7 @@ unionfs_advlock(struct vop_advlock_args *ap) if (error) goto unionfs_advlock_abort; unsp->uns_upper_opencnt++; - VOP_CLOSE(unp->un_lowervp, unsp->uns_lower_openmode, td->td_ucred, td); + VOP_CLOSE(unp->un_lowervp, unsp->uns_lower_openmode, td->td_ucred); unsp->uns_lower_opencnt--; } else unionfs_tryrem_node_status(unp, unsp); Index: sys/fs/nfsclient/nfs_clvnops.c =================================================================== --- sys/fs/nfsclient/nfs_clvnops.c (revision 199789) +++ sys/fs/nfsclient/nfs_clvnops.c (working copy) @@ -635,6 +635,7 @@ static int nfs_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp; + struct thread *td = curthread; struct nfsnode *np = VTONFS(vp); struct nfsvattr nfsva; struct ucred *cred; @@ -685,13 +686,12 @@ nfs_close(struct vop_close_args *ap) * traditional vnode locking implemented for Vnode Ops. */ int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); + error = ncl_flush(vp, MNT_WAIT, cred, td, cm); /* np->n_flag &= ~NMODIFIED; */ } else if (NFS_ISV4(vp)) { if (nfscl_mustflush(vp)) { int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, - cm); + error = ncl_flush(vp, MNT_WAIT, cred, td, cm); /* * as above w.r.t races when clearing * NMODIFIED. @@ -699,7 +699,7 @@ nfs_close(struct vop_close_args *ap) */ } } else - error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); + error = ncl_vinvalbuf(vp, V_SAVE, td, 1); mtx_lock(&np->n_mtx); } /* @@ -731,7 +731,7 @@ nfs_close(struct vop_close_args *ap) * Get attributes so "change" is up to date. */ if (!error) { - ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva, + ret = nfsrpc_getattr(vp, cred, td, &nfsva, NULL); if (!ret) { np->n_change = nfsva.na_filerev; @@ -743,11 +743,11 @@ nfs_close(struct vop_close_args *ap) /* * and do the close. */ - ret = nfsrpc_close(vp, 0, ap->a_td); + ret = nfsrpc_close(vp, 0, td); if (!error && ret) error = ret; if (error) - error = nfscl_maperr(ap->a_td, error, (uid_t)0, + error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); } if (newnfs_directio_enable) Index: sys/fs/pseudofs/pseudofs.h =================================================================== --- sys/fs/pseudofs/pseudofs.h (revision 199789) +++ sys/fs/pseudofs/pseudofs.h (working copy) @@ -166,9 +166,9 @@ typedef int (*pfs_getextattr_t)(PFS_GETEXTATTR_ARG * Called with proc locked */ #define PFS_CLOSE_ARGS \ - struct thread *td, struct proc *p, struct pfs_node *pn + struct proc *p, struct pfs_node *pn #define PFS_CLOSE_ARGNAMES \ - td, p, pn + p, pn #define PFS_CLOSE_PROTO(name) \ int name(PFS_CLOSE_ARGS); typedef int (*pfs_close_t)(PFS_CLOSE_ARGS); Index: sys/fs/pseudofs/pseudofs_vnops.c =================================================================== --- sys/fs/pseudofs/pseudofs_vnops.c (revision 199789) +++ sys/fs/pseudofs/pseudofs_vnops.c (working copy) @@ -178,7 +178,7 @@ pfs_close(struct vop_close_args *va) proc = NULL; } - error = pn_close(va->a_td, proc, pn); + error = pn_close(proc, pn); if (proc != NULL) PROC_UNLOCK(proc); Index: sys/fs/hpfs/hpfs_vnops.c =================================================================== --- sys/fs/hpfs/hpfs_vnops.c (revision 199789) +++ sys/fs/hpfs/hpfs_vnops.c (working copy) @@ -755,7 +755,6 @@ hpfs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { #ifdef HPFS_DEBUG Index: sys/fs/coda/coda_vnops.c =================================================================== --- sys/fs/coda/coda_vnops.c (revision 199789) +++ sys/fs/coda/coda_vnops.c (working copy) @@ -260,7 +260,6 @@ coda_close(struct vop_close_args *ap) 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; @@ -276,7 +275,7 @@ coda_close(struct vop_close_args *ap) if (cp->c_ovp) { vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY); /* Do errors matter here? */ - VOP_CLOSE(cp->c_ovp, flag, cred, td); + VOP_CLOSE(cp->c_ovp, flag, cred); vput(cp->c_ovp); } #ifdef CODA_VERBOSE @@ -293,7 +292,7 @@ coda_close(struct vop_close_args *ap) --cp->c_owrite; if (!IS_UNMOUNTING(cp)) error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, - td->td_proc); + curproc); else error = ENODEV; CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error));); @@ -397,8 +396,7 @@ coda_rdwr(struct vnode *vp, struct uio *uiop, enum */ 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), cred); } /* @@ -1520,7 +1518,7 @@ coda_readdir(struct vop_readdir_args *ap) */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - (void)VOP_CLOSE(vp, FREAD, cred, td); + (void)VOP_CLOSE(vp, FREAD, cred); } return (error); } Index: sys/fs/devfs/devfs_vnops.c =================================================================== --- sys/fs/devfs/devfs_vnops.c (revision 199789) +++ sys/fs/devfs/devfs_vnops.c (working copy) @@ -453,7 +453,7 @@ static int devfs_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp, *oldvp; - struct thread *td = ap->a_td; + struct proc *p = curproc; struct cdev *dev = vp->v_rdev; struct cdevsw *dsw; int vp_locked, error; @@ -469,15 +469,15 @@ devfs_close(struct vop_close_args *ap) */ oldvp = NULL; sx_xlock(&proctree_lock); - if (td && vp == td->td_proc->p_session->s_ttyvp) { - SESS_LOCK(td->td_proc->p_session); + if (vp == p->p_session->s_ttyvp) { + SESS_LOCK(p->p_session); VI_LOCK(vp); if (count_dev(dev) == 2 && (vp->v_iflag & VI_DOOMED) == 0) { - td->td_proc->p_session->s_ttyvp = NULL; + p->p_session->s_ttyvp = NULL; oldvp = vp; } VI_UNLOCK(vp); - SESS_UNLOCK(td->td_proc->p_session); + SESS_UNLOCK(p->p_session); } sx_xunlock(&proctree_lock); if (oldvp != NULL) @@ -510,7 +510,7 @@ devfs_close(struct vop_close_args *ap) VOP_UNLOCK(vp, 0); KASSERT(dev->si_refcount > 0, ("devfs_close() on un-referenced struct cdev *(%s)", devtoname(dev))); - error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td); + error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, curthread); dev_relthread(dev); vn_lock(vp, vp_locked | LK_RETRY); vdrop(vp); Index: sys/fs/ntfs/ntfs_vnops.c =================================================================== --- sys/fs/ntfs/ntfs_vnops.c (revision 199789) +++ sys/fs/ntfs/ntfs_vnops.c (working copy) @@ -460,7 +460,6 @@ ntfs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { #ifdef NTFS_DEBUG Index: sys/fs/smbfs/smbfs_vnops.c =================================================================== --- sys/fs/smbfs/smbfs_vnops.c (revision 199789) +++ sys/fs/smbfs/smbfs_vnops.c (working copy) @@ -228,17 +228,15 @@ smbfs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; - struct thread *td = ap->a_td; struct smbnode *np = VTOSMB(vp); struct smb_cred scred; if (vp->v_type == VDIR && (np->n_flag & NOPEN) != 0 && np->n_dirseq != NULL) { - smb_makescred(&scred, td, ap->a_cred); + smb_makescred(&scred, curthread, ap->a_cred); smbfs_findclose(np->n_dirseq, &scred); np->n_dirseq = NULL; } @@ -391,7 +389,7 @@ smbfs_setattr(ap) VOP_GETATTR(vp, &vattr, ap->a_cred); */ if (mtime) np->n_mtime = *mtime; - VOP_CLOSE(vp, FWRITE, ap->a_cred, td); + VOP_CLOSE(vp, FWRITE, ap->a_cred); } } else if ((vcp->vc_sopt.sv_caps & SMB_CAP_NT_SMBS)) { error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred); Index: sys/fs/smbfs/smbfs_io.c =================================================================== --- sys/fs/smbfs/smbfs_io.c (revision 199789) +++ sys/fs/smbfs/smbfs_io.c (working copy) @@ -593,7 +593,7 @@ smbfs_putpages(ap) cred = td->td_ucred; /* XXX */ VOP_OPEN(vp, FWRITE, cred, td, NULL); error = vop_stdputpages(ap); - VOP_CLOSE(vp, FWRITE, cred, td); + VOP_CLOSE(vp, FWRITE, cred); return error; #else struct uio uio; @@ -641,7 +641,7 @@ smbfs_putpages(ap) smb_makescred(&scred, td, cred); error = smb_write(smp->sm_share, np->n_fid, &uio, &scred); -/* VOP_CLOSE(vp, FWRITE, cred, td);*/ +/* VOP_CLOSE(vp, FWRITE, cred);*/ SMBVDEBUG("paged write done: %d\n", error); pmap_qremove(kva, npages); Index: sys/fs/fifofs/fifo_vnops.c =================================================================== --- sys/fs/fifofs/fifo_vnops.c (revision 199789) +++ sys/fs/fifofs/fifo_vnops.c (working copy) @@ -394,7 +394,6 @@ fifo_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; Index: sys/fs/nwfs/nwfs_vnops.c =================================================================== --- sys/fs/nwfs/nwfs_vnops.c (revision 199789) +++ sys/fs/nwfs/nwfs_vnops.c (working copy) @@ -219,14 +219,14 @@ nwfs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *td; } */ *ap; { struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); + struct thread *td = curthread; int error; - NCPVNDEBUG("name=%s,pid=%d,c=%d\n", np->n_name, ap->a_td->td_proc->p_pid, + NCPVNDEBUG("name=%s,pid=%d,c=%d\n", np->n_name, td->td_proc->p_pid, np->opened); if (vp->v_type == VDIR) return 0; /* nothing to do now */ @@ -237,7 +237,7 @@ nwfs_close(ap) return 0; } mtx_unlock(&vp->v_interlock); - error = nwfs_vinvalbuf(vp, ap->a_td); + error = nwfs_vinvalbuf(vp, td); mtx_lock(&vp->v_interlock); if (np->opened == 0) { mtx_unlock(&vp->v_interlock); @@ -246,7 +246,7 @@ nwfs_close(ap) if (--np->opened == 0) { mtx_unlock(&vp->v_interlock); error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, - ap->a_td, ap->a_cred); + td, ap->a_cred); } else mtx_unlock(&vp->v_interlock); np->n_atime = 0; Index: sys/fs/nwfs/nwfs_io.c =================================================================== --- sys/fs/nwfs/nwfs_io.c (revision 199789) +++ sys/fs/nwfs/nwfs_io.c (working copy) @@ -529,7 +529,7 @@ nwfs_putpages(ap) cred = td->td_ucred; /* XXX */ VOP_OPEN(vp, FWRITE, cred, td, NULL); error = vop_stdputpages(ap); - VOP_CLOSE(vp, FWRITE, cred, td); + VOP_CLOSE(vp, FWRITE, cred); return error; #else struct uio uio; @@ -572,7 +572,7 @@ nwfs_putpages(ap) NCPVNDEBUG("ofs=%d,resid=%d\n",(int)uio.uio_offset, uio.uio_resid); error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, &uio, cred); -/* VOP_CLOSE(vp, FWRITE, cred, td);*/ +/* VOP_CLOSE(vp, FWRITE, cred);*/ NCPVNDEBUG("paged write done: %d\n", error); pmap_qremove(kva, npages); Index: sys/fs/msdosfs/msdosfs_vnops.c =================================================================== --- sys/fs/msdosfs/msdosfs_vnops.c (revision 199789) +++ sys/fs/msdosfs/msdosfs_vnops.c (working copy) @@ -228,7 +228,6 @@ msdosfs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; Index: sys/vm/swap_pager.c =================================================================== --- sys/vm/swap_pager.c (revision 199789) +++ sys/vm/swap_pager.c (working copy) @@ -2298,7 +2298,7 @@ swapoff_one(struct swdevt *sp, struct ucred *cred) */ swap_pager_swapoff(sp); - sp->sw_close(curthread, sp); + sp->sw_close(sp, cred); sp->sw_id = NULL; mtx_lock(&sw_dev_mtx); TAILQ_REMOVE(&swtailq, sp, sw_list); @@ -2529,7 +2529,7 @@ swapgeom_close_ev(void *arg, int flags) } static void -swapgeom_close(struct thread *td, struct swdevt *sw) +swapgeom_close(struct swdevt *sw, struct ucred *cred) { /* XXX: direct call when Giant untangled */ @@ -2645,10 +2645,10 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp } static void -swapdev_close(struct thread *td, struct swdevt *sp) +swapdev_close(struct swdevt *sp, struct ucred *cred) { - VOP_CLOSE(sp->sw_vp, FREAD | FWRITE, td->td_ucred, td); + VOP_CLOSE(sp->sw_vp, FREAD | FWRITE, cred); vrele(sp->sw_vp); } Index: sys/vm/swap_pager.h =================================================================== --- sys/vm/swap_pager.h (revision 199789) +++ sys/vm/swap_pager.h (working copy) @@ -48,7 +48,7 @@ typedef int32_t swblk_t; /* struct buf; struct swdevt; typedef void sw_strategy_t(struct buf *, struct swdevt *); -typedef void sw_close_t(struct thread *, struct swdevt *); +typedef void sw_close_t(struct swdevt *, struct ucred *); /* * Swap device table Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c (revision 199789) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c (working copy) @@ -75,7 +75,7 @@ vdev_file_open(vdev_t *vd, uint64_t *psize, uint64 * Make sure it's a regular file. */ if (vp->v_type != VREG) { - (void) VOP_CLOSE(vp, spa_mode, 1, 0, kcred, NULL); + (void) VOP_CLOSE(vp, spa_mode, 1, 0, kcred); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (ENODEV); } @@ -90,7 +90,7 @@ vdev_file_open(vdev_t *vd, uint64_t *psize, uint64 VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); if (error) { - (void) VOP_CLOSE(vp, spa_mode, 1, 0, kcred, NULL); + (void) VOP_CLOSE(vp, spa_mode, 1, 0, kcred); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (error); } @@ -110,7 +110,7 @@ vdev_file_close(vdev_t *vd) return; if (vf->vf_vnode != NULL) - (void) VOP_CLOSE(vf->vf_vnode, spa_mode, 1, 0, kcred, NULL); + (void) VOP_CLOSE(vf->vf_vnode, spa_mode, 1, 0, kcred); kmem_free(vf, sizeof (vdev_file_t)); vd->vdev_tsd = NULL; } Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c (revision 199789) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c (working copy) @@ -191,7 +191,7 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) { (void) vn_rename(temp, dp->scd_path, UIO_SYSSPACE); } - (void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL); + (void) VOP_CLOSE(vp, oflags, 1, 0, kcred); } (void) vn_remove(temp, UIO_SYSSPACE, RMFILE); Index: sys/cddl/compat/opensolaris/sys/vnode.h =================================================================== --- sys/cddl/compat/opensolaris/sys/vnode.h (revision 199789) +++ sys/cddl/compat/opensolaris/sys/vnode.h (working copy) @@ -266,7 +266,7 @@ zfs_vop_close(vnode_t *vp, int flag, int count, of VFS_UNLOCK_GIANT(vfslocked); return (error); } -#define VOP_CLOSE(vp, oflags, count, offset, cr, ct) \ +#define VOP_CLOSE(vp, oflags, count, offset, cr) \ zfs_vop_close((vp), (oflags), (count), (offset), (cr)) static __inline int