Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chuck Lever and committed by
J. Bruce Fields
35a30fc3 91b022ec

+8 -10
+8 -10
net/sunrpc/xprtrdma/svc_rdma_rw.c
··· 116 116 struct svcxprt_rdma *cc_rdma; 117 117 struct list_head cc_rwctxts; 118 118 int cc_sqecount; 119 - enum dma_data_direction cc_dir; 120 119 }; 121 120 122 121 static void svc_rdma_cc_init(struct svcxprt_rdma *rdma, 123 - struct svc_rdma_chunk_ctxt *cc, 124 - enum dma_data_direction dir) 122 + struct svc_rdma_chunk_ctxt *cc) 125 123 { 126 124 cc->cc_rdma = rdma; 127 125 svc_xprt_get(&rdma->sc_xprt); 128 126 129 127 INIT_LIST_HEAD(&cc->cc_rwctxts); 130 128 cc->cc_sqecount = 0; 131 - cc->cc_dir = dir; 132 129 } 133 130 134 - static void svc_rdma_cc_release(struct svc_rdma_chunk_ctxt *cc) 131 + static void svc_rdma_cc_release(struct svc_rdma_chunk_ctxt *cc, 132 + enum dma_data_direction dir) 135 133 { 136 134 struct svcxprt_rdma *rdma = cc->cc_rdma; 137 135 struct svc_rdma_rw_ctxt *ctxt; ··· 139 141 140 142 rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp, 141 143 rdma->sc_port_num, ctxt->rw_sg_table.sgl, 142 - ctxt->rw_nents, cc->cc_dir); 144 + ctxt->rw_nents, dir); 143 145 svc_rdma_put_rw_ctxt(rdma, ctxt); 144 146 } 145 147 svc_xprt_put(&rdma->sc_xprt); ··· 177 179 info->wi_seg_no = 0; 178 180 info->wi_nsegs = be32_to_cpup(++chunk); 179 181 info->wi_segs = ++chunk; 180 - svc_rdma_cc_init(rdma, &info->wi_cc, DMA_TO_DEVICE); 182 + svc_rdma_cc_init(rdma, &info->wi_cc); 181 183 info->wi_cc.cc_cqe.done = svc_rdma_write_done; 182 184 return info; 183 185 } 184 186 185 187 static void svc_rdma_write_info_free(struct svc_rdma_write_info *info) 186 188 { 187 - svc_rdma_cc_release(&info->wi_cc); 189 + svc_rdma_cc_release(&info->wi_cc, DMA_TO_DEVICE); 188 190 kfree(info); 189 191 } 190 192 ··· 239 241 if (!info) 240 242 return info; 241 243 242 - svc_rdma_cc_init(rdma, &info->ri_cc, DMA_FROM_DEVICE); 244 + svc_rdma_cc_init(rdma, &info->ri_cc); 243 245 info->ri_cc.cc_cqe.done = svc_rdma_wc_read_done; 244 246 return info; 245 247 } 246 248 247 249 static void svc_rdma_read_info_free(struct svc_rdma_read_info *info) 248 250 { 249 - svc_rdma_cc_release(&info->ri_cc); 251 + svc_rdma_cc_release(&info->ri_cc, DMA_FROM_DEVICE); 250 252 kfree(info); 251 253 } 252 254