diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2017-12-15 04:58:04 +0300 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-01-16 19:19:52 +0300 |
commit | ec12e479e30653bf973ca1185bbb09158e9af0b7 (patch) | |
tree | 56311458295827af007ced5f8bc88efc3ff802d2 /net/sunrpc/xprtrdma/frwr_ops.c | |
parent | 96ceddea3710f61bb5a5f2af25e684b7e1466171 (diff) | |
download | linux-ec12e479e30653bf973ca1185bbb09158e9af0b7.tar.xz |
xprtrdma: Introduce rpcrdma_mw_unmap_and_put
Clean up: Code review suggested that a common bit of code can be
placed into a helper function, and this gives us fewer places to
stick an "I DMA unmapped something" trace point.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/frwr_ops.c')
-rw-r--r-- | net/sunrpc/xprtrdma/frwr_ops.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c index 8ba4b3388a98..35e3a54344cc 100644 --- a/net/sunrpc/xprtrdma/frwr_ops.c +++ b/net/sunrpc/xprtrdma/frwr_ops.c @@ -459,13 +459,9 @@ frwr_op_reminv(struct rpcrdma_rep *rep, struct list_head *mrs) list_for_each_entry(mr, mrs, mr_list) if (mr->mr_handle == rep->rr_inv_rkey) { - struct rpcrdma_xprt *r_xprt = mr->mr_xprt; - list_del(&mr->mr_list); mr->frwr.fr_state = FRWR_IS_INVALID; - ib_dma_unmap_sg(r_xprt->rx_ia.ri_device, - mr->mr_sg, mr->mr_nents, mr->mr_dir); - rpcrdma_mr_put(mr); + rpcrdma_mr_unmap_and_put(mr); break; /* only one invalidated MR per RPC */ } } @@ -545,9 +541,7 @@ unmap: mr = rpcrdma_mr_pop(mrs); dprintk("RPC: %s: DMA unmapping frwr %p\n", __func__, &mr->frwr); - ib_dma_unmap_sg(ia->ri_device, - mr->mr_sg, mr->mr_nents, mr->mr_dir); - rpcrdma_mr_put(mr); + rpcrdma_mr_unmap_and_put(mr); } return; |