Date: Mon, 4 Mar 2019 13:12:23 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344759 - in head/sys/fs: nfs nfsserver Message-ID: <201903041312.x24DCNo8099855@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Mar 4 13:12:23 2019 New Revision: 344759 URL: https://svnweb.freebsd.org/changeset/base/344759 Log: Push down the thread argument in NFS server code, using curthread instead of passing it explicitly. No functional changes Reviewed by: rmacklem (earlier version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19419 Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Mon Mar 4 13:02:36 2019 (r344758) +++ head/sys/fs/nfs/nfs_var.h Mon Mar 4 13:12:23 2019 (r344759) @@ -171,115 +171,107 @@ int nfsrv_mdscopymr(char *, char *, char *, char *, in /* nfs_nfsdserv.c */ int nfsrvd_access(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_getattr(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_setattr(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_lookup(struct nfsrv_descript *, int, - vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *, - struct nfsexstuff *); + vnode_t, vnode_t *, fhandle_t *, struct nfsexstuff *); int nfsrvd_readlink(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_read(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_write(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_create(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_mknod(struct nfsrv_descript *, int, - vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *, - struct nfsexstuff *); + vnode_t, vnode_t *, fhandle_t *, struct nfsexstuff *); int nfsrvd_remove(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_rename(struct nfsrv_descript *, int, - vnode_t, vnode_t, NFSPROC_T *, struct nfsexstuff *, - struct nfsexstuff *); + vnode_t, vnode_t, struct nfsexstuff *, struct nfsexstuff *); int nfsrvd_link(struct nfsrv_descript *, int, - vnode_t, vnode_t, NFSPROC_T *, struct nfsexstuff *, - struct nfsexstuff *); + vnode_t, vnode_t, struct nfsexstuff *, struct nfsexstuff *); int nfsrvd_symlink(struct nfsrv_descript *, int, - vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *, - struct nfsexstuff *); + vnode_t, vnode_t *, fhandle_t *, struct nfsexstuff *); int nfsrvd_mkdir(struct nfsrv_descript *, int, - vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *, - struct nfsexstuff *); + vnode_t, vnode_t *, fhandle_t *, struct nfsexstuff *); int nfsrvd_readdir(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_readdirplus(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_commit(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_statfs(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_fsinfo(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_close(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_delegpurge(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_delegreturn(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_getfh(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_lock(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_lockt(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_locku(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_openconfirm(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_opendowngrade(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_renew(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_secinfo(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_setclientid(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_setclientidcfrm(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_verify(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_open(struct nfsrv_descript *, int, - vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *, - struct nfsexstuff *); + vnode_t, vnode_t *, fhandle_t *, struct nfsexstuff *); int nfsrvd_openattr(struct nfsrv_descript *, int, - vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *, - struct nfsexstuff *); + vnode_t, vnode_t *, fhandle_t *, struct nfsexstuff *); int nfsrvd_releaselckown(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_pathconf(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_exchangeid(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_createsession(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_sequence(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_destroyclientid(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_bindconnsess(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_destroysession(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_freestateid(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_layoutget(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_getdevinfo(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_layoutcommit(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_layoutreturn(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_teststateid(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); int nfsrvd_notsupp(struct nfsrv_descript *, int, - vnode_t, NFSPROC_T *, struct nfsexstuff *); + vnode_t, struct nfsexstuff *); /* nfs_nfsdsocket.c */ void nfsrvd_rephead(struct nfsrv_descript *); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Mar 4 13:02:36 2019 (r344758) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Mar 4 13:12:23 2019 (r344759) @@ -1813,7 +1813,7 @@ nfsvno_fillattr(struct nfsrv_descript *nd, struct moun */ int nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram, - struct vnode *vp, struct thread *p, struct nfsexstuff *exp) + struct vnode *vp, struct nfsexstuff *exp) { struct dirent *dp; u_int32_t *tl; @@ -1827,6 +1827,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram, struct uio io; struct iovec iv; int is_ufs; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -2057,7 +2058,7 @@ nfsmout: */ int nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, - struct vnode *vp, struct thread *p, struct nfsexstuff *exp) + struct vnode *vp, struct nfsexstuff *exp) { struct dirent *dp; u_int32_t *tl; @@ -2080,6 +2081,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg int at_root, is_ufs, is_zfs, needs_unbusy, supports_nfsv4acls; struct mount *mp, *new_mp; uint64_t mounted_on_fileno; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Mon Mar 4 13:02:36 2019 (r344758) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Mon Mar 4 13:12:23 2019 (r344759) @@ -101,13 +101,14 @@ static void nfsrvd_mkdirsub(struct nfsrv_descript *nd, */ APPLESTATIC int nfsrvd_access(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { u_int32_t *tl; int getret, error = 0; struct nfsvattr nva; u_int32_t testmode, nfsmode, supported = 0; accmode_t deletebit; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, 1, &nva); @@ -188,7 +189,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { struct nfsvattr nva; fhandle_t fh; @@ -200,6 +201,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, struct vattr va; uint64_t mounted_on_fileno = 0; accmode_t accmode; + struct thread *p = curthread; if (nd->nd_repstat) goto out; @@ -314,7 +316,7 @@ out: */ APPLESTATIC int nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { struct nfsvattr nva, nva2; u_int32_t *tl; @@ -324,6 +326,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int nfsattrbit_t attrbits, retbits; nfsv4stateid_t stateid; NFSACL_T *aclp = NULL; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, preat_ret, &nva2, postat_ret, &nva); @@ -522,8 +525,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - struct nfsexstuff *exp) + vnode_t dp, vnode_t *vpp, fhandle_t *fhp, struct nfsexstuff *exp) { struct nameidata named; vnode_t vp, dirp = NULL; @@ -531,6 +533,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int struct nfsvattr nva, dattr; char *bufp; u_long *hashp; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, dattr_ret, &dattr); @@ -622,12 +625,13 @@ out: */ APPLESTATIC int nfsrvd_readlink(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; mbuf_t mp = NULL, mpend = NULL; int getret = 1, len; struct nfsvattr nva; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &nva); @@ -665,7 +669,7 @@ out: */ APPLESTATIC int nfsrvd_read(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { u_int32_t *tl; int error = 0, cnt, getret = 1, gotproxystateid, reqlen, eof = 0; @@ -676,6 +680,7 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int is struct nfslock lo, *lop = &lo; nfsv4stateid_t stateid; nfsquad_t clientid; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &nva); @@ -850,7 +855,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_write(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { int i, cnt; u_int32_t *tl; @@ -864,6 +869,7 @@ nfsrvd_write(struct nfsrv_descript *nd, __unused int i nfsv4stateid_t stateid; nfsquad_t clientid; nfsattrbit_t attrbits; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, forat_ret, &forat, aftat_ret, &nva); @@ -1055,7 +1061,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t dp, struct nfsexstuff *exp) { struct nfsvattr nva, dirfor, diraft; struct nfsv2_sattr *sp; @@ -1070,6 +1076,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int u_long *hashp; enum vtype vtyp; int32_t cverf[2], tverf[2] = { 0, 0 }; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -1224,8 +1231,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - struct nfsexstuff *exp) + vnode_t dp, vnode_t *vpp, fhandle_t *fhp, struct nfsexstuff *exp) { struct nfsvattr nva, dirfor, diraft; u_int32_t *tl; @@ -1239,6 +1245,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int i char *bufp = NULL, *pathcp = NULL; u_long *hashp, cnflags; NFSACL_T *aclp = NULL; + struct thread *p = curthread; NFSVNO_ATTRINIT(&nva); cnflags = (LOCKPARENT | SAVESTART); @@ -1442,7 +1449,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_remove(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t dp, struct nfsexstuff *exp) { struct nameidata named; u_int32_t *tl; @@ -1451,6 +1458,7 @@ nfsrvd_remove(struct nfsrv_descript *nd, __unused int struct nfsvattr dirfor, diraft; char *bufp; u_long *hashp; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -1524,8 +1532,7 @@ out: */ APPLESTATIC int nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, - vnode_t dp, vnode_t todp, NFSPROC_T *p, struct nfsexstuff *exp, - struct nfsexstuff *toexp) + vnode_t dp, vnode_t todp, struct nfsexstuff *exp, struct nfsexstuff *toexp) { u_int32_t *tl; int error = 0, fdirfor_ret = 1, fdiraft_ret = 1; @@ -1538,6 +1545,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, char *bufp, *tbufp = NULL; u_long *hashp; fhandle_t fh; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft); @@ -1694,8 +1702,7 @@ out: */ APPLESTATIC int nfsrvd_link(struct nfsrv_descript *nd, int isdgram, - vnode_t vp, vnode_t tovp, NFSPROC_T *p, struct nfsexstuff *exp, - struct nfsexstuff *toexp) + vnode_t vp, vnode_t tovp, struct nfsexstuff *exp, struct nfsexstuff *toexp) { struct nameidata named; u_int32_t *tl; @@ -1706,6 +1713,7 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, struct nfsrvfh dfh; char *bufp; u_long *hashp; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1798,8 +1806,7 @@ out: */ APPLESTATIC int nfsrvd_symlink(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - struct nfsexstuff *exp) + vnode_t dp, vnode_t *vpp, fhandle_t *fhp, struct nfsexstuff *exp) { struct nfsvattr nva, dirfor, diraft; struct nameidata named; @@ -1807,6 +1814,7 @@ nfsrvd_symlink(struct nfsrv_descript *nd, __unused int vnode_t dirp = NULL; char *bufp, *pathcp = NULL; u_long *hashp; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -1918,8 +1926,7 @@ nfsrvd_symlinksub(struct nfsrv_descript *nd, struct na */ APPLESTATIC int nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - struct nfsexstuff *exp) + vnode_t dp, vnode_t *vpp, fhandle_t *fhp, struct nfsexstuff *exp) { struct nfsvattr nva, dirfor, diraft; struct nameidata named; @@ -1928,6 +1935,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int i vnode_t dirp = NULL; char *bufp; u_long *hashp; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -2052,12 +2060,13 @@ nfsrvd_mkdirsub(struct nfsrv_descript *nd, struct name */ APPLESTATIC int nfsrvd_commit(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { struct nfsvattr bfor, aft; u_int32_t *tl; int error = 0, for_ret = 1, aft_ret = 1, cnt; u_int64_t off; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_wcc(nd, for_ret, &bfor, aft_ret, &aft); @@ -2109,13 +2118,14 @@ nfsmout: */ APPLESTATIC int nfsrvd_statfs(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { struct statfs *sf; u_int32_t *tl; int getret = 1; struct nfsvattr at; u_quad_t tval; + struct thread *p = curthread; sf = NULL; if (nd->nd_repstat) { @@ -2168,12 +2178,13 @@ out: */ APPLESTATIC int nfsrvd_fsinfo(struct nfsrv_descript *nd, int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; struct nfsfsinfo fs; int getret = 1; struct nfsvattr at; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -2207,12 +2218,13 @@ out: */ APPLESTATIC int nfsrvd_pathconf(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { struct nfsv3_pathconf *pc; int getret = 1; long linkmax, namemax, chownres, notrunc; struct nfsvattr at; + struct thread *p = curthread; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -2258,7 +2270,7 @@ out: */ APPLESTATIC int nfsrvd_lock(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { u_int32_t *tl; int i; @@ -2270,6 +2282,7 @@ nfsrvd_lock(struct nfsrv_descript *nd, __unused int is u_int64_t offset, len; nfsv4stateid_t stateid; nfsquad_t clientid; + struct thread *p = curthread; NFSM_DISSECT(tl, u_int32_t *, 7 * NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl++); @@ -2485,7 +2498,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_lockt(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { u_int32_t *tl; int i; @@ -2496,6 +2509,7 @@ nfsrvd_lockt(struct nfsrv_descript *nd, __unused int i nfsv4stateid_t stateid; nfsquad_t clientid; u_int64_t len; + struct thread *p = curthread; NFSM_DISSECT(tl, u_int32_t *, 8 * NFSX_UNSIGNED); i = fxdr_unsigned(int, *(tl + 7)); @@ -2599,7 +2613,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_locku(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { u_int32_t *tl; int i; @@ -2609,6 +2623,7 @@ nfsrvd_locku(struct nfsrv_descript *nd, __unused int i nfsv4stateid_t stateid; nfsquad_t clientid; u_int64_t len; + struct thread *p = curthread; NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED + NFSX_STATEID); stp = malloc(sizeof (struct nfsstate), @@ -2714,8 +2729,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t dp, vnode_t *vpp, __unused fhandle_t *fhp, NFSPROC_T *p, - struct nfsexstuff *exp) + vnode_t dp, vnode_t *vpp, __unused fhandle_t *fhp, struct nfsexstuff *exp) { u_int32_t *tl; int i, retext; @@ -2733,6 +2747,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is char *bufp = NULL; u_long *hashp; NFSACL_T *aclp = NULL; + struct thread *p = curthread; #ifdef NFS4_ACL_EXTATTR_NAME aclp = acl_alloc(M_WAITOK); @@ -3170,7 +3185,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_close(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; struct nfsstate st, *stp = &st; @@ -3178,6 +3193,7 @@ nfsrvd_close(struct nfsrv_descript *nd, __unused int i nfsv4stateid_t stateid; nfsquad_t clientid; struct nfsvattr na; + struct thread *p = curthread; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++); @@ -3250,11 +3266,12 @@ nfsmout: */ APPLESTATIC int nfsrvd_delegpurge(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; int error = 0; nfsquad_t clientid; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -3286,13 +3303,14 @@ nfsmout: */ APPLESTATIC int nfsrvd_delegreturn(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; int error = 0, writeacc; nfsv4stateid_t stateid; nfsquad_t clientid; struct nfsvattr na; + struct thread *p = curthread; NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); @@ -3326,9 +3344,10 @@ nfsmout: */ APPLESTATIC int nfsrvd_getfh(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { fhandle_t fh; + struct thread *p = curthread; nd->nd_repstat = nfsvno_getfh(vp, &fh, p); vput(vp); @@ -3343,13 +3362,14 @@ nfsrvd_getfh(struct nfsrv_descript *nd, __unused int i */ APPLESTATIC int nfsrvd_openconfirm(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; struct nfsstate st, *stp = &st; int error = 0; nfsv4stateid_t stateid; nfsquad_t clientid; + struct thread *p = curthread; if ((nd->nd_flag & ND_NFSV41) != 0) { nd->nd_repstat = NFSERR_NOTSUPP; @@ -3396,7 +3416,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; int i; @@ -3404,6 +3424,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus int error = 0; nfsv4stateid_t stateid; nfsquad_t clientid; + struct thread *p = curthread; /* opendowngrade can only work on a file object.*/ if (vp->v_type != VREG) { @@ -3506,11 +3527,12 @@ nfsmout: */ APPLESTATIC int nfsrvd_renew(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; int error = 0; nfsquad_t clientid; + struct thread *p = curthread; if ((nd->nd_flag & ND_NFSV41) != 0) { nd->nd_repstat = NFSERR_NOTSUPP; @@ -3546,7 +3568,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, - vnode_t dp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t dp, struct nfsexstuff *exp) { u_int32_t *tl; int len; @@ -3558,6 +3580,7 @@ nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, int error = 0, savflag, i; char *bufp; u_long *hashp; + struct thread *p = curthread; /* * All this just to get the export flags for the name. @@ -3649,7 +3672,7 @@ out: */ APPLESTATIC int nfsrvd_setclientid(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; int i; @@ -3658,6 +3681,7 @@ nfsrvd_setclientid(struct nfsrv_descript *nd, __unused struct sockaddr_in *rad; u_char *verf, *ucp, *ucp2, addrbuf[24]; nfsquad_t clientid, confirm; + struct thread *p = curthread; if ((nd->nd_flag & ND_NFSV41) != 0) { nd->nd_repstat = NFSERR_NOTSUPP; @@ -3772,12 +3796,13 @@ nfsmout: */ APPLESTATIC int nfsrvd_setclientidcfrm(struct nfsrv_descript *nd, - __unused int isdgram, __unused vnode_t vp, NFSPROC_T *p, + __unused int isdgram, __unused vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; int error = 0; nfsquad_t clientid, confirm; + struct thread *p = curthread; if ((nd->nd_flag & ND_NFSV41) != 0) { nd->nd_repstat = NFSERR_NOTSUPP; @@ -3809,13 +3834,14 @@ nfsmout: */ APPLESTATIC int nfsrvd_verify(struct nfsrv_descript *nd, int isdgram, - vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + vnode_t vp, __unused struct nfsexstuff *exp) { int error = 0, ret, fhsize = NFSX_MYFH; struct nfsvattr nva; struct statfs *sf; struct nfsfsinfo fs; fhandle_t fh; + struct thread *p = curthread; sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); nd->nd_repstat = nfsvno_getattr(vp, &nva, nd, p, 1, NULL); @@ -3849,7 +3875,7 @@ nfsrvd_verify(struct nfsrv_descript *nd, int isdgram, APPLESTATIC int nfsrvd_openattr(struct nfsrv_descript *nd, __unused int isdgram, vnode_t dp, __unused vnode_t *vpp, __unused fhandle_t *fhp, - __unused NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused struct nfsexstuff *exp) { u_int32_t *tl; int error = 0, createdir __unused; @@ -3868,12 +3894,13 @@ nfsmout: */ APPLESTATIC int nfsrvd_releaselckown(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { u_int32_t *tl; struct nfsstate *stp = NULL; int error = 0, len; nfsquad_t clientid; + struct thread *p = curthread; if ((nd->nd_flag & ND_NFSV41) != 0) { nd->nd_repstat = NFSERR_NOTSUPP; @@ -3928,7 +3955,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; int error = 0, i, idlen; @@ -3939,6 +3966,7 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused uint64_t owner_minor; struct timespec verstime; struct sockaddr_in *sad, *rad; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4071,13 +4099,14 @@ nfsmout: */ APPLESTATIC int nfsrvd_createsession(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; int error = 0; nfsquad_t clientid, confirm; struct nfsdsession *sep = NULL; uint32_t rdmacnt; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4183,11 +4212,12 @@ nfsmout: */ APPLESTATIC int nfsrvd_sequence(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; uint32_t highest_slotid, sequenceid, sflags, target_highest_slotid; int cache_this, error = 0; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4226,7 +4256,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_reclaimcomplete(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; int error = 0, onefs; @@ -4259,11 +4289,12 @@ nfsmout: */ APPLESTATIC int nfsrvd_destroyclientid(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; nfsquad_t clientid; int error = 0; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4283,7 +4314,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_bindconnsess(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; uint8_t sessid[NFSX_V4SESSIONID]; @@ -4322,7 +4353,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_destroysession(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint8_t *cp, sessid[NFSX_V4SESSIONID]; int error = 0; @@ -4344,11 +4375,12 @@ nfsmout: */ APPLESTATIC int nfsrvd_freestateid(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; nfsv4stateid_t stateid; int error = 0; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4391,13 +4423,14 @@ nfsmout: */ APPLESTATIC int nfsrvd_layoutget(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { uint32_t *tl; nfsv4stateid_t stateid; int error = 0, layoutlen, layouttype, iomode, maxcnt, retonclose; uint64_t offset, len, minlen; char *layp; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4488,7 +4521,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_layoutcommit(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { uint32_t *tl; nfsv4stateid_t stateid; @@ -4497,6 +4530,7 @@ nfsrvd_layoutcommit(struct nfsrv_descript *nd, __unuse uint64_t offset, len, newoff, newsize; struct timespec newmtime; char *layp; + struct thread *p = curthread; layp = NULL; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { @@ -4573,12 +4607,13 @@ nfsmout: */ APPLESTATIC int nfsrvd_layoutreturn(struct nfsrv_descript *nd, __unused int isdgram, - vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) + vnode_t vp, struct nfsexstuff *exp) { uint32_t *tl, *layp; nfsv4stateid_t stateid; int error = 0, fnd, kind, layouttype, iomode, maxcnt, reclaim; uint64_t offset, len; + struct thread *p = curthread; layp = NULL; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { @@ -4658,7 +4693,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_getdevinfo(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl, maxcnt, notify[NFSV4_NOTIFYBITMAP]; int cnt, devaddrlen, error = 0, i, layouttype; @@ -4730,11 +4765,12 @@ nfsmout: */ APPLESTATIC int nfsrvd_teststateid(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { uint32_t *tl; nfsv4stateid_t *stateidp = NULL, *tstateidp; int cnt, error = 0, i, ret; + struct thread *p = curthread; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -4774,7 +4810,7 @@ nfsmout: */ APPLESTATIC int nfsrvd_notsupp(struct nfsrv_descript *nd, __unused int isdgram, - __unused vnode_t vp, __unused NFSPROC_T *p, __unused struct nfsexstuff *exp) + __unused vnode_t vp, __unused struct nfsexstuff *exp) { nd->nd_repstat = NFSERR_NOTSUPP; Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Mar 4 13:02:36 2019 (r344758) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Mar 4 13:12:23 2019 (r344759) @@ -58,23 +58,23 @@ NFSV4ROOTLOCKMUTEX; NFSSTATESPINLOCK; int (*nfsrv3_procs0[NFS_V3NPROCS])(struct nfsrv_descript *, - int, vnode_t , NFSPROC_T *, struct nfsexstuff *) = { - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, + int, vnode_t , struct nfsexstuff *) = { + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, nfsrvd_getattr, nfsrvd_setattr, - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, nfsrvd_access, nfsrvd_readlink, nfsrvd_read, nfsrvd_write, nfsrvd_create, - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, nfsrvd_remove, nfsrvd_remove, - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, - (int (*)(struct nfsrv_descript *, int, vnode_t , NFSPROC_T *, struct nfsexstuff *))0, + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, + (int (*)(struct nfsrv_descript *, int, vnode_t , struct nfsexstuff *))0, nfsrvd_readdir, nfsrvd_readdirplus, nfsrvd_statfs, @@ -84,94 +84,92 @@ int (*nfsrv3_procs0[NFS_V3NPROCS])(struct nfsrv_descri }; int (*nfsrv3_procs1[NFS_V3NPROCS])(struct nfsrv_descript *, - int, vnode_t , vnode_t *, fhandle_t *, - NFSPROC_T *, struct nfsexstuff *) = { - (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t *, fhandle_t *, NFSPROC_T *, struct nfsexstuff *))0, - (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t *, fhandle_t *, NFSPROC_T *, struct nfsexstuff *))0, - (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t *, fhandle_t *, NFSPROC_T *, struct nfsexstuff *))0, + int, vnode_t , vnode_t *, fhandle_t *, struct nfsexstuff *) = { + (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t *, fhandle_t *, struct nfsexstuff *))0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903041312.x24DCNo8099855>