summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2019-06-19 10:33:36 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-07-09 10:30:25 -0400
commit5828cebad1c8d535f3c194439e394e92a2273fb2 (patch)
treecb24c7f8d88548f1059d029419e584fb374f7098 /net/sunrpc
parent6a6c6def42469ce08023458ba439a8207fe87ae4 (diff)
xprtrdma: Remove rpcrdma_req::rl_buffer
Clean up. There is only one remaining function, rpcrdma_buffer_put(), that uses this field. Its caller can supply a pointer to the correct rpcrdma_buffer, enabling the removal of an 8-byte pointer field from a frequently-allocated shared data structure. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/transport.c5
-rw-r--r--net/sunrpc/xprtrdma/verbs.c6
-rw-r--r--net/sunrpc/xprtrdma/xprt_rdma.h4
3 files changed, 8 insertions, 7 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 9575f1d8db07..3688e0782587 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -550,8 +550,11 @@ out_sleep:
550static void 550static void
551xprt_rdma_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *rqst) 551xprt_rdma_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *rqst)
552{ 552{
553 struct rpcrdma_xprt *r_xprt =
554 container_of(xprt, struct rpcrdma_xprt, rx_xprt);
555
553 memset(rqst, 0, sizeof(*rqst)); 556 memset(rqst, 0, sizeof(*rqst));
554 rpcrdma_buffer_put(rpcr_to_rdmar(rqst)); 557 rpcrdma_buffer_put(&r_xprt->rx_buf, rpcr_to_rdmar(rqst));
555 rpc_wake_up_next(&xprt->backlog); 558 rpc_wake_up_next(&xprt->backlog);
556} 559}
557 560
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 3270c8ad1819..805b1f35e1ca 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1019,7 +1019,6 @@ struct rpcrdma_req *rpcrdma_req_create(struct rpcrdma_xprt *r_xprt, size_t size,
1019 if (!req->rl_recvbuf) 1019 if (!req->rl_recvbuf)
1020 goto out4; 1020 goto out4;
1021 1021
1022 req->rl_buffer = buffer;
1023 INIT_LIST_HEAD(&req->rl_registered); 1022 INIT_LIST_HEAD(&req->rl_registered);
1024 spin_lock(&buffer->rb_lock); 1023 spin_lock(&buffer->rb_lock);
1025 list_add(&req->rl_all, &buffer->rb_allreqs); 1024 list_add(&req->rl_all, &buffer->rb_allreqs);
@@ -1299,13 +1298,12 @@ rpcrdma_buffer_get(struct rpcrdma_buffer *buffers)
1299 1298
1300/** 1299/**
1301 * rpcrdma_buffer_put - Put request/reply buffers back into pool 1300 * rpcrdma_buffer_put - Put request/reply buffers back into pool
1301 * @buffers: buffer pool
1302 * @req: object to return 1302 * @req: object to return
1303 * 1303 *
1304 */ 1304 */
1305void 1305void rpcrdma_buffer_put(struct rpcrdma_buffer *buffers, struct rpcrdma_req *req)
1306rpcrdma_buffer_put(struct rpcrdma_req *req)
1307{ 1306{
1308 struct rpcrdma_buffer *buffers = req->rl_buffer;
1309 struct rpcrdma_rep *rep = req->rl_reply; 1307 struct rpcrdma_rep *rep = req->rl_reply;
1310 1308
1311 req->rl_reply = NULL; 1309 req->rl_reply = NULL;
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index 5475f0dff22a..117e32816e4f 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -320,7 +320,6 @@ struct rpcrdma_buffer;
320struct rpcrdma_req { 320struct rpcrdma_req {
321 struct list_head rl_list; 321 struct list_head rl_list;
322 struct rpc_rqst rl_slot; 322 struct rpc_rqst rl_slot;
323 struct rpcrdma_buffer *rl_buffer;
324 struct rpcrdma_rep *rl_reply; 323 struct rpcrdma_rep *rl_reply;
325 struct xdr_stream rl_stream; 324 struct xdr_stream rl_stream;
326 struct xdr_buf rl_hdrbuf; 325 struct xdr_buf rl_hdrbuf;
@@ -499,7 +498,8 @@ rpcrdma_mr_recycle(struct rpcrdma_mr *mr)
499} 498}
500 499
501struct rpcrdma_req *rpcrdma_buffer_get(struct rpcrdma_buffer *); 500struct rpcrdma_req *rpcrdma_buffer_get(struct rpcrdma_buffer *);
502void rpcrdma_buffer_put(struct rpcrdma_req *); 501void rpcrdma_buffer_put(struct rpcrdma_buffer *buffers,
502 struct rpcrdma_req *req);
503void rpcrdma_recv_buffer_put(struct rpcrdma_rep *); 503void rpcrdma_recv_buffer_put(struct rpcrdma_rep *);
504 504
505bool rpcrdma_regbuf_realloc(struct rpcrdma_regbuf *rb, size_t size, 505bool rpcrdma_regbuf_realloc(struct rpcrdma_regbuf *rb, size_t size,