]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sunrpc/svc.c
sunrpc: mark all struct svc_version instances as const
[linux.git] / net / sunrpc / svc.c
index 4611cb7adc0415850ce15664343e458172ad62a1..45b4f2d2e3bdfa226dc6bb484f5e1741e7d6515f 100644 (file)
@@ -1008,7 +1008,7 @@ int svc_register(const struct svc_serv *serv, struct net *net,
                 const unsigned short port)
 {
        struct svc_program      *progp;
-       struct svc_version      *vers;
+       const struct svc_version *vers;
        unsigned int            i;
        int                     error = 0;
 
@@ -1151,10 +1151,9 @@ static int
 svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
 {
        struct svc_program      *progp;
-       struct svc_version      *versp = NULL;  /* compiler food */
-       struct svc_procedure    *procp = NULL;
+       const struct svc_version *versp = NULL; /* compiler food */
+       const struct svc_procedure *procp = NULL;
        struct svc_serv         *serv = rqstp->rq_server;
-       kxdrproc_t              xdr;
        __be32                  *statp;
        u32                     prog, vers, proc;
        __be32                  auth_stat, rpc_stat;
@@ -1262,7 +1261,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
        svc_putnl(resv, RPC_SUCCESS);
 
        /* Bump per-procedure stats counter */
-       procp->pc_count++;
+       versp->vs_count[proc]++;
 
        /* Initialize storage for argp and resp */
        memset(rqstp->rq_argp, 0, procp->pc_argsize);
@@ -1276,9 +1275,12 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
 
        /* Call the function that processes the request. */
        if (!versp->vs_dispatch) {
-               /* Decode arguments */
-               xdr = procp->pc_decode;
-               if (xdr && !xdr(rqstp, argv->iov_base, rqstp->rq_argp))
+               /*
+                * Decode arguments
+                * XXX: why do we ignore the return value?
+                */
+               if (procp->pc_decode &&
+                   !procp->pc_decode(rqstp, argv->iov_base))
                        goto err_garbage;
 
                *statp = procp->pc_func(rqstp);
@@ -1295,9 +1297,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
                                procp->pc_release(rqstp);
                        goto err_bad_auth;
                }
-               if (*statp == rpc_success &&
-                   (xdr = procp->pc_encode) &&
-                   !xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
+               if (*statp == rpc_success && procp->pc_encode &&
+                   !procp->pc_encode(rqstp, resv->iov_base + resv->iov_len)) {
                        dprintk("svc: failed to encode reply\n");
                        /* serv->sv_stats->rpcsystemerr++; */
                        *statp = rpc_system_err;