[PATCH v3 2/8] sunrpc: introduce svc_rqst->rq_bc_net

Vasily Averin
2018-12-21T17:32:37Z

svc_rqst->rq_bc_net points to net namespace used during
backchannel's request processing

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
include/linux/sunrpc/svc.h | 4 +++-
net/sunrpc/svc.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 73e130a840ce..23e33f8f0507 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -295,10 +295,12 @@ struct svc_rqst {
struct svc_cacherep * rq_cacherep; /* cache info */
struct task_struct *rq_task; /* service thread */
spinlock_t rq_lock; /* per-request lock */
+ struct net * rq_bc_net; /* pointer to backchannel's
+ * net namespace
+ */
};

#define SVC_NET(svc_rqst) (svc_rqst->rq_xprt->xpt_net)
-
/*
* Rigorous type checking on sockaddr type conversions
*/
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index d13e05f1a990..94a2a85c078b 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1463,6 +1463,7 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
rqstp->rq_xid = req->rq_xid;
rqstp->rq_prot = req->rq_xprt->prot;
rqstp->rq_server = serv;
+ rqstp->rq_bc_net = req->rq_xprt->xprt_net;

rqstp->rq_addrlen = sizeof(req->rq_xprt->addr);
memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen);
--
2.17.1