diff options
-rw-r--r-- | include/linux/sunrpc/svc.h | 2 | ||||
-rw-r--r-- | net/sunrpc/svc.c | 49 |
2 files changed, 51 insertions, 0 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 4a8afbd62007..16043c4a8bf4 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -419,6 +419,8 @@ int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | |||
419 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); | 419 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); |
420 | void svc_destroy(struct svc_serv *); | 420 | void svc_destroy(struct svc_serv *); |
421 | int svc_process(struct svc_rqst *); | 421 | int svc_process(struct svc_rqst *); |
422 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, | ||
423 | struct svc_rqst *); | ||
422 | int svc_register(const struct svc_serv *, const int, | 424 | int svc_register(const struct svc_serv *, const int, |
423 | const unsigned short, const unsigned short); | 425 | const unsigned short, const unsigned short); |
424 | 426 | ||
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index bfda66db2f4f..06b52e465f47 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/sunrpc/stats.h> | 25 | #include <linux/sunrpc/stats.h> |
26 | #include <linux/sunrpc/svcsock.h> | 26 | #include <linux/sunrpc/svcsock.h> |
27 | #include <linux/sunrpc/clnt.h> | 27 | #include <linux/sunrpc/clnt.h> |
28 | #include <linux/sunrpc/bc_xprt.h> | ||
28 | 29 | ||
29 | #define RPCDBG_FACILITY RPCDBG_SVCDSP | 30 | #define RPCDBG_FACILITY RPCDBG_SVCDSP |
30 | 31 | ||
@@ -1239,6 +1240,54 @@ svc_process(struct svc_rqst *rqstp) | |||
1239 | return svc_send(rqstp); | 1240 | return svc_send(rqstp); |
1240 | } | 1241 | } |
1241 | 1242 | ||
1243 | #if defined(CONFIG_NFS_V4_1) | ||
1244 | /* | ||
1245 | * Process a backchannel RPC request that arrived over an existing | ||
1246 | * outbound connection | ||
1247 | */ | ||
1248 | int | ||
1249 | bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req, | ||
1250 | struct svc_rqst *rqstp) | ||
1251 | { | ||
1252 | struct kvec *argv = &rqstp->rq_arg.head[0]; | ||
1253 | struct kvec *resv = &rqstp->rq_res.head[0]; | ||
1254 | int error; | ||
1255 | |||
1256 | /* Build the svc_rqst used by the common processing routine */ | ||
1257 | rqstp->rq_xid = req->rq_xid; | ||
1258 | rqstp->rq_prot = req->rq_xprt->prot; | ||
1259 | rqstp->rq_server = serv; | ||
1260 | |||
1261 | rqstp->rq_addrlen = sizeof(req->rq_xprt->addr); | ||
1262 | memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen); | ||
1263 | memcpy(&rqstp->rq_arg, &req->rq_rcv_buf, sizeof(rqstp->rq_arg)); | ||
1264 | memcpy(&rqstp->rq_res, &req->rq_snd_buf, sizeof(rqstp->rq_res)); | ||
1265 | |||
1266 | /* reset result send buffer "put" position */ | ||
1267 | resv->iov_len = 0; | ||
1268 | |||
1269 | if (rqstp->rq_prot != IPPROTO_TCP) { | ||
1270 | printk(KERN_ERR "No support for Non-TCP transports!\n"); | ||
1271 | BUG(); | ||
1272 | } | ||
1273 | |||
1274 | /* | ||
1275 | * Skip the next two words because they've already been | ||
1276 | * processed in the trasport | ||
1277 | */ | ||
1278 | svc_getu32(argv); /* XID */ | ||
1279 | svc_getnl(argv); /* CALLDIR */ | ||
1280 | |||
1281 | error = svc_process_common(rqstp, argv, resv); | ||
1282 | if (error <= 0) | ||
1283 | return error; | ||
1284 | |||
1285 | memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf)); | ||
1286 | return bc_send(req); | ||
1287 | } | ||
1288 | EXPORT_SYMBOL(bc_svc_process); | ||
1289 | #endif /* CONFIG_NFS_V4_1 */ | ||
1290 | |||
1242 | /* | 1291 | /* |
1243 | * Return (transport-specific) limit on the rpc payload. | 1292 | * Return (transport-specific) limit on the rpc payload. |
1244 | */ | 1293 | */ |