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.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 6359c42c4941..0e659c665a8d 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);
@@ -1147,7 +1143,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1147 dropit: 1143 dropit:
1148 svc_authorise(rqstp); /* doesn't hurt to call this twice */ 1144 svc_authorise(rqstp); /* doesn't hurt to call this twice */
1149 dprintk("svc: svc_process dropit\n"); 1145 dprintk("svc: svc_process dropit\n");
1150 svc_drop(rqstp);
1151 return 0; 1146 return 0;
1152 1147
1153err_short_len: 1148err_short_len:
@@ -1218,7 +1213,6 @@ svc_process(struct svc_rqst *rqstp)
1218 struct kvec *resv = &rqstp->rq_res.head[0]; 1213 struct kvec *resv = &rqstp->rq_res.head[0];
1219 struct svc_serv *serv = rqstp->rq_server; 1214 struct svc_serv *serv = rqstp->rq_server;
1220 u32 dir; 1215 u32 dir;
1221 int error;
1222 1216
1223 /* 1217 /*
1224 * Setup response xdr_buf. 1218 * Setup response xdr_buf.
@@ -1246,11 +1240,13 @@ svc_process(struct svc_rqst *rqstp)
1246 return 0; 1240 return 0;
1247 } 1241 }
1248 1242
1249 error = svc_process_common(rqstp, argv, resv); 1243 /* Returns 1 for send, 0 for drop */
1250 if (error <= 0) 1244 if (svc_process_common(rqstp, argv, resv))
1251 return error; 1245 return svc_send(rqstp);
1252 1246 else {
1253 return svc_send(rqstp); 1247 svc_drop(rqstp);
1248 return 0;
1249 }
1254} 1250}
1255 1251
1256#if defined(CONFIG_NFS_V4_1) 1252#if defined(CONFIG_NFS_V4_1)
@@ -1264,10 +1260,9 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1264{ 1260{
1265 struct kvec *argv = &rqstp->rq_arg.head[0]; 1261 struct kvec *argv = &rqstp->rq_arg.head[0];
1266 struct kvec *resv = &rqstp->rq_res.head[0]; 1262 struct kvec *resv = &rqstp->rq_res.head[0];
1267 int error;
1268 1263
1269 /* Build the svc_rqst used by the common processing routine */ 1264 /* Build the svc_rqst used by the common processing routine */
1270 rqstp->rq_xprt = serv->bc_xprt; 1265 rqstp->rq_xprt = serv->sv_bc_xprt;
1271 rqstp->rq_xid = req->rq_xid; 1266 rqstp->rq_xid = req->rq_xid;
1272 rqstp->rq_prot = req->rq_xprt->prot; 1267 rqstp->rq_prot = req->rq_xprt->prot;
1273 rqstp->rq_server = serv; 1268 rqstp->rq_server = serv;
@@ -1292,12 +1287,15 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1292 svc_getu32(argv); /* XID */ 1287 svc_getu32(argv); /* XID */
1293 svc_getnl(argv); /* CALLDIR */ 1288 svc_getnl(argv); /* CALLDIR */
1294 1289
1295 error = svc_process_common(rqstp, argv, resv); 1290 /* Returns 1 for send, 0 for drop */
1296 if (error <= 0) 1291 if (svc_process_common(rqstp, argv, resv)) {
1297 return error; 1292 memcpy(&req->rq_snd_buf, &rqstp->rq_res,
1298 1293 sizeof(req->rq_snd_buf));
1299 memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf)); 1294 return bc_send(req);
1300 return bc_send(req); 1295 } else {
1296 /* Nothing to do to drop request */
1297 return 0;
1298 }
1301} 1299}
1302EXPORT_SYMBOL(bc_svc_process); 1300EXPORT_SYMBOL(bc_svc_process);
1303#endif /* CONFIG_NFS_V4_1 */ 1301#endif /* CONFIG_NFS_V4_1 */