SUNRPC: call svc_process() from svc_recv().
authorNeilBrown <neilb@suse.de>
Tue, 18 Jul 2023 06:38:08 +0000 (16:38 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 29 Aug 2023 21:45:22 +0000 (17:45 -0400)
All callers of svc_recv() go on to call svc_process() on success.
Simplify callers by having svc_recv() do that for them.

This loses one call to validate_process_creds() in nfsd.  That was
debugging code added 14 years ago.  I don't think we need to keep it.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svc.c
fs/nfs/callback.c
fs/nfsd/nfssvc.c
net/sunrpc/svc.c
net/sunrpc/svc_xprt.c

index 614faa5..91ef139 100644 (file)
@@ -132,7 +132,6 @@ lockd(void *vrqstp)
         */
        while (!kthread_should_stop()) {
                long timeout = MAX_SCHEDULE_TIMEOUT;
-               RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
 
                /* update sv_maxconn if it has changed */
                rqstp->rq_server->sv_maxconn = nlm_max_connections;
@@ -146,10 +145,6 @@ lockd(void *vrqstp)
                err = svc_recv(rqstp, timeout);
                if (err == -EAGAIN || err == -EINTR)
                        continue;
-               dprintk("lockd: request from %s\n",
-                               svc_print_addr(rqstp, buf, sizeof(buf)));
-
-               svc_process(rqstp);
        }
        if (nlmsvc_ops)
                nlmsvc_invalidate_all();
index 46a0a2d..2d94384 100644 (file)
@@ -86,7 +86,6 @@ nfs4_callback_svc(void *vrqstp)
                err = svc_recv(rqstp, MAX_SCHEDULE_TIMEOUT);
                if (err == -EAGAIN || err == -EINTR)
                        continue;
-               svc_process(rqstp);
        }
 
        svc_exit_thread(rqstp);
index a0b16e3..547feb8 100644 (file)
@@ -970,8 +970,7 @@ nfsd(void *vrqstp)
                        ;
                if (err == -EINTR)
                        break;
-               validate_process_creds();
-               svc_process(rqstp);
+
                validate_process_creds();
        }
 
index 587811a..c69896c 100644 (file)
@@ -1516,7 +1516,6 @@ out_baddir:
 out_drop:
        svc_drop(rqstp);
 }
-EXPORT_SYMBOL_GPL(svc_process);
 
 #if defined(CONFIG_SUNRPC_BACKCHANNEL)
 /*
index d4a7fd5..8430b15 100644 (file)
@@ -906,7 +906,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
        if (serv->sv_stats)
                serv->sv_stats->netcnt++;
        rqstp->rq_stime = ktime_get();
-       return len;
+       svc_process(rqstp);
+       return 0;
 out_release:
        rqstp->rq_res.len = 0;
        svc_xprt_release(rqstp);