aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-01-05 21:04:24 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:23 -0500
commit4b5b3ba16be1b195d2e1161746637acd4b9fed4f (patch)
tree6e58eb24836d73b8fd756d9dff7199a88a9ebafe /net
parent64c2ce8b72eceec4030b04bca32d098b3d1431bb (diff)
SUNRPC move svc_drop to caller of svc_process_common
The NFSv4.1 shared back channel does not need to call svc_drop because the callback service never outlives the single connection it services, and it reuses it's buffers and keeps the trasport. Signed-off-by: Andy Adamson <andros@netapp.com> Acked-by: Bruce Fields <bfields@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svc.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 6359c42c4941..606d182895a9 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1147,7 +1147,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1147 dropit: 1147 dropit:
1148 svc_authorise(rqstp); /* doesn't hurt to call this twice */ 1148 svc_authorise(rqstp); /* doesn't hurt to call this twice */
1149 dprintk("svc: svc_process dropit\n"); 1149 dprintk("svc: svc_process dropit\n");
1150 svc_drop(rqstp);
1151 return 0; 1150 return 0;
1152 1151
1153err_short_len: 1152err_short_len:
@@ -1218,7 +1217,6 @@ svc_process(struct svc_rqst *rqstp)
1218 struct kvec *resv = &rqstp->rq_res.head[0]; 1217 struct kvec *resv = &rqstp->rq_res.head[0];
1219 struct svc_serv *serv = rqstp->rq_server; 1218 struct svc_serv *serv = rqstp->rq_server;
1220 u32 dir; 1219 u32 dir;
1221 int error;
1222 1220
1223 /* 1221 /*
1224 * Setup response xdr_buf. 1222 * Setup response xdr_buf.
@@ -1246,11 +1244,13 @@ svc_process(struct svc_rqst *rqstp)
1246 return 0; 1244 return 0;
1247 } 1245 }
1248 1246
1249 error = svc_process_common(rqstp, argv, resv); 1247 /* Returns 1 for send, 0 for drop */
1250 if (error <= 0) 1248 if (svc_process_common(rqstp, argv, resv))
1251 return error; 1249 return svc_send(rqstp);
1252 1250 else {
1253 return svc_send(rqstp); 1251 svc_drop(rqstp);
1252 return 0;
1253 }
1254} 1254}
1255 1255
1256#if defined(CONFIG_NFS_V4_1) 1256#if defined(CONFIG_NFS_V4_1)
@@ -1264,7 +1264,6 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1264{ 1264{
1265 struct kvec *argv = &rqstp->rq_arg.head[0]; 1265 struct kvec *argv = &rqstp->rq_arg.head[0];
1266 struct kvec *resv = &rqstp->rq_res.head[0]; 1266 struct kvec *resv = &rqstp->rq_res.head[0];
1267 int error;
1268 1267
1269 /* Build the svc_rqst used by the common processing routine */ 1268 /* Build the svc_rqst used by the common processing routine */
1270 rqstp->rq_xprt = serv->bc_xprt; 1269 rqstp->rq_xprt = serv->bc_xprt;
@@ -1292,12 +1291,15 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1292 svc_getu32(argv); /* XID */ 1291 svc_getu32(argv); /* XID */
1293 svc_getnl(argv); /* CALLDIR */ 1292 svc_getnl(argv); /* CALLDIR */
1294 1293
1295 error = svc_process_common(rqstp, argv, resv); 1294 /* Returns 1 for send, 0 for drop */
1296 if (error <= 0) 1295 if (svc_process_common(rqstp, argv, resv)) {
1297 return error; 1296 memcpy(&req->rq_snd_buf, &rqstp->rq_res,
1298 1297 sizeof(req->rq_snd_buf));
1299 memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf)); 1298 return bc_send(req);
1300 return bc_send(req); 1299 } else {
1300 /* Nothing to do to drop request */
1301 return 0;
1302 }
1301} 1303}
1302EXPORT_SYMBOL(bc_svc_process); 1304EXPORT_SYMBOL(bc_svc_process);
1303#endif /* CONFIG_NFS_V4_1 */ 1305#endif /* CONFIG_NFS_V4_1 */