diff options
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs.h | 68 | ||||
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 292 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsock.c | 67 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsubs.c | 34 | ||||
-rw-r--r-- | sys/nfsserver/nfs_syscalls.c | 65 | ||||
-rw-r--r-- | sys/nfsserver/nfsrvstats.h | 68 |
6 files changed, 299 insertions, 295 deletions
diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h index 44d04b9..d5d0796 100644 --- a/sys/nfsserver/nfs.h +++ b/sys/nfsserver/nfs.h @@ -348,7 +348,7 @@ struct nfsreq { int r_timer; /* tick counter on reply */ u_int32_t r_procnum; /* NFS procedure number */ int r_rtt; /* RTT for rpc */ - struct proc *r_procp; /* Proc that did I/O system call */ + struct thread *r_td; /* Proc that did I/O system call */ }; /* @@ -469,7 +469,7 @@ struct nfsd { u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */ int nfsd_verflen; /* and the Verifier */ u_char nfsd_verfstr[RPCVERF_MAXSIZ]; - struct proc *nfsd_procp; /* Proc ptr */ + struct thread *nfsd_td; /* daemon thread ptr */ struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */ }; @@ -592,16 +592,16 @@ void nfs_sndunlock __P((struct nfsreq *)); int nfs_slplock __P((struct nfssvc_sock *, int)); void nfs_slpunlock __P((struct nfssvc_sock *)); int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); -int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *, +int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct thread *, int)); int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *)); int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *, int *)); int nfs_commit __P((struct vnode *vp, u_quad_t offset, int cnt, - struct ucred *cred, struct proc *procp)); + struct ucred *cred, struct thread *)); int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *)); -int nfs_asyncio __P((struct buf *, struct ucred *, struct proc *)); -int nfs_doio __P((struct buf *, struct ucred *, struct proc *)); +int nfs_asyncio __P((struct buf *, struct ucred *, struct thread *)); +int nfs_doio __P((struct buf *, struct ucred *, struct thread *)); int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *)); int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *)); int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *)); @@ -613,14 +613,14 @@ void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int, void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *, struct mbuf **, char **)); int netaddr_match __P((int, union nethostaddr *, struct sockaddr *)); -int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *, +int nfs_request __P((struct vnode *, struct mbuf *, int, struct thread *, struct ucred *, struct mbuf **, struct mbuf **, caddr_t *)); int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *, struct vattr *, int)); int nfs_namei __P((struct nameidata *, fhandle_t *, int, struct nfssvc_sock *, struct sockaddr *, struct mbuf **, - caddr_t *, struct vnode **, struct proc *, int, int)); + caddr_t *, struct vnode **, struct thread *, int, int)); void nfsm_adj __P((struct mbuf *, int, int)); int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *)); void nfsrv_initcache __P((void)); @@ -652,21 +652,21 @@ void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); void nfsrvw_sort __P((gid_t *, int)); void nfsrv_setcred __P((struct ucred *, struct ucred *)); -int nfs_writebp __P((struct buf *, int, struct proc *)); +int nfs_writebp __P((struct buf *, int, struct thread *)); int nfsrv_object_create __P((struct vnode *)); void nfsrv_wakenfsd __P((struct nfssvc_sock *slp)); int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *, - struct proc *, struct mbuf **)); + struct thread *, struct mbuf **)); int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *, - struct proc *p)); + struct thread *p)); int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *, struct nfssvc_sock *, struct sockaddr *, int *, int, int)); @@ -674,52 +674,52 @@ int nfsrv_setpublicfs __P((struct mount *, struct netexport *, struct export_args *)); int nfs_ispublicfh __P((fhandle_t *)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_pathconf __P((struct nfsrv_descript *nfsd, - struct nfssvc_sock *slp, struct proc *procp, + struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd, - struct nfssvc_sock *slp, struct proc *procp, + struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); int nfsrv_readlink __P((struct nfsrv_descript *nfsd, - struct nfssvc_sock *slp, struct proc *procp, + struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); #endif /* _KERNEL */ diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index e015d17..0469388 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -145,7 +145,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, 0, "") SYSCTL_INT(_vfs_nfs, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); static int nfsrv_access __P((struct vnode *,int,struct ucred *,int, - struct proc *, int)); + struct thread *, int)); static void nfsrvw_coalesce __P((struct nfsrv_descript *, struct nfsrv_descript *)); @@ -168,10 +168,10 @@ ndclear(struct nameidata *nd) * nfs v3 access service */ int -nfsrv3_access(nfsd, slp, procp, mrq) +nfsrv3_access(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -208,7 +208,7 @@ nfsrv3_access(nfsd, slp, procp, mrq) } nfsmode = fxdr_unsigned(u_int32_t, *tl); if ((nfsmode & NFSV3ACCESS_READ) && - nfsrv_access(vp, VREAD, cred, rdonly, procp, 0)) + nfsrv_access(vp, VREAD, cred, rdonly, td, 0)) nfsmode &= ~NFSV3ACCESS_READ; if (vp->v_type == VDIR) testmode = (NFSV3ACCESS_MODIFY | NFSV3ACCESS_EXTEND | @@ -216,16 +216,16 @@ nfsrv3_access(nfsd, slp, procp, mrq) else testmode = (NFSV3ACCESS_MODIFY | NFSV3ACCESS_EXTEND); if ((nfsmode & testmode) && - nfsrv_access(vp, VWRITE, cred, rdonly, procp, 0)) + nfsrv_access(vp, VWRITE, cred, rdonly, td, 0)) nfsmode &= ~testmode; if (vp->v_type == VDIR) testmode = NFSV3ACCESS_LOOKUP; else testmode = NFSV3ACCESS_EXECUTE; if ((nfsmode & testmode) && - nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0)) + nfsrv_access(vp, VEXEC, cred, rdonly, td, 0)) nfsmode &= ~testmode; - getret = VOP_GETATTR(vp, vap, cred, procp); + getret = VOP_GETATTR(vp, vap, cred, td); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED); @@ -242,10 +242,10 @@ nfsmout: * nfs getattr service */ int -nfsrv_getattr(nfsd, slp, procp, mrq) +nfsrv_getattr(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -277,7 +277,7 @@ nfsrv_getattr(nfsd, slp, procp, mrq) goto nfsmout; } nqsrv_getl(vp, ND_READ); - error = VOP_GETATTR(vp, vap, cred, procp); + error = VOP_GETATTR(vp, vap, cred, td); vput(vp); vp = NULL; nfsm_reply(NFSX_FATTR(nfsd->nd_flag & ND_NFSV3)); @@ -299,10 +299,10 @@ nfsmout: * nfs setattr service */ int -nfsrv_setattr(nfsd, slp, procp, mrq) +nfsrv_setattr(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -399,7 +399,7 @@ nfsrv_setattr(nfsd, slp, procp, mrq) nqsrv_getl(vp, ND_WRITE); if (v3) { - error = preat_ret = VOP_GETATTR(vp, &preat, cred, procp); + error = preat_ret = VOP_GETATTR(vp, &preat, cred, td); if (!error && gcheck && (preat.va_ctime.tv_sec != guard.tv_sec || preat.va_ctime.tv_nsec != guard.tv_nsec)) @@ -428,11 +428,11 @@ nfsrv_setattr(nfsd, slp, procp, mrq) error = EISDIR; goto out; } else if ((error = nfsrv_access(vp, VWRITE, cred, rdonly, - procp, 0)) != 0) + td, 0)) != 0) goto out; } - error = VOP_SETATTR(vp, vap, cred, procp); - postat_ret = VOP_GETATTR(vp, vap, cred, procp); + error = VOP_SETATTR(vp, vap, cred, td); + postat_ret = VOP_GETATTR(vp, vap, cred, td); if (!error) error = postat_ret; out: @@ -462,10 +462,10 @@ nfsmout: * nfs lookup rpc */ int -nfsrv_lookup(nfsd, slp, procp, mrq) +nfsrv_lookup(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -501,7 +501,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = LOOKUP; nd.ni_cnd.cn_flags = LOCKLEAF | SAVESTART; error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), pubflag); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), pubflag); /* * namei failure, only dirp to cleanup. Clear out garbarge from @@ -512,7 +512,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq) if (dirp) { if (v3) dirattr_ret = VOP_GETATTR(dirp, &dirattr, cred, - procp); + td); vrele(dirp); dirp = NULL; } @@ -544,7 +544,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq) * via the original nd. Confused? You aren't alone! */ ind = nd; - VOP_UNLOCK(nd.ni_vp, 0, procp); + VOP_UNLOCK(nd.ni_vp, 0, td); ind.ni_pathlen = strlen(nfs_pub.np_index); ind.ni_cnd.cn_nameptr = ind.ni_cnd.cn_pnbuf = nfs_pub.np_index; @@ -586,7 +586,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq) if (dirp) { if (v3) dirattr_ret = VOP_GETATTR(dirp, &dirattr, cred, - procp); + td); vrele(dirp); dirp = NULL; } @@ -624,7 +624,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq) fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, cred, procp); + error = VOP_GETATTR(vp, vap, cred, td); vput(vp); ndp->ni_vp = NULL; @@ -658,10 +658,10 @@ nfsmout: * nfs readlink service */ int -nfsrv_readlink(nfsd, slp, procp, mrq) +nfsrv_readlink(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -720,7 +720,7 @@ nfsrv_readlink(nfsd, slp, procp, mrq) uiop->uio_resid = len; uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; - uiop->uio_procp = (struct proc *)0; + uiop->uio_td = (struct thread *)0; error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, (nfsd->nd_flag & ND_KERBAUTH), TRUE); if (error) { @@ -739,7 +739,7 @@ nfsrv_readlink(nfsd, slp, procp, mrq) nqsrv_getl(vp, ND_READ); error = VOP_READLINK(vp, uiop, cred); out: - getret = VOP_GETATTR(vp, &attr, cred, procp); + getret = VOP_GETATTR(vp, &attr, cred, td); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_UNSIGNED); @@ -771,10 +771,10 @@ nfsmout: * nfs read service */ int -nfsrv_read(nfsd, slp, procp, mrq) +nfsrv_read(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -840,10 +840,10 @@ nfsrv_read(nfsd, slp, procp, mrq) } if (!error) { nqsrv_getl(vp, ND_READ); - if ((error = nfsrv_access(vp, VREAD, cred, rdonly, procp, 1)) != 0) - error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 1); + if ((error = nfsrv_access(vp, VREAD, cred, rdonly, td, 1)) != 0) + error = nfsrv_access(vp, VEXEC, cred, rdonly, td, 1); } - getret = VOP_GETATTR(vp, vap, cred, procp); + getret = VOP_GETATTR(vp, vap, cred, td); if (!error) error = getret; if (error) { @@ -982,7 +982,7 @@ nfsrv_read(nfsd, slp, procp, mrq) off = uiop->uio_offset; nh->nh_nextr = off; FREE((caddr_t)iv2, M_TEMP); - if (error || (getret = VOP_GETATTR(vp, vap, cred, procp))) { + if (error || (getret = VOP_GETATTR(vp, vap, cred, td))) { if (!error) error = getret; m_freem(mreq); @@ -1022,10 +1022,10 @@ nfsmout: * nfs write service */ int -nfsrv_write(nfsd, slp, procp, mrq) +nfsrv_write(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -1137,7 +1137,7 @@ nfsrv_write(nfsd, slp, procp, mrq) goto nfsmout; } if (v3) - forat_ret = VOP_GETATTR(vp, &forat, cred, procp); + forat_ret = VOP_GETATTR(vp, &forat, cred, td); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1146,7 +1146,7 @@ nfsrv_write(nfsd, slp, procp, mrq) } if (!error) { nqsrv_getl(vp, ND_WRITE); - error = nfsrv_access(vp, VWRITE, cred, rdonly, procp, 1); + error = nfsrv_access(vp, VWRITE, cred, rdonly, td, 1); } if (error) { vput(vp); @@ -1188,13 +1188,13 @@ nfsrv_write(nfsd, slp, procp, mrq) uiop->uio_resid = len; uiop->uio_rw = UIO_WRITE; uiop->uio_segflg = UIO_SYSSPACE; - uiop->uio_procp = (struct proc *)0; + uiop->uio_td = (struct thread *)0; uiop->uio_offset = off; error = VOP_WRITE(vp, uiop, ioflags, cred); nfsstats.srvvop_writes++; FREE((caddr_t)iv, M_TEMP); } - aftat_ret = VOP_GETATTR(vp, vap, cred, procp); + aftat_ret = VOP_GETATTR(vp, vap, cred, td); vput(vp); vp = NULL; if (!error) @@ -1246,10 +1246,10 @@ nfsmout: * Jan. 1994. */ int -nfsrv_writegather(ndp, slp, procp, mrq) +nfsrv_writegather(ndp, slp, td, mrq) struct nfsrv_descript **ndp; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { register struct iovec *ivp; @@ -1427,7 +1427,7 @@ loop1: nfsd->nd_nam, &rdonly, (nfsd->nd_flag & ND_KERBAUTH), TRUE); if (!error) { if (v3) - forat_ret = VOP_GETATTR(vp, &forat, cred, procp); + forat_ret = VOP_GETATTR(vp, &forat, cred, td); if (vp->v_type != VREG) { if (v3) error = EINVAL; @@ -1439,7 +1439,7 @@ loop1: } if (!error) { nqsrv_getl(vp, ND_WRITE); - error = nfsrv_access(vp, VWRITE, cred, rdonly, procp, 1); + error = nfsrv_access(vp, VWRITE, cred, rdonly, td, 1); } if (nfsd->nd_stable == NFSV3WRITE_UNSTABLE) @@ -1450,7 +1450,7 @@ loop1: ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED); uiop->uio_rw = UIO_WRITE; uiop->uio_segflg = UIO_SYSSPACE; - uiop->uio_procp = (struct proc *)0; + uiop->uio_td = (struct thread *)0; uiop->uio_offset = nfsd->nd_off; uiop->uio_resid = nfsd->nd_eoff - nfsd->nd_off; if (uiop->uio_resid > 0) { @@ -1476,9 +1476,9 @@ loop1: } if (!error) { if (vn_start_write(vp, &mntp, V_NOWAIT) != 0) { - VOP_UNLOCK(vp, 0, procp); + VOP_UNLOCK(vp, 0, td); error = vn_start_write(NULL, &mntp, V_WAIT); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, procp); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); } } if (!error) { @@ -1490,7 +1490,7 @@ loop1: } m_freem(mrep); if (vp) { - aftat_ret = VOP_GETATTR(vp, &va, cred, procp); + aftat_ret = VOP_GETATTR(vp, &va, cred, td); vput(vp); vp = NULL; } @@ -1631,10 +1631,10 @@ nfsrvw_coalesce(owp, nfsd) * now does a truncate to 0 length via. setattr if it already exists */ int -nfsrv_create(nfsd, slp, procp, mrq) +nfsrv_create(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -1696,11 +1696,11 @@ nfsrv_create(nfsd, slp, procp, mrq) * prior to calling nfsm_reply ( which might goto nfsmout ). */ error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - procp); + td); } else { vrele(dirp); dirp = NULL; @@ -1793,7 +1793,7 @@ nfsrv_create(nfsd, slp, procp, mrq) bcopy(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF); error = VOP_SETATTR(nd.ni_vp, vap, cred, - procp); + td); } } } else if ( @@ -1836,7 +1836,7 @@ nfsrv_create(nfsd, slp, procp, mrq) */ nd.ni_cnd.cn_nameiop = LOOKUP; nd.ni_cnd.cn_flags &= ~(LOCKPARENT); - nd.ni_cnd.cn_proc = procp; + nd.ni_cnd.cn_thread = td; nd.ni_cnd.cn_cred = cred; error = lookup(&nd); @@ -1857,14 +1857,14 @@ nfsrv_create(nfsd, slp, procp, mrq) } else { if (vap->va_size != -1) { error = nfsrv_access(nd.ni_vp, VWRITE, cred, - (nd.ni_cnd.cn_flags & RDONLY), procp, 0); + (nd.ni_cnd.cn_flags & RDONLY), td, 0); if (!error) { nqsrv_getl(nd.ni_vp, ND_WRITE); tempsize = vap->va_size; VATTR_NULL(vap); vap->va_size = tempsize; error = VOP_SETATTR(nd.ni_vp, vap, cred, - procp); + td); } } } @@ -1874,13 +1874,13 @@ nfsrv_create(nfsd, slp, procp, mrq) fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(nd.ni_vp, vap, cred, procp); + error = VOP_GETATTR(nd.ni_vp, vap, cred, td); } if (v3) { if (exclusive_flag && !error && bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF)) error = EEXIST; - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); vrele(dirp); dirp = NULL; } @@ -1930,10 +1930,10 @@ nfsmout: * nfs v3 mknod service */ int -nfsrv_mknod(nfsd, slp, procp, mrq) +nfsrv_mknod(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -1986,9 +1986,9 @@ nfsrv_mknod(nfsd, slp, procp, mrq) */ error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) - dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, procp); + dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, td); if (error) { nfsm_reply(NFSX_WCCDATA(1)); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -2046,8 +2046,8 @@ nfsrv_mknod(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = LOOKUP; nd.ni_cnd.cn_flags &= ~(LOCKPARENT); - nd.ni_cnd.cn_proc = procp; - nd.ni_cnd.cn_cred = procp->p_ucred; + nd.ni_cnd.cn_thread = td; + nd.ni_cnd.cn_cred = td->td_proc->p_ucred; error = lookup(&nd); nd.ni_dvp = NULL; @@ -2080,12 +2080,12 @@ out: fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(vp, vap, cred, procp); + error = VOP_GETATTR(vp, vap, cred, td); vput(vp); vp = NULL; nd.ni_vp = NULL; } - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); if (dirp) { vrele(dirp); dirp = NULL; @@ -2121,10 +2121,10 @@ nfsmout: * nfs remove service */ int -nfsrv_remove(nfsd, slp, procp, mrq) +nfsrv_remove(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -2169,11 +2169,11 @@ nfsrv_remove(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = DELETE; nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF; error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - procp); + td); } else { vrele(dirp); dirp = NULL; @@ -2200,7 +2200,7 @@ out: } } if (dirp && v3) { - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); vrele(dirp); dirp = NULL; } @@ -2228,10 +2228,10 @@ nfsmout: * nfs rename service */ int -nfsrv_rename(nfsd, slp, procp, mrq) +nfsrv_rename(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -2293,11 +2293,11 @@ nfsrv_rename(nfsd, slp, procp, mrq) fromnd.ni_cnd.cn_nameiop = DELETE; fromnd.ni_cnd.cn_flags = WANTPARENT | SAVESTART; error = nfs_namei(&fromnd, ffhp, len, slp, nam, &md, - &dpos, &fdirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dpos, &fdirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (fdirp) { if (v3) { fdirfor_ret = VOP_GETATTR(fdirp, &fdirfor, cred, - procp); + td); } else { vrele(fdirp); fdirp = NULL; @@ -2318,11 +2318,11 @@ nfsrv_rename(nfsd, slp, procp, mrq) tond.ni_cnd.cn_nameiop = RENAME; tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART; error = nfs_namei(&tond, tfhp, len2, slp, nam, &md, - &dpos, &tdirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dpos, &tdirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (tdirp) { if (v3) { tdirfor_ret = VOP_GETATTR(tdirp, &tdirfor, cred, - procp); + td); } else { vrele(tdirp); tdirp = NULL; @@ -2415,9 +2415,9 @@ out: out1: if (fdirp) - fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, cred, procp); + fdiraft_ret = VOP_GETATTR(fdirp, &fdiraft, cred, td); if (tdirp) - tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, cred, procp); + tdiraft_ret = VOP_GETATTR(tdirp, &tdiraft, cred, td); nfsm_reply(2 * NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft); @@ -2465,10 +2465,10 @@ nfsmout: * nfs link service */ int -nfsrv_link(nfsd, slp, procp, mrq) +nfsrv_link(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -2528,11 +2528,11 @@ nfsrv_link(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = CREATE; nd.ni_cnd.cn_flags = LOCKPARENT; error = nfs_namei(&nd, dfhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - procp); + td); } else { vrele(dirp); dirp = NULL; @@ -2560,9 +2560,9 @@ out: out1: if (v3) - getret = VOP_GETATTR(vp, &at, cred, procp); + getret = VOP_GETATTR(vp, &at, cred, td); if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); ereply: nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { @@ -2594,10 +2594,10 @@ nfsmout: * nfs symbolic link service */ int -nfsrv_symlink(nfsd, slp, procp, mrq) +nfsrv_symlink(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -2644,11 +2644,11 @@ nfsrv_symlink(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = CREATE; nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART; error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - procp); + td); } else { vrele(dirp); dirp = NULL; @@ -2670,7 +2670,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq) io.uio_iovcnt = 1; io.uio_segflg = UIO_SYSSPACE; io.uio_rw = UIO_READ; - io.uio_procp = (struct proc *)0; + io.uio_td = (struct thread *)0; nfsm_mtouio(&io, len2); if (!v3) { nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR); @@ -2712,7 +2712,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = LOOKUP; nd.ni_cnd.cn_flags &= ~(LOCKPARENT | FOLLOW); nd.ni_cnd.cn_flags |= (NOFOLLOW | LOCKLEAF); - nd.ni_cnd.cn_proc = procp; + nd.ni_cnd.cn_thread = td; nd.ni_cnd.cn_cred = cred; error = lookup(&nd); @@ -2724,7 +2724,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq) error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) error = VOP_GETATTR(nd.ni_vp, vap, cred, - procp); + td); vput(nd.ni_vp); nd.ni_vp = NULL; } @@ -2740,7 +2740,7 @@ out: pathcp = NULL; } if (dirp) { - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); vrele(dirp); dirp = NULL; } @@ -2784,10 +2784,10 @@ nfsmout: * nfs mkdir service */ int -nfsrv_mkdir(nfsd, slp, procp, mrq) +nfsrv_mkdir(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -2836,11 +2836,11 @@ nfsrv_mkdir(nfsd, slp, procp, mrq) nd.ni_cnd.cn_flags = LOCKPARENT; error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - procp); + td); } else { vrele(dirp); dirp = NULL; @@ -2890,11 +2890,11 @@ nfsrv_mkdir(nfsd, slp, procp, mrq) fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) - error = VOP_GETATTR(nd.ni_vp, vap, cred, procp); + error = VOP_GETATTR(nd.ni_vp, vap, cred, td); } out: if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); nfsm_reply(NFSX_SRVFH(v3) + NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { if (!error) { @@ -2935,10 +2935,10 @@ nfsmout: * nfs rmdir service */ int -nfsrv_rmdir(nfsd, slp, procp, mrq) +nfsrv_rmdir(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -2981,11 +2981,11 @@ nfsrv_rmdir(nfsd, slp, procp, mrq) nd.ni_cnd.cn_nameiop = DELETE; nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF; error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, - &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH), FALSE); + &dirp, td, (nfsd->nd_flag & ND_KERBAUTH), FALSE); if (dirp) { if (v3) { dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, - procp); + td); } else { vrele(dirp); dirp = NULL; @@ -3027,7 +3027,7 @@ out: NDFREE(&nd, NDF_ONLY_PNBUF); if (dirp) - diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); + diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); nfsm_reply(NFSX_WCCDATA(v3)); if (v3) { nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -3091,10 +3091,10 @@ struct flrep { }; int -nfsrv_readdir(nfsd, slp, procp, mrq) +nfsrv_readdir(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -3163,7 +3163,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq) nqsrv_getl(vp, ND_READ); if (v3) { - error = getret = VOP_GETATTR(vp, &at, cred, procp); + error = getret = VOP_GETATTR(vp, &at, cred, td); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3173,7 +3173,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq) #endif } if (!error) - error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0); + error = nfsrv_access(vp, VEXEC, cred, rdonly, td, 0); if (error) { vput(vp); vp = NULL; @@ -3182,7 +3182,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq) error = 0; goto nfsmout; } - VOP_UNLOCK(vp, 0, procp); + VOP_UNLOCK(vp, 0, td); /* * end section. Allocate rbuf and continue @@ -3197,9 +3197,9 @@ again: io.uio_resid = fullsiz; io.uio_segflg = UIO_SYSSPACE; io.uio_rw = UIO_READ; - io.uio_procp = (struct proc *)0; + io.uio_td = (struct thread *)0; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, procp); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3209,11 +3209,11 @@ again: if (!cookies && !error) error = NFSERR_PERM; if (v3) { - getret = VOP_GETATTR(vp, &at, cred, procp); + getret = VOP_GETATTR(vp, &at, cred, td); if (!error) error = getret; } - VOP_UNLOCK(vp, 0, procp); + VOP_UNLOCK(vp, 0, td); if (error) { vrele(vp); vp = NULL; @@ -3384,10 +3384,10 @@ nfsmout: } int -nfsrv_readdirplus(nfsd, slp, procp, mrq) +nfsrv_readdirplus(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -3445,7 +3445,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq) error = 0; goto nfsmout; } - error = getret = VOP_GETATTR(vp, &at, cred, procp); + error = getret = VOP_GETATTR(vp, &at, cred, td); #if 0 /* * XXX This check may be too strict for Solaris 2.5 clients. @@ -3455,7 +3455,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq) #endif if (!error) { nqsrv_getl(vp, ND_READ); - error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0); + error = nfsrv_access(vp, VEXEC, cred, rdonly, td, 0); } if (error) { vput(vp); @@ -3465,7 +3465,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq) error = 0; goto nfsmout; } - VOP_UNLOCK(vp, 0, procp); + VOP_UNLOCK(vp, 0, td); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; @@ -3476,17 +3476,17 @@ again: io.uio_resid = fullsiz; io.uio_segflg = UIO_SYSSPACE; io.uio_rw = UIO_READ; - io.uio_procp = (struct proc *)0; + io.uio_td = (struct thread *)0; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, procp); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; } error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (u_quad_t)io.uio_offset; - getret = VOP_GETATTR(vp, &at, cred, procp); - VOP_UNLOCK(vp, 0, procp); + getret = VOP_GETATTR(vp, &at, cred, td); + VOP_UNLOCK(vp, 0, td); if (!cookies && !error) error = NFSERR_PERM; if (!error) @@ -3603,7 +3603,7 @@ again: nvp = NULL; goto invalid; } - if (VOP_GETATTR(nvp, vap, cred, procp)) { + if (VOP_GETATTR(nvp, vap, cred, td)) { vput(nvp); nvp = NULL; goto invalid; @@ -3721,10 +3721,10 @@ nfsmout: * nfs commit service */ int -nfsrv_commit(nfsd, slp, procp, mrq) +nfsrv_commit(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -3778,7 +3778,7 @@ nfsrv_commit(nfsd, slp, procp, mrq) error = 0; goto nfsmout; } - for_ret = VOP_GETATTR(vp, &bfor, cred, procp); + for_ret = VOP_GETATTR(vp, &bfor, cred, td); if (cnt > MAX_COMMIT_COUNT) { /* @@ -3788,7 +3788,7 @@ nfsrv_commit(nfsd, slp, procp, mrq) (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) { vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); } - error = VOP_FSYNC(vp, cred, MNT_WAIT, procp); + error = VOP_FSYNC(vp, cred, MNT_WAIT, td); } else { /* * Locate and synchronously write any buffers that fall @@ -3846,7 +3846,7 @@ nfsrv_commit(nfsd, slp, procp, mrq) splx(s); } - aft_ret = VOP_GETATTR(vp, &aft, cred, procp); + aft_ret = VOP_GETATTR(vp, &aft, cred, td); vput(vp); vp = NULL; ereply: @@ -3872,10 +3872,10 @@ nfsmout: * nfs statfs service */ int -nfsrv_statfs(nfsd, slp, procp, mrq) +nfsrv_statfs(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -3913,8 +3913,8 @@ nfsrv_statfs(nfsd, slp, procp, mrq) goto nfsmout; } sf = &statfs; - error = VFS_STATFS(vp->v_mount, sf, procp); - getret = VOP_GETATTR(vp, &at, cred, procp); + error = VFS_STATFS(vp->v_mount, sf, td); + getret = VOP_GETATTR(vp, &at, cred, td); vput(vp); vp = NULL; nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_STATFS(v3)); @@ -3959,10 +3959,10 @@ nfsmout: * nfs fsinfo service */ int -nfsrv_fsinfo(nfsd, slp, procp, mrq) +nfsrv_fsinfo(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -3999,10 +3999,10 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq) } /* XXX Try to make a guess on the max file size. */ - VFS_STATFS(vp->v_mount, &sb, procp); + VFS_STATFS(vp->v_mount, &sb, td); maxfsize = (u_quad_t)0x80000000 * sb.f_bsize - 1; - getret = VOP_GETATTR(vp, &at, cred, procp); + getret = VOP_GETATTR(vp, &at, cred, td); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3FSINFO); @@ -4041,10 +4041,10 @@ nfsmout: * nfs pathconf service */ int -nfsrv_pathconf(nfsd, slp, procp, mrq) +nfsrv_pathconf(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; @@ -4086,7 +4086,7 @@ nfsrv_pathconf(nfsd, slp, procp, mrq) error = VOP_PATHCONF(vp, _PC_CHOWN_RESTRICTED, &chownres); if (!error) error = VOP_PATHCONF(vp, _PC_NO_TRUNC, ¬runc); - getret = VOP_GETATTR(vp, &at, cred, procp); + getret = VOP_GETATTR(vp, &at, cred, td); vput(vp); vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3PATHCONF); @@ -4120,10 +4120,10 @@ nfsmout: */ /* ARGSUSED */ int -nfsrv_null(nfsd, slp, procp, mrq) +nfsrv_null(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep; @@ -4145,10 +4145,10 @@ nfsrv_null(nfsd, slp, procp, mrq) */ /* ARGSUSED */ int -nfsrv_noop(nfsd, slp, procp, mrq) +nfsrv_noop(nfsd, slp, td, mrq) struct nfsrv_descript *nfsd; struct nfssvc_sock *slp; - struct proc *procp; + struct thread *td; struct mbuf **mrq; { struct mbuf *mrep = nfsd->nd_mrep; @@ -4184,12 +4184,12 @@ nfsrv_noop(nfsd, slp, procp, mrq) * will return EPERM instead of EACCESS. EPERM is always an error. */ static int -nfsrv_access(vp, flags, cred, rdonly, p, override) +nfsrv_access(vp, flags, cred, rdonly, td, override) register struct vnode *vp; int flags; register struct ucred *cred; int rdonly; - struct proc *p; + struct thread *td; int override; { struct vattr vattr; @@ -4220,10 +4220,10 @@ nfsrv_access(vp, flags, cred, rdonly, p, override) if (vp->v_flag & VTEXT) return (ETXTBSY); } - error = VOP_GETATTR(vp, &vattr, cred, p); + error = VOP_GETATTR(vp, &vattr, cred, td); if (error) return (error); - error = VOP_ACCESS(vp, flags, cred, p); + error = VOP_ACCESS(vp, flags, cred, td); /* * Allow certain operations for the owner (reads and writes * on files that are already open). diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index 5772e4b..8991672 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -149,7 +149,7 @@ int nfsrtton = 0; struct nfsrtt nfsrtt; struct callout_handle nfs_timer_handle; -static int nfs_msg __P((struct proc *,char *,char *)); +static int nfs_msg __P((struct thread *,char *,char *)); static int nfs_rcvlock __P((struct nfsreq *)); static void nfs_rcvunlock __P((struct nfsreq *)); static void nfs_realign __P((struct mbuf **pm, int hsiz)); @@ -162,7 +162,7 @@ static int nfsrv_getstream __P((struct nfssvc_sock *,int)); int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, - struct proc *procp, + struct thread *td, struct mbuf **mreqp)) = { nfsrv_null, nfsrv_getattr, @@ -207,12 +207,12 @@ nfs_connect(nmp, rep) int pktscale; struct sockaddr *saddr; struct sockaddr_in *sin; - struct proc *p = &proc0; /* only used for socreate and sobind */ + struct thread *td = thread0; /* only used for socreate and sobind */ nmp->nm_so = (struct socket *)0; saddr = nmp->nm_nam; error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, - nmp->nm_soproto, p); + nmp->nm_soproto, td); if (error) goto bad; so = nmp->nm_so; @@ -233,7 +233,7 @@ nfs_connect(nmp, rep) sopt.sopt_name = IP_PORTRANGE; sopt.sopt_val = (void *)&ip; sopt.sopt_valsize = sizeof(ip); - sopt.sopt_p = NULL; + sopt.sopt_td = NULL; error = sosetopt(so, &sopt); if (error) goto bad; @@ -243,7 +243,7 @@ nfs_connect(nmp, rep) sin->sin_family = AF_INET; sin->sin_addr.s_addr = INADDR_ANY; sin->sin_port = htons(0); - error = sobind(so, (struct sockaddr *)sin, p); + error = sobind(so, (struct sockaddr *)sin, td); if (error) goto bad; bzero(&sopt, sizeof sopt); @@ -253,7 +253,7 @@ nfs_connect(nmp, rep) sopt.sopt_name = IP_PORTRANGE; sopt.sopt_val = (void *)&ip; sopt.sopt_valsize = sizeof(ip); - sopt.sopt_p = NULL; + sopt.sopt_td = NULL; error = sosetopt(so, &sopt); if (error) goto bad; @@ -269,7 +269,7 @@ nfs_connect(nmp, rep) goto bad; } } else { - error = soconnect(so, nmp->nm_nam, p); + error = soconnect(so, nmp->nm_nam, td); if (error) goto bad; @@ -284,7 +284,8 @@ nfs_connect(nmp, rep) "nfscon", 2 * hz); if ((so->so_state & SS_ISCONNECTING) && so->so_error == 0 && rep && - (error = nfs_sigintr(nmp, rep, rep->r_procp)) != 0){ + (error = nfs_sigintr(nmp, rep, + (rep->r_td ? rep->r_td->td_proc : NULL))) != 0){ so->so_state &= ~SS_ISCONNECTING; splx(s); goto bad; @@ -489,7 +490,7 @@ nfs_send(so, nam, top, rep) flags = 0; error = so->so_proto->pr_usrreqs->pru_sosend(so, sendnam, 0, top, 0, - flags, curproc /*XXX*/); + flags, curthread /*XXX*/); /* * ENOBUFS for dgram sockets is transient and non fatal. * No need to log, and no need to break a soft mount. @@ -547,7 +548,7 @@ nfs_receive(rep, aname, mp) u_int32_t len; struct sockaddr **getnam; int error, sotype, rcvflg; - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ /* * Set up arguments for soreceive() @@ -614,7 +615,7 @@ tryagain: auio.uio_rw = UIO_READ; auio.uio_offset = 0; auio.uio_resid = sizeof(u_int32_t); - auio.uio_procp = p; + auio.uio_td = td; do { rcvflg = MSG_WAITALL; error = so->so_proto->pr_usrreqs->pru_soreceive @@ -682,7 +683,7 @@ tryagain: * on. */ auio.uio_resid = len = 100000000; /* Anything Big */ - auio.uio_procp = p; + auio.uio_td = td; do { rcvflg = 0; error = so->so_proto->pr_usrreqs->pru_soreceive @@ -727,7 +728,7 @@ errout: else getnam = aname; auio.uio_resid = len = 1000000; - auio.uio_procp = p; + auio.uio_td = td; do { rcvflg = 0; error = so->so_proto->pr_usrreqs->pru_soreceive @@ -937,11 +938,11 @@ nfsmout: * nb: always frees up mreq mbuf list */ int -nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp) +nfs_request(vp, mrest, procnum, td, cred, mrp, mdp, dposp) struct vnode *vp; struct mbuf *mrest; int procnum; - struct proc *procp; + struct thread *td; struct ucred *cred; struct mbuf **mrp; struct mbuf **mdp; @@ -969,7 +970,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp) MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq), M_NFSREQ, M_WAITOK); rep->r_nmp = nmp; rep->r_vp = vp; - rep->r_procp = procp; + rep->r_td = td; rep->r_procnum = procnum; i = 0; m = mrest; @@ -1100,7 +1101,7 @@ tryagain: * tprintf a response. */ if (!error && (rep->r_flags & R_TPRINTFMSG)) - nfs_msg(rep->r_procp, nmp->nm_mountp->mnt_stat.f_mntfromname, + nfs_msg(rep->r_td, nmp->nm_mountp->mnt_stat.f_mntfromname, "is alive again"); mrep = rep->r_mrep; md = rep->r_md; @@ -1394,14 +1395,15 @@ nfs_timer(arg) register struct nfssvc_sock *slp; u_quad_t cur_usec; #endif /* NFS_NOSERVER */ - struct proc *p = &proc0; /* XXX for credentials, will break if sleep */ + struct thread *td = thread0; /* XXX for credentials, will break if sleep */ s = splnet(); for (rep = nfs_reqq.tqh_first; rep != 0; rep = rep->r_chain.tqe_next) { nmp = rep->r_nmp; if (rep->r_mrep || (rep->r_flags & R_SOFTTERM)) continue; - if (nfs_sigintr(nmp, rep, rep->r_procp)) { + if (nfs_sigintr(nmp, rep, + (rep->r_td ? rep->r_td->td_proc : NULL))) { nfs_softterm(rep); continue; } @@ -1423,7 +1425,7 @@ nfs_timer(arg) */ if ((rep->r_flags & R_TPRINTFMSG) == 0 && rep->r_rexmit > nmp->nm_deadthresh) { - nfs_msg(rep->r_procp, + nfs_msg(rep->r_td, nmp->nm_mountp->mnt_stat.f_mntfromname, "not responding"); rep->r_flags |= R_TPRINTFMSG; @@ -1455,11 +1457,11 @@ nfs_timer(arg) if ((nmp->nm_flag & NFSMNT_NOCONN) == 0) error = (*so->so_proto->pr_usrreqs->pru_send) (so, 0, m, (struct sockaddr *)0, - (struct mbuf *)0, p); + (struct mbuf *)0, td); else error = (*so->so_proto->pr_usrreqs->pru_send) (so, 0, m, nmp->nm_nam, (struct mbuf *)0, - p); + td); if (error) { if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) so->so_error = 0; @@ -1566,17 +1568,17 @@ nfs_sndlock(rep) struct nfsreq *rep; { register int *statep = &rep->r_nmp->nm_state; - struct proc *p; + struct thread *td; int slpflag = 0, slptimeo = 0; if (rep) { - p = rep->r_procp; + td = rep->r_td; if (rep->r_nmp->nm_flag & NFSMNT_INT) slpflag = PCATCH; } else - p = (struct proc *)0; + td = (struct thread *)0; while (*statep & NFSSTA_SNDLOCK) { - if (nfs_sigintr(rep->r_nmp, rep, p)) + if (nfs_sigintr(rep->r_nmp, rep, td ? td->td_proc : NULL)) return (EINTR); *statep |= NFSSTA_WANTSND; (void) tsleep((caddr_t)statep, slpflag | (PZERO - 1), @@ -1620,7 +1622,8 @@ nfs_rcvlock(rep) else slpflag = 0; while (*statep & NFSSTA_RCVLOCK) { - if (nfs_sigintr(rep->r_nmp, rep, rep->r_procp)) + if (nfs_sigintr(rep->r_nmp, rep, + (rep->r_td ? rep->r_td->td_proc : NULL))) return (EINTR); *statep |= NFSSTA_WANTRCV; (void) tsleep((caddr_t)statep, slpflag | (PZERO - 1), "nfsrcvlk", @@ -1966,12 +1969,12 @@ nfsmout: #endif static int -nfs_msg(p, server, msg) - struct proc *p; +nfs_msg(td, server, msg) + struct thread *td; char *server, *msg; { - tprintf(p, LOG_INFO, "nfs server %s: %s\n", server, msg); + tprintf(td->td_proc, LOG_INFO, "nfs server %s: %s\n", server, msg); return (0); } @@ -2005,7 +2008,7 @@ nfsrv_rcv(so, arg, waitflag) slp->ns_flag |= SLP_NEEDQ; goto dorecs; } #endif - auio.uio_procp = NULL; + auio.uio_td = NULL; if (so->so_type == SOCK_STREAM) { /* * If there are already records on the queue, defer soreceive() diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index ad8891c..4425129 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -554,11 +554,11 @@ extern struct nfsnodehashhead *nfsnodehashtbl; extern u_long nfsnodehash; struct nfssvc_args; -extern int nfssvc(struct proc *, struct nfssvc_args *, int *); +extern int nfssvc(struct thread *, struct nfssvc_args *, int *); LIST_HEAD(nfsnodehashhead, nfsnode); -int nfs_webnamei __P((struct nameidata *, struct vnode *, struct proc *)); +int nfs_webnamei __P((struct nameidata *, struct vnode *, struct thread *)); u_quad_t nfs_curusec() @@ -950,7 +950,7 @@ nfsm_disct(mdp, dposp, siz, left, cp2) { register struct mbuf *mp, *mp2; register int siz2, xfer; - register caddr_t p; + register caddr_t ptr; mp = *mdp; while (left == 0) { @@ -973,10 +973,10 @@ nfsm_disct(mdp, dposp, siz, left, cp2) mp->m_next = mp2; mp->m_len -= left; mp = mp2; - *cp2 = p = mtod(mp, caddr_t); - bcopy(*dposp, p, left); /* Copy what was left */ + *cp2 = ptr = mtod(mp, caddr_t); + bcopy(*dposp, ptr, left); /* Copy what was left */ siz2 = siz-left; - p += left; + ptr += left; mp2 = mp->m_next; /* Loop around copying up the siz2 bytes */ while (siz2 > 0) { @@ -984,10 +984,10 @@ nfsm_disct(mdp, dposp, siz, left, cp2) return (EBADRPC); xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2; if (xfer > 0) { - bcopy(mtod(mp2, caddr_t), p, xfer); + bcopy(mtod(mp2, caddr_t), ptr, xfer); NFSMADV(mp2, xfer); mp2->m_len -= xfer; - p += xfer; + ptr += xfer; siz2 -= xfer; } if (siz2 > 0) @@ -1464,7 +1464,7 @@ nfs_getattrcache(vp, vaper) * released by the caller. */ int -nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) +nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, td, kerbflag, pubflag) register struct nameidata *ndp; fhandle_t *fhp; int len; @@ -1473,7 +1473,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) struct mbuf **mdp; caddr_t *dposp; struct vnode **retdirp; - struct proc *p; + struct thread *td; int kerbflag, pubflag; { register int i, rem; @@ -1613,7 +1613,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) * becuase lookup() will dereference ni_startdir. */ - cnp->cn_proc = p; + cnp->cn_thread = td; VREF(dp); ndp->ni_startdir = dp; @@ -1649,7 +1649,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) * Validate symlink */ if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1) - VOP_UNLOCK(ndp->ni_dvp, 0, p); + VOP_UNLOCK(ndp->ni_dvp, 0, td); if (!pubflag) { error = EINVAL; goto badlink2; @@ -1670,7 +1670,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_procp = (struct proc *)0; + auio.uio_td = (struct thread *)0; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { @@ -1924,7 +1924,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag) int kerbflag; int pubflag; { - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ register struct mount *mp; register int i; struct ucred *credanon; @@ -1988,7 +1988,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag) nfsrv_object_create(*vpp); if (!lockflag) - VOP_UNLOCK(*vpp, 0, p); + VOP_UNLOCK(*vpp, 0, td); return (0); } @@ -2196,8 +2196,8 @@ nfsrv_object_create(vp) if (vp == NULL || vp->v_type != VREG) return (1); - return (vfs_object_create(vp, curproc, - curproc ? curproc->p_ucred : NULL)); + return (vfs_object_create(vp, curthread, + curthread ? curthread->td_proc->p_ucred : NULL)); } /* diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index e378cc5..657f299 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -78,7 +78,7 @@ static MALLOC_DEFINE(M_NFSSVC, "NFS srvsock", "Nfs server structure"); /* Global defs. */ extern int32_t (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, - struct proc *procp, + struct thread *td, struct mbuf **mreqp)); extern int nfs_numasync; extern time_t nqnfsstarttime; @@ -92,7 +92,7 @@ static int nuidhash_max = NFS_MAXUIDHASH; #ifndef NFS_NOSERVER static void nfsrv_zapsock __P((struct nfssvc_sock *slp)); #endif -static int nfssvc_iod __P((struct proc *)); +static int nfssvc_iod __P((struct thread *)); #define TRUE 1 #define FALSE 0 @@ -110,8 +110,9 @@ static int modify_flag = 0; static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd, int cacherep)); static int nfssvc_addsock __P((struct file *, struct sockaddr *, - struct proc *)); -static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); + struct thread *)); +static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t, + struct thread *)); static int nfs_privport = 0; SYSCTL_INT(_vfs_nfs, NFS_NFSPRIVPORT, nfs_privport, CTLFLAG_RW, &nfs_privport, 0, ""); @@ -140,8 +141,8 @@ struct nfssvc_args { * MPSAFE */ int -nfssvc(p, uap) - struct proc *p; +nfssvc(td, uap) + struct thread *td; register struct nfssvc_args *uap; { #ifndef NFS_NOSERVER @@ -165,13 +166,13 @@ nfssvc(p, uap) error = copyin(uap->argp, &la, sizeof(la)); if (error == 0) - error = nfslockdans(p, &la); + error = nfslockdans(td->td_proc, &la); goto done2; } /* * Must be super user */ - error = suser(p); + error = suser_td(td); if (error) goto done2; while (nfssvc_sockhead_flag & SLP_INIT) { @@ -179,7 +180,7 @@ nfssvc(p, uap) (void) tsleep((caddr_t)&nfssvc_sockhead, PSOCK, "nfsd init", 0); } if (uap->flag & NFSSVC_BIOD) - error = nfssvc_iod(p); + error = nfssvc_iod(td); #ifdef NFS_NOSERVER else error = ENXIO; @@ -189,7 +190,7 @@ nfssvc(p, uap) if (error) goto done2; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, - ncd.ncd_dirp, p); + ncd.ncd_dirp, td); error = namei(&nd); if (error) goto done2; @@ -206,13 +207,13 @@ nfssvc(p, uap) goto done2; } nmp->nm_state |= NFSSTA_MNTD; - error = nqnfs_clientd(nmp, p->p_ucred, &ncd, uap->flag, - uap->argp, p); + error = nqnfs_clientd(nmp, td->td_proc->p_ucred, &ncd, uap->flag, + uap->argp, td); } else if (uap->flag & NFSSVC_ADDSOCK) { error = copyin(uap->argp, (caddr_t)&nfsdarg, sizeof(nfsdarg)); if (error) goto done2; - error = holdsock(p->p_fd, nfsdarg.sock, &fp); + error = holdsock(td->td_proc->p_fd, nfsdarg.sock, &fp); if (error) goto done2; /* @@ -224,12 +225,12 @@ nfssvc(p, uap) error = getsockaddr(&nam, nfsdarg.name, nfsdarg.namelen); if (error) { - fdrop(fp, p); + fdrop(fp, td); goto done2; } } - error = nfssvc_addsock(fp, nam, p); - fdrop(fp, p); + error = nfssvc_addsock(fp, nam, td); + fdrop(fp, td); } else { error = copyin(uap->argp, (caddr_t)nsd, sizeof (*nsd)); if (error) @@ -327,7 +328,7 @@ nfssvc(p, uap) } if ((uap->flag & NFSSVC_AUTHINFAIL) && (nfsd = nsd->nsd_nfsd)) nfsd->nfsd_flag |= NFSD_AUTHFAIL; - error = nfssvc_nfsd(nsd, uap->argp, p); + error = nfssvc_nfsd(nsd, uap->argp, td); } #endif /* NFS_NOSERVER */ if (error == EINTR || error == ERESTART) @@ -342,10 +343,10 @@ done2: * Adds a socket to the list for servicing by nfsds. */ static int -nfssvc_addsock(fp, mynam, p) +nfssvc_addsock(fp, mynam, td) struct file *fp; struct sockaddr *mynam; - struct proc *p; + struct thread *td; { register int siz; register struct nfssvc_sock *slp; @@ -439,10 +440,10 @@ nfssvc_addsock(fp, mynam, p) * until it is killed by a signal. */ static int -nfssvc_nfsd(nsd, argp, p) +nfssvc_nfsd(nsd, argp, td) struct nfsd_srvargs *nsd; caddr_t argp; - struct proc *p; + struct thread *td; { register int siz; register struct nfssvc_sock *slp; @@ -461,7 +462,7 @@ nfssvc_nfsd(nsd, argp, p) nsd->nsd_nfsd = nfsd = (struct nfsd *) malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO); s = splnet(); - nfsd->nfsd_procp = p; + nfsd->nfsd_td = td; TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain); nfs_numnfsd++; } else @@ -622,10 +623,10 @@ nfssvc_nfsd(nsd, argp, p) if (writes_todo || (nd->nd_procnum == NFSPROC_WRITE && procrastinate > 0 && !notstarted)) error = nfsrv_writegather(&nd, slp, - nfsd->nfsd_procp, &mreq); + nfsd->nfsd_td, &mreq); else error = (*(nfsrv3_procs[nd->nd_procnum]))(nd, - slp, nfsd->nfsd_procp, &mreq); + slp, nfsd->nfsd_td, &mreq); if (mreq == NULL) break; if (error != 0 && error != NFSERR_RETVOID) { @@ -757,7 +758,7 @@ nfsrv_zapsock(slp) so->so_upcall = NULL; so->so_upcallarg = NULL; soshutdown(so, 2); - closef(fp, (struct proc *)0); + closef(fp, (struct thread *)0); if (slp->ns_nam) FREE(slp->ns_nam, M_SONAME); m_freem(slp->ns_raw); @@ -935,8 +936,8 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, ""); * Never returns unless it fails or gets killed. */ static int -nfssvc_iod(p) - struct proc *p; +nfssvc_iod(td) + struct thread *td; { register struct buf *bp; register int i, myiod; @@ -965,7 +966,7 @@ nfssvc_iod(p) && error == 0) { if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = p; + nfs_iodwant[myiod] = td->td_proc; nfs_iodmount[myiod] = NULL; error = tsleep((caddr_t)&nfs_iodwant[myiod], PWAIT | PCATCH, "nfsidl", 0); @@ -988,9 +989,9 @@ nfssvc_iod(p) wakeup(&nmp->nm_bufq); } if (bp->b_iocmd == BIO_READ) - (void) nfs_doio(bp, bp->b_rcred, (struct proc *)0); + (void) nfs_doio(bp, bp->b_rcred, (struct thread *)0); else - (void) nfs_doio(bp, bp->b_wcred, (struct proc *)0); + (void) nfs_doio(bp, bp->b_wcred, (struct thread *)0); /* * If there are more than one iod on this mount, then defect * so that the iods can be shared out fairly between the mounts @@ -1029,7 +1030,7 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key) nmp->nm_state |= NFSSTA_WANTAUTH; (void) tsleep((caddr_t)&nmp->nm_authtype, PSOCK, "nfsauth1", 2 * hz); - error = nfs_sigintr(nmp, rep, rep->r_procp); + error = nfs_sigintr(nmp, rep, rep->r_td->td_proc); if (error) { nmp->nm_state &= ~NFSSTA_WANTAUTH; return (error); @@ -1049,7 +1050,7 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key) while ((nmp->nm_state & NFSSTA_HASAUTH) == 0 && error == 0) { (void) tsleep((caddr_t)&nmp->nm_authlen, PSOCK, "nfsauth2", 2 * hz); - error = nfs_sigintr(nmp, rep, rep->r_procp); + error = nfs_sigintr(nmp, rep, rep->r_td->td_proc); } if (nmp->nm_state & NFSSTA_AUTHERR) { nmp->nm_state &= ~NFSSTA_AUTHERR; diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h index 44d04b9..d5d0796 100644 --- a/sys/nfsserver/nfsrvstats.h +++ b/sys/nfsserver/nfsrvstats.h @@ -348,7 +348,7 @@ struct nfsreq { int r_timer; /* tick counter on reply */ u_int32_t r_procnum; /* NFS procedure number */ int r_rtt; /* RTT for rpc */ - struct proc *r_procp; /* Proc that did I/O system call */ + struct thread *r_td; /* Proc that did I/O system call */ }; /* @@ -469,7 +469,7 @@ struct nfsd { u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */ int nfsd_verflen; /* and the Verifier */ u_char nfsd_verfstr[RPCVERF_MAXSIZ]; - struct proc *nfsd_procp; /* Proc ptr */ + struct thread *nfsd_td; /* daemon thread ptr */ struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */ }; @@ -592,16 +592,16 @@ void nfs_sndunlock __P((struct nfsreq *)); int nfs_slplock __P((struct nfssvc_sock *, int)); void nfs_slpunlock __P((struct nfssvc_sock *)); int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); -int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *, +int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct thread *, int)); int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *)); int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *, int *)); int nfs_commit __P((struct vnode *vp, u_quad_t offset, int cnt, - struct ucred *cred, struct proc *procp)); + struct ucred *cred, struct thread *)); int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *)); -int nfs_asyncio __P((struct buf *, struct ucred *, struct proc *)); -int nfs_doio __P((struct buf *, struct ucred *, struct proc *)); +int nfs_asyncio __P((struct buf *, struct ucred *, struct thread *)); +int nfs_doio __P((struct buf *, struct ucred *, struct thread *)); int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *)); int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *)); int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *)); @@ -613,14 +613,14 @@ void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int, void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *, struct mbuf **, char **)); int netaddr_match __P((int, union nethostaddr *, struct sockaddr *)); -int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *, +int nfs_request __P((struct vnode *, struct mbuf *, int, struct thread *, struct ucred *, struct mbuf **, struct mbuf **, caddr_t *)); int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *, struct vattr *, int)); int nfs_namei __P((struct nameidata *, fhandle_t *, int, struct nfssvc_sock *, struct sockaddr *, struct mbuf **, - caddr_t *, struct vnode **, struct proc *, int, int)); + caddr_t *, struct vnode **, struct thread *, int, int)); void nfsm_adj __P((struct mbuf *, int, int)); int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *)); void nfsrv_initcache __P((void)); @@ -652,21 +652,21 @@ void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); void nfsrvw_sort __P((gid_t *, int)); void nfsrv_setcred __P((struct ucred *, struct ucred *)); -int nfs_writebp __P((struct buf *, int, struct proc *)); +int nfs_writebp __P((struct buf *, int, struct thread *)); int nfsrv_object_create __P((struct vnode *)); void nfsrv_wakenfsd __P((struct nfssvc_sock *slp)); int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *, - struct proc *, struct mbuf **)); + struct thread *, struct mbuf **)); int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *, - struct proc *p)); + struct thread *p)); int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *, struct nfssvc_sock *, struct sockaddr *, int *, int, int)); @@ -674,52 +674,52 @@ int nfsrv_setpublicfs __P((struct mount *, struct netexport *, struct export_args *)); int nfs_ispublicfh __P((fhandle_t *)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_pathconf __P((struct nfsrv_descript *nfsd, - struct nfssvc_sock *slp, struct proc *procp, + struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd, - struct nfssvc_sock *slp, struct proc *procp, + struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); int nfsrv_readlink __P((struct nfsrv_descript *nfsd, - struct nfssvc_sock *slp, struct proc *procp, + struct nfssvc_sock *slp, struct thread *td, struct mbuf **mrq)); int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct proc *procp, struct mbuf **mrq)); + struct thread *td, struct mbuf **mrq)); void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); #endif /* _KERNEL */ |