]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[PATCH] knfsd: Drop 'serv' option to svc_recv and svc_process
authorNeilBrown <neilb@suse.de>
Mon, 2 Oct 2006 09:17:50 +0000 (02:17 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 2 Oct 2006 14:57:18 +0000 (07:57 -0700)
It isn't needed as it is available in rqstp->rq_server, and dropping it allows
some local vars to be dropped.

[akpm@osdl.org: build fix]
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/lockd/svc.c
fs/nfs/callback.c
fs/nfsd/nfssvc.c
include/linux/sunrpc/svc.h
include/linux/sunrpc/svcsock.h
net/sunrpc/svc.c
net/sunrpc/svcsock.c

index 8d19de6a14dceb3cadb98576cc84c58fb468acd5..f0791cff45ac6cfc0dbe6a47e21ee70edbac9bdc 100644 (file)
@@ -98,7 +98,6 @@ static inline void clear_grace_period(void)
 static void
 lockd(struct svc_rqst *rqstp)
 {
-       struct svc_serv *serv = rqstp->rq_server;
        int             err = 0;
        unsigned long grace_period_expire;
 
@@ -114,7 +113,7 @@ lockd(struct svc_rqst *rqstp)
         * Let our maker know we're running.
         */
        nlmsvc_pid = current->pid;
-       nlmsvc_serv = serv;
+       nlmsvc_serv = rqstp->rq_server;
        complete(&lockd_start_done);
 
        daemonize("lockd");
@@ -164,7 +163,7 @@ lockd(struct svc_rqst *rqstp)
                 * Find a socket with data available and call its
                 * recvfrom routine.
                 */
-               err = svc_recv(serv, rqstp, timeout);
+               err = svc_recv(rqstp, timeout);
                if (err == -EAGAIN || err == -EINTR)
                        continue;
                if (err < 0) {
@@ -177,7 +176,7 @@ lockd(struct svc_rqst *rqstp)
                dprintk("lockd: request from %08x\n",
                        (unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr));
 
-               svc_process(serv, rqstp);
+               svc_process(rqstp);
 
        }
 
index e244cdc7afab4106d0c642600718d5f510933127..7933e2e99dbc2a4d448591aa87d17f937d816619 100644 (file)
@@ -58,7 +58,6 @@ module_param_call(callback_tcpport, param_set_port, param_get_int,
  */
 static void nfs_callback_svc(struct svc_rqst *rqstp)
 {
-       struct svc_serv *serv = rqstp->rq_server;
        int err;
 
        __module_get(THIS_MODULE);
@@ -80,7 +79,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
                /*
                 * Listen for a request on the socket
                 */
-               err = svc_recv(serv, rqstp, MAX_SCHEDULE_TIMEOUT);
+               err = svc_recv(rqstp, MAX_SCHEDULE_TIMEOUT);
                if (err == -EAGAIN || err == -EINTR)
                        continue;
                if (err < 0) {
@@ -91,7 +90,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
                }
                dprintk("%s: request from %u.%u.%u.%u\n", __FUNCTION__,
                                NIPQUAD(rqstp->rq_addr.sin_addr.s_addr));
-               svc_process(serv, rqstp);
+               svc_process(rqstp);
        }
 
        svc_exit_thread(rqstp);
index 784f94fbebf38fa3de7dce49507f19ca18f6063f..f1314c63e823d838a65863be54e0dd6bf089e190 100644 (file)
@@ -323,7 +323,6 @@ update_thread_usage(int busy_threads)
 static void
 nfsd(struct svc_rqst *rqstp)
 {
-       struct svc_serv *serv = rqstp->rq_server;
        struct fs_struct *fsp;
        int             err;
        struct nfsd_list me;
@@ -373,8 +372,7 @@ nfsd(struct svc_rqst *rqstp)
                 * Find a socket with data available and call its
                 * recvfrom routine.
                 */
-               while ((err = svc_recv(serv, rqstp,
-                                      60*60*HZ)) == -EAGAIN)
+               while ((err = svc_recv(rqstp, 60*60*HZ)) == -EAGAIN)
                        ;
                if (err < 0)
                        break;
@@ -387,7 +385,7 @@ nfsd(struct svc_rqst *rqstp)
                /* Process request with signals blocked.  */
                sigprocmask(SIG_SETMASK, &allowed_mask, NULL);
 
-               svc_process(serv, rqstp);
+               svc_process(rqstp);
 
                /* Unlock export hash tables */
                exp_readunlock();
index bff5e9b486c2fe7ff420f798d7ba3159ef343aca..cb341f96eb8df5f8f7f834a1bee5e9ca9266168c 100644 (file)
@@ -338,7 +338,7 @@ struct svc_serv *  svc_create(struct svc_program *, unsigned int,
 int               svc_create_thread(svc_thread_fn, struct svc_serv *);
 void              svc_exit_thread(struct svc_rqst *);
 void              svc_destroy(struct svc_serv *);
-int               svc_process(struct svc_serv *, struct svc_rqst *);
+int               svc_process(struct svc_rqst *);
 int               svc_register(struct svc_serv *, int, unsigned short);
 void              svc_wake_up(struct svc_serv *);
 void              svc_reserve(struct svc_rqst *rqstp, int space);
index b8a9652b8755564ca7c3e65f36b53e52c1fc2600..d5f15e8db92905e9546b77d04de3ee773a7544ce 100644 (file)
@@ -57,7 +57,7 @@ struct svc_sock {
  */
 int            svc_makesock(struct svc_serv *, int, unsigned short);
 void           svc_delete_socket(struct svc_sock *);
-int            svc_recv(struct svc_serv *, struct svc_rqst *, long);
+int            svc_recv(struct svc_rqst *, long);
 int            svc_send(struct svc_rqst *);
 void           svc_drop(struct svc_rqst *);
 void           svc_sock_update_bufs(struct svc_serv *serv);
index f5aee4c61676b1945d908ad019018e3d487b8889..eee45a58f3ee08ab0fc3b6a6fc749f620675d69b 100644 (file)
@@ -253,13 +253,14 @@ svc_register(struct svc_serv *serv, int proto, unsigned short port)
  * Process the RPC request.
  */
 int
-svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
+svc_process(struct svc_rqst *rqstp)
 {
        struct svc_program      *progp;
        struct svc_version      *versp = NULL;  /* compiler food */
        struct svc_procedure    *procp = NULL;
        struct kvec *           argv = &rqstp->rq_arg.head[0];
        struct kvec *           resv = &rqstp->rq_res.head[0];
+       struct svc_serv         *serv = rqstp->rq_server;
        kxdrproc_t              xdr;
        __be32                  *statp;
        u32                     dir, prog, vers, proc;
index c6be67a86ae7cd6a7310c6ae1695f1228446bd8f..bc9bd189a540d0122a042af91d699a22617b2c02 100644 (file)
@@ -1166,9 +1166,10 @@ svc_sock_update_bufs(struct svc_serv *serv)
  * Receive the next request on any socket.
  */
 int
-svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
+svc_recv(struct svc_rqst *rqstp, long timeout)
 {
        struct svc_sock         *svsk =NULL;
+       struct svc_serv         *serv = rqstp->rq_server;
        int                     len;
        int                     pages;
        struct xdr_buf          *arg;