Commit 35a30fc3 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 91b022ec
...@@ -116,22 +116,20 @@ struct svc_rdma_chunk_ctxt { ...@@ -116,22 +116,20 @@ struct svc_rdma_chunk_ctxt {
struct svcxprt_rdma *cc_rdma; struct svcxprt_rdma *cc_rdma;
struct list_head cc_rwctxts; struct list_head cc_rwctxts;
int cc_sqecount; int cc_sqecount;
enum dma_data_direction cc_dir;
}; };
static void svc_rdma_cc_init(struct svcxprt_rdma *rdma, static void svc_rdma_cc_init(struct svcxprt_rdma *rdma,
struct svc_rdma_chunk_ctxt *cc, struct svc_rdma_chunk_ctxt *cc)
enum dma_data_direction dir)
{ {
cc->cc_rdma = rdma; cc->cc_rdma = rdma;
svc_xprt_get(&rdma->sc_xprt); svc_xprt_get(&rdma->sc_xprt);
INIT_LIST_HEAD(&cc->cc_rwctxts); INIT_LIST_HEAD(&cc->cc_rwctxts);
cc->cc_sqecount = 0; 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 svcxprt_rdma *rdma = cc->cc_rdma;
struct svc_rdma_rw_ctxt *ctxt; struct svc_rdma_rw_ctxt *ctxt;
...@@ -141,7 +139,7 @@ static void svc_rdma_cc_release(struct svc_rdma_chunk_ctxt *cc) ...@@ -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_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp,
rdma->sc_port_num, ctxt->rw_sg_table.sgl, 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_rdma_put_rw_ctxt(rdma, ctxt);
} }
svc_xprt_put(&rdma->sc_xprt); svc_xprt_put(&rdma->sc_xprt);
...@@ -179,14 +177,14 @@ svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma, __be32 *chunk) ...@@ -179,14 +177,14 @@ svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma, __be32 *chunk)
info->wi_seg_no = 0; info->wi_seg_no = 0;
info->wi_nsegs = be32_to_cpup(++chunk); info->wi_nsegs = be32_to_cpup(++chunk);
info->wi_segs = ++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; info->wi_cc.cc_cqe.done = svc_rdma_write_done;
return info; return info;
} }
static void svc_rdma_write_info_free(struct svc_rdma_write_info *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); kfree(info);
} }
...@@ -241,14 +239,14 @@ svc_rdma_read_info_alloc(struct svcxprt_rdma *rdma) ...@@ -241,14 +239,14 @@ svc_rdma_read_info_alloc(struct svcxprt_rdma *rdma)
if (!info) if (!info)
return 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; info->ri_cc.cc_cqe.done = svc_rdma_wc_read_done;
return info; return info;
} }
static void svc_rdma_read_info_free(struct svc_rdma_read_info *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); kfree(info);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment