aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 6359c42c4941..08e05a8ce025 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -488,10 +488,6 @@ svc_destroy(struct svc_serv *serv)
488 if (svc_serv_is_pooled(serv)) 488 if (svc_serv_is_pooled(serv))
489 svc_pool_map_put(); 489 svc_pool_map_put();
490 490
491#if defined(CONFIG_NFS_V4_1)
492 svc_sock_destroy(serv->bc_xprt);
493#endif /* CONFIG_NFS_V4_1 */
494
495 svc_unregister(serv); 491 svc_unregister(serv);
496 kfree(serv->sv_pools); 492 kfree(serv->sv_pools);
497 kfree(serv); 493 kfree(serv);
@@ -1005,6 +1001,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1005 rqstp->rq_splice_ok = 1; 1001 rqstp->rq_splice_ok = 1;
1006 /* Will be turned off only when NFSv4 Sessions are used */ 1002 /* Will be turned off only when NFSv4 Sessions are used */
1007 rqstp->rq_usedeferral = 1; 1003 rqstp->rq_usedeferral = 1;
1004 rqstp->rq_dropme = false;
1008 1005
1009 /* Setup reply header */ 1006 /* Setup reply header */
1010 rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr(rqstp); 1007 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)
1106 *statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp); 1103 *statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
1107 1104
1108 /* Encode reply */ 1105 /* Encode reply */
1109 if (*statp == rpc_drop_reply) { 1106 if (rqstp->rq_dropme) {
1110 if (procp->pc_release) 1107 if (procp->pc_release)
1111 procp->pc_release(rqstp, NULL, rqstp->rq_resp); 1108 procp->pc_release(rqstp, NULL, rqstp->rq_resp);
1112 goto dropit; 1109 goto dropit;
@@ -1147,7 +1144,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1147 dropit: 1144 dropit:
1148 svc_authorise(rqstp); /* doesn't hurt to call this twice */ 1145 svc_authorise(rqstp); /* doesn't hurt to call this twice */
1149 dprintk("svc: svc_process dropit\n"); 1146 dprintk("svc: svc_process dropit\n");
1150 svc_drop(rqstp);
1151 return 0; 1147 return 0;
1152 1148
1153err_short_len: 1149err_short_len:
@@ -1218,7 +1214,6 @@ svc_process(struct svc_rqst *rqstp)
1218 struct kvec *resv = &rqstp->rq_res.head[0]; 1214 struct kvec *resv = &rqstp->rq_res.head[0];
1219 struct svc_serv *serv = rqstp->rq_server; 1215 struct svc_serv *serv = rqstp->rq_server;
1220 u32 dir; 1216 u32 dir;
1221 int error;
1222 1217
1223 /* 1218 /*
1224 * Setup response xdr_buf. 1219 * Setup response xdr_buf.
@@ -1246,11 +1241,13 @@ svc_process(struct svc_rqst *rqstp)
1246 return 0; 1241 return 0;
1247 } 1242 }
1248 1243
1249 error = svc_process_common(rqstp, argv, resv); 1244 /* Returns 1 for send, 0 for drop */
1250 if (error <= 0) 1245 if (svc_process_common(rqstp, argv, resv))
1251 return error; 1246 return svc_send(rqstp);
1252 1247 else {
1253 return svc_send(rqstp); 1248 svc_drop(rqstp);
1249 return 0;
1250 }
1254} 1251}
1255 1252
1256#if defined(CONFIG_NFS_V4_1) 1253#if defined(CONFIG_NFS_V4_1)
@@ -1264,10 +1261,9 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1264{ 1261{
1265 struct kvec *argv = &rqstp->rq_arg.head[0]; 1262 struct kvec *argv = &rqstp->rq_arg.head[0];
1266 struct kvec *resv = &rqstp->rq_res.head[0]; 1263 struct kvec *resv = &rqstp->rq_res.head[0];
1267 int error;
1268 1264
1269 /* Build the svc_rqst used by the common processing routine */ 1265 /* Build the svc_rqst used by the common processing routine */
1270 rqstp->rq_xprt = serv->bc_xprt; 1266 rqstp->rq_xprt = serv->sv_bc_xprt;
1271 rqstp->rq_xid = req->rq_xid; 1267 rqstp->rq_xid = req->rq_xid;
1272 rqstp->rq_prot = req->rq_xprt->prot; 1268 rqstp->rq_prot = req->rq_xprt->prot;
1273 rqstp->rq_server = serv; 1269 rqstp->rq_server = serv;
@@ -1292,12 +1288,15 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1292 svc_getu32(argv); /* XID */ 1288 svc_getu32(argv); /* XID */
1293 svc_getnl(argv); /* CALLDIR */ 1289 svc_getnl(argv); /* CALLDIR */
1294 1290
1295 error = svc_process_common(rqstp, argv, resv); 1291 /* Returns 1 for send, 0 for drop */
1296 if (error <= 0) 1292 if (svc_process_common(rqstp, argv, resv)) {
1297 return error; 1293 memcpy(&req->rq_snd_buf, &rqstp->rq_res,
1298 1294 sizeof(req->rq_snd_buf));
1299 memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf)); 1295 return bc_send(req);
1300 return bc_send(req); 1296 } else {
1297 /* Nothing to do to drop request */
1298 return 0;
1299 }
1301} 1300}
1302EXPORT_SYMBOL(bc_svc_process); 1301EXPORT_SYMBOL(bc_svc_process);
1303#endif /* CONFIG_NFS_V4_1 */ 1302#endif /* CONFIG_NFS_V4_1 */