Skip to content

Commit 9a301ca

Browse files
chuckleverTrond Myklebust
authored andcommitted
xprtrdma: Move fr_linv_done field to struct rpcrdma_mr
Clean up: Move more of struct rpcrdma_frwr into its parent. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent e10fa96 commit 9a301ca

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

net/sunrpc/xprtrdma/frwr_ops.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
142142
mr->frwr.fr_mr = frmr;
143143
mr->mr_device = NULL;
144144
INIT_LIST_HEAD(&mr->mr_list);
145-
init_completion(&mr->frwr.fr_linv_done);
145+
init_completion(&mr->mr_linv_done);
146146
frwr_cid_init(ep, mr);
147147

148148
sg_init_table(sg, depth);
@@ -481,12 +481,11 @@ static void frwr_wc_localinv_wake(struct ib_cq *cq, struct ib_wc *wc)
481481
{
482482
struct ib_cqe *cqe = wc->wr_cqe;
483483
struct rpcrdma_mr *mr = container_of(cqe, struct rpcrdma_mr, mr_cqe);
484-
struct rpcrdma_frwr *frwr = &mr->frwr;
485484

486485
/* WARNING: Only wr_cqe and status are reliable at this point */
487486
trace_xprtrdma_wc_li_wake(wc, &mr->mr_cid);
488487
frwr_mr_done(wc, mr);
489-
complete(&frwr->fr_linv_done);
488+
complete(&mr->mr_linv_done);
490489

491490
rpcrdma_flush_disconnect(cq->cq_context, wc);
492491
}
@@ -544,7 +543,7 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
544543
* are complete.
545544
*/
546545
last->wr_cqe->done = frwr_wc_localinv_wake;
547-
reinit_completion(&frwr->fr_linv_done);
546+
reinit_completion(&mr->mr_linv_done);
548547

549548
/* Transport disconnect drains the receive CQ before it
550549
* replaces the QP. The RPC reply handler won't call us
@@ -558,7 +557,7 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
558557
* not happen, so don't wait in that case.
559558
*/
560559
if (bad_wr != first)
561-
wait_for_completion(&frwr->fr_linv_done);
560+
wait_for_completion(&mr->mr_linv_done);
562561
if (!rc)
563562
return;
564563

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ struct rpcrdma_sendctx {
231231
*/
232232
struct rpcrdma_frwr {
233233
struct ib_mr *fr_mr;
234-
struct completion fr_linv_done;
235234
union {
236235
struct ib_reg_wr fr_regwr;
237236
struct ib_send_wr fr_invwr;
@@ -247,6 +246,7 @@ struct rpcrdma_mr {
247246
int mr_nents;
248247
enum dma_data_direction mr_dir;
249248
struct ib_cqe mr_cqe;
249+
struct completion mr_linv_done;
250250
struct rpcrdma_frwr frwr;
251251
struct rpcrdma_xprt *mr_xprt;
252252
u32 mr_handle;

0 commit comments

Comments
 (0)