diff mbox

[08/11] IB/srp: Move common code into the caller

Message ID 571A9458.3050904@sandisk.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bart Van Assche April 22, 2016, 9:15 p.m. UTC
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Laurence Oberman <loberman@redhat.com>
---
  drivers/infiniband/ulp/srp/ib_srp.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

  	state->fmr.end = req->fmr_list + ch->target->cmd_sg_cnt;
@@ -1431,7 +1430,6 @@ static int srp_map_sg_fr(struct srp_map_state 
*state, struct srp_rdma_ch *ch,
  			 struct srp_request *req, struct scatterlist *scat,
  			 int count)
  {
-	state->desc = req->indirect_desc;
  	state->fr.next = req->fr_list;
  	state->fr.end = req->fr_list + ch->target->cmd_sg_cnt;
  	state->sg = scat;
@@ -1463,7 +1461,6 @@ static int srp_map_sg_dma(struct srp_map_state 
*state, struct srp_rdma_ch *ch,
  	struct scatterlist *sg;
  	int i;

-	state->desc = req->indirect_desc;
  	for_each_sg(scat, sg, count, i) {
  		srp_map_desc(state, ib_sg_dma_address(dev->dev, sg),
  			     ib_sg_dma_len(dev->dev, sg),
@@ -1602,6 +1599,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, 
struct srp_rdma_ch *ch,
  				   target->indirect_size, DMA_TO_DEVICE);

  	memset(&state, 0, sizeof(state));
+	state.desc = req->indirect_desc;
  	if (dev->use_fast_reg)
  		ret = srp_map_sg_fr(&state, ch, req, scat, count);
  	else if (dev->use_fmr)

Comments

Sagi Grimberg April 26, 2016, 9 p.m. UTC | #1
Looks fine,

Reviewed-by: Sagi Grimberg <sai@grimberg.m>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig May 3, 2016, 9:29 a.m. UTC | #2
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c 
b/drivers/infiniband/ulp/srp/ib_srp.c
index d709428c..caefd1a 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1409,7 +1409,6 @@  static int srp_map_sg_fmr(struct srp_map_state 
*state, struct srp_rdma_ch *ch,
  	struct scatterlist *sg;
  	int i, ret;

-	state->desc = req->indirect_desc;
  	state->pages = req->map_page;
  	state->fmr.next = req->fmr_list;