diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2017-06-23 17:19:29 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-07-12 15:55:00 -0400 |
commit | 35a30fc389b5961b42bb73ef751f3bc85190a118 (patch) | |
tree | 6499cb4dd3926764e204d51e9e00f2e32c6b1eca /net/sunrpc/xprtrdma/svc_rdma_rw.c | |
parent | 91b022ec8b1214d0fdfc503be305a19e6f7c5164 (diff) | |
download | linux-35a30fc389b5961b42bb73ef751f3bc85190a118.tar.gz linux-35a30fc389b5961b42bb73ef751f3bc85190a118.tar.bz2 linux-35a30fc389b5961b42bb73ef751f3bc85190a118.zip |
svcrdma: Remove svc_rdma_chunk_ctxt::cc_dir field
Clean up: No need to save the I/O direction. The functions that
release svc_rdma_chunk_ctxt already know what direction to use.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/svc_rdma_rw.c')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_rw.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c index 9859736b331b..933f79bed270 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_rw.c +++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c @@ -116,22 +116,20 @@ struct svc_rdma_chunk_ctxt { struct svcxprt_rdma *cc_rdma; struct list_head cc_rwctxts; int cc_sqecount; - enum dma_data_direction cc_dir; }; static void svc_rdma_cc_init(struct svcxprt_rdma *rdma, - struct svc_rdma_chunk_ctxt *cc, - enum dma_data_direction dir) + struct svc_rdma_chunk_ctxt *cc) { cc->cc_rdma = rdma; svc_xprt_get(&rdma->sc_xprt); INIT_LIST_HEAD(&cc->cc_rwctxts); cc->cc_sqecount = 0; - cc->cc_dir = dir; } -static void svc_rdma_cc_release(struct svc_rdma_chunk_ctxt *cc) +static void svc_rdma_cc_release(struct svc_rdma_chunk_ctxt *cc, + enum dma_data_direction dir) { struct svcxprt_rdma *rdma = cc->cc_rdma; struct svc_rdma_rw_ctxt *ctxt; @@ -141,7 +139,7 @@ static void svc_rdma_cc_release(struct svc_rdma_chunk_ctxt *cc) rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp, rdma->sc_port_num, ctxt->rw_sg_table.sgl, - ctxt->rw_nents, cc->cc_dir); + ctxt->rw_nents, dir); svc_rdma_put_rw_ctxt(rdma, ctxt); } svc_xprt_put(&rdma->sc_xprt); @@ -179,14 +177,14 @@ svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma, __be32 *chunk) info->wi_seg_no = 0; info->wi_nsegs = be32_to_cpup(++chunk); info->wi_segs = ++chunk; - svc_rdma_cc_init(rdma, &info->wi_cc, DMA_TO_DEVICE); + svc_rdma_cc_init(rdma, &info->wi_cc); info->wi_cc.cc_cqe.done = svc_rdma_write_done; return info; } static void svc_rdma_write_info_free(struct svc_rdma_write_info *info) { - svc_rdma_cc_release(&info->wi_cc); + svc_rdma_cc_release(&info->wi_cc, DMA_TO_DEVICE); kfree(info); } @@ -241,14 +239,14 @@ svc_rdma_read_info_alloc(struct svcxprt_rdma *rdma) if (!info) return info; - svc_rdma_cc_init(rdma, &info->ri_cc, DMA_FROM_DEVICE); + svc_rdma_cc_init(rdma, &info->ri_cc); info->ri_cc.cc_cqe.done = svc_rdma_wc_read_done; return info; } static void svc_rdma_read_info_free(struct svc_rdma_read_info *info) { - svc_rdma_cc_release(&info->ri_cc); + svc_rdma_cc_release(&info->ri_cc, DMA_FROM_DEVICE); kfree(info); } |