diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-01-08 09:10:21 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-02-01 10:13:47 -0500 |
commit | a4f0835c604f80f945ab3e72ffd00547145c4b2b (patch) | |
tree | cd883841bad19e0ab7e7aa435bbcac572836ff9e /net/sunrpc/xprtrdma | |
parent | 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff) |
SUNRPC: Eliminate task->tk_xprt accesses that bypass rcu_dereference()
tk_xprt is just a shortcut for tk_client->cl_xprt, however cl_xprt is
defined as an __rcu variable. Replace dereferences of tk_xprt with
non-rcu dereferences where it is safe to do so.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r-- | net/sunrpc/xprtrdma/rpc_rdma.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 558fbab574f0..e03725bfe2b8 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c | |||
@@ -171,7 +171,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target, | |||
171 | struct rpcrdma_msg *headerp, enum rpcrdma_chunktype type) | 171 | struct rpcrdma_msg *headerp, enum rpcrdma_chunktype type) |
172 | { | 172 | { |
173 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); | 173 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); |
174 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_task->tk_xprt); | 174 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_xprt); |
175 | int nsegs, nchunks = 0; | 175 | int nsegs, nchunks = 0; |
176 | unsigned int pos; | 176 | unsigned int pos; |
177 | struct rpcrdma_mr_seg *seg = req->rl_segments; | 177 | struct rpcrdma_mr_seg *seg = req->rl_segments; |
@@ -366,7 +366,7 @@ rpcrdma_inline_pullup(struct rpc_rqst *rqst, int pad) | |||
366 | int | 366 | int |
367 | rpcrdma_marshal_req(struct rpc_rqst *rqst) | 367 | rpcrdma_marshal_req(struct rpc_rqst *rqst) |
368 | { | 368 | { |
369 | struct rpc_xprt *xprt = rqst->rq_task->tk_xprt; | 369 | struct rpc_xprt *xprt = rqst->rq_xprt; |
370 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 370 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
371 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); | 371 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); |
372 | char *base; | 372 | char *base; |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index c9aa7a35f3bf..b357c528d29c 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -475,7 +475,7 @@ xprt_rdma_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task) | |||
475 | static void * | 475 | static void * |
476 | xprt_rdma_allocate(struct rpc_task *task, size_t size) | 476 | xprt_rdma_allocate(struct rpc_task *task, size_t size) |
477 | { | 477 | { |
478 | struct rpc_xprt *xprt = task->tk_xprt; | 478 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
479 | struct rpcrdma_req *req, *nreq; | 479 | struct rpcrdma_req *req, *nreq; |
480 | 480 | ||
481 | req = rpcrdma_buffer_get(&rpcx_to_rdmax(xprt)->rx_buf); | 481 | req = rpcrdma_buffer_get(&rpcx_to_rdmax(xprt)->rx_buf); |
@@ -627,7 +627,7 @@ static int | |||
627 | xprt_rdma_send_request(struct rpc_task *task) | 627 | xprt_rdma_send_request(struct rpc_task *task) |
628 | { | 628 | { |
629 | struct rpc_rqst *rqst = task->tk_rqstp; | 629 | struct rpc_rqst *rqst = task->tk_rqstp; |
630 | struct rpc_xprt *xprt = task->tk_xprt; | 630 | struct rpc_xprt *xprt = rqst->rq_xprt; |
631 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); | 631 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); |
632 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 632 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
633 | 633 | ||
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index 9a66c95b5837..cc1445dc1d1a 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h | |||
@@ -235,13 +235,13 @@ struct rpcrdma_create_data_internal { | |||
235 | }; | 235 | }; |
236 | 236 | ||
237 | #define RPCRDMA_INLINE_READ_THRESHOLD(rq) \ | 237 | #define RPCRDMA_INLINE_READ_THRESHOLD(rq) \ |
238 | (rpcx_to_rdmad(rq->rq_task->tk_xprt).inline_rsize) | 238 | (rpcx_to_rdmad(rq->rq_xprt).inline_rsize) |
239 | 239 | ||
240 | #define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\ | 240 | #define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\ |
241 | (rpcx_to_rdmad(rq->rq_task->tk_xprt).inline_wsize) | 241 | (rpcx_to_rdmad(rq->rq_xprt).inline_wsize) |
242 | 242 | ||
243 | #define RPCRDMA_INLINE_PAD_VALUE(rq)\ | 243 | #define RPCRDMA_INLINE_PAD_VALUE(rq)\ |
244 | rpcx_to_rdmad(rq->rq_task->tk_xprt).padding | 244 | rpcx_to_rdmad(rq->rq_xprt).padding |
245 | 245 | ||
246 | /* | 246 | /* |
247 | * Statistics for RPCRDMA | 247 | * Statistics for RPCRDMA |