]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/sunrpc/svc.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / net / sunrpc / svc.c
index 6359c42c49410f73fbf9e8c7c570964f1ca739b1..08e05a8ce0255b338cc9c812006302a79e7ad4a9 100644 (file)
@@ -488,10 +488,6 @@ svc_destroy(struct svc_serv *serv)
        if (svc_serv_is_pooled(serv))
                svc_pool_map_put();
 
-#if defined(CONFIG_NFS_V4_1)
-       svc_sock_destroy(serv->bc_xprt);
-#endif /* CONFIG_NFS_V4_1 */
-
        svc_unregister(serv);
        kfree(serv->sv_pools);
        kfree(serv);
@@ -1005,6 +1001,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
        rqstp->rq_splice_ok = 1;
        /* Will be turned off only when NFSv4 Sessions are used */
        rqstp->rq_usedeferral = 1;
+       rqstp->rq_dropme = false;
 
        /* Setup reply header */
        rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr(rqstp);
@@ -1106,7 +1103,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
                *statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
 
                /* Encode reply */
-               if (*statp == rpc_drop_reply) {
+               if (rqstp->rq_dropme) {
                        if (procp->pc_release)
                                procp->pc_release(rqstp, NULL, rqstp->rq_resp);
                        goto dropit;
@@ -1147,7 +1144,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
  dropit:
        svc_authorise(rqstp);   /* doesn't hurt to call this twice */
        dprintk("svc: svc_process dropit\n");
-       svc_drop(rqstp);
        return 0;
 
 err_short_len:
@@ -1218,7 +1214,6 @@ svc_process(struct svc_rqst *rqstp)
        struct kvec             *resv = &rqstp->rq_res.head[0];
        struct svc_serv         *serv = rqstp->rq_server;
        u32                     dir;
-       int                     error;
 
        /*
         * Setup response xdr_buf.
@@ -1246,11 +1241,13 @@ svc_process(struct svc_rqst *rqstp)
                return 0;
        }
 
-       error = svc_process_common(rqstp, argv, resv);
-       if (error <= 0)
-               return error;
-
-       return svc_send(rqstp);
+       /* Returns 1 for send, 0 for drop */
+       if (svc_process_common(rqstp, argv, resv))
+               return svc_send(rqstp);
+       else {
+               svc_drop(rqstp);
+               return 0;
+       }
 }
 
 #if defined(CONFIG_NFS_V4_1)
@@ -1264,10 +1261,9 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
 {
        struct kvec     *argv = &rqstp->rq_arg.head[0];
        struct kvec     *resv = &rqstp->rq_res.head[0];
-       int             error;
 
        /* Build the svc_rqst used by the common processing routine */
-       rqstp->rq_xprt = serv->bc_xprt;
+       rqstp->rq_xprt = serv->sv_bc_xprt;
        rqstp->rq_xid = req->rq_xid;
        rqstp->rq_prot = req->rq_xprt->prot;
        rqstp->rq_server = serv;
@@ -1292,12 +1288,15 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
        svc_getu32(argv);       /* XID */
        svc_getnl(argv);        /* CALLDIR */
 
-       error = svc_process_common(rqstp, argv, resv);
-       if (error <= 0)
-               return error;
-
-       memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf));
-       return bc_send(req);
+       /* Returns 1 for send, 0 for drop */
+       if (svc_process_common(rqstp, argv, resv)) {
+               memcpy(&req->rq_snd_buf, &rqstp->rq_res,
+                                               sizeof(req->rq_snd_buf));
+               return bc_send(req);
+       } else {
+               /* Nothing to do to drop request */
+               return 0;
+       }
 }
 EXPORT_SYMBOL(bc_svc_process);
 #endif /* CONFIG_NFS_V4_1 */