Push down td in nfsrvd_dorpc() - make it use curthread instead

of it being explicitly passed as an argument. No functional changes.

The big picture here is that I want to get rid of the 'td' argument
being passed everywhere, and this is the first piece that affects
the NFS server.

Reviewed by:	rmacklem
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D19417
This commit is contained in:
Edward Tomasz Napierala 2019-03-04 13:02:36 +00:00
parent 9441309ae0
commit 113aa93390
3 changed files with 12 additions and 8 deletions

View File

@ -283,8 +283,7 @@ int nfsrvd_notsupp(struct nfsrv_descript *, int,
/* nfs_nfsdsocket.c */
void nfsrvd_rephead(struct nfsrv_descript *);
void nfsrvd_dorpc(struct nfsrv_descript *, int, u_char *, int, u_int32_t,
NFSPROC_T *);
void nfsrvd_dorpc(struct nfsrv_descript *, int, u_char *, int, u_int32_t);
/* nfs_nfsdcache.c */
void nfsrvd_initcache(void);

View File

@ -323,7 +323,6 @@ static int
nfs_proc(struct nfsrv_descript *nd, u_int32_t xid, SVCXPRT *xprt,
struct nfsrvcache **rpp)
{
struct thread *td = curthread;
int cacherep = RC_DOIT, isdgram, taglen = -1;
struct mbuf *m;
u_char tag[NFSV4_SMALLSTR + 1], *tagstr = NULL;
@ -384,7 +383,7 @@ nfs_proc(struct nfsrv_descript *nd, u_int32_t xid, SVCXPRT *xprt,
if (cacherep == RC_DOIT) {
if ((nd->nd_flag & ND_NFSV41) != 0)
nd->nd_xprt = xprt;
nfsrvd_dorpc(nd, isdgram, tagstr, taglen, minorvers, td);
nfsrvd_dorpc(nd, isdgram, tagstr, taglen, minorvers);
if ((nd->nd_flag & ND_NFSV41) != 0) {
if (nd->nd_repstat != NFSERR_REPLYFROMCACHE &&
(nd->nd_flag & ND_SAVEREPLY) != 0) {

View File

@ -367,7 +367,7 @@ int nfsrv_writerpc[NFS_NPROCS] = { 0, 0, 1, 0, 0, 0, 0,
/* local functions */
static void nfsrvd_compound(struct nfsrv_descript *nd, int isdgram,
u_char *tag, int taglen, u_int32_t minorvers, NFSPROC_T *p);
u_char *tag, int taglen, u_int32_t minorvers);
/*
@ -475,13 +475,16 @@ nfsrvd_statend(int op, uint64_t bytes, struct bintime *now,
*/
APPLESTATIC void
nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen,
u_int32_t minorvers, NFSPROC_T *p)
u_int32_t minorvers)
{
int error = 0, lktype;
vnode_t vp;
mount_t mp = NULL;
struct nfsrvfh fh;
struct nfsexstuff nes;
struct thread *p;
p = curthread;
/*
* Get a locked vnode for the first file handle
@ -557,7 +560,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen,
* The group is indicated by the value in nfs_retfh[].
*/
if (nd->nd_flag & ND_NFSV4) {
nfsrvd_compound(nd, isdgram, tag, taglen, minorvers, p);
nfsrvd_compound(nd, isdgram, tag, taglen, minorvers);
} else {
struct bintime start_time;
@ -620,7 +623,7 @@ out:
*/
static void
nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
int taglen, u_int32_t minorvers, NFSPROC_T *p)
int taglen, u_int32_t minorvers)
{
int i, lktype, op, op0 = 0, statsinprog = 0;
u_int32_t *tl;
@ -635,6 +638,9 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
fsid_t cur_fsid, save_fsid;
static u_int64_t compref = 0;
struct bintime start_time;
struct thread *p;
p = curthread;
NFSVNO_EXINIT(&vpnes);
NFSVNO_EXINIT(&savevpnes);