Commit 50ab9c47 authored by Mike Christie's avatar Mike Christie Committed by Martin K. Petersen

scsi: target: srpt: Convert to new submission API

target_submit_cmd_map_sgls() is being removed, so convert srpt to the new
submission API.

srpt uses target_stop_session() to sync session shutdown with LIO core, so
we use target_init_cmd()/target_submit_prep()/target_submit(), because
target_init_cmd() will detect the target_stop_session() call and return an
error.

Link: https://lore.kernel.org/r/20210227170006.5077-6-michael.christie@oracle.com
Cc: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 750a1d93
...@@ -1528,16 +1528,19 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch, ...@@ -1528,16 +1528,19 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
goto busy; goto busy;
} }
rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb, rc = target_init_cmd(cmd, ch->sess, &send_ioctx->sense_data[0],
&send_ioctx->sense_data[0], scsilun_to_int(&srp_cmd->lun), data_len,
scsilun_to_int(&srp_cmd->lun), data_len, TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF);
TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF,
sg, sg_cnt, NULL, 0, NULL, 0);
if (rc != 0) { if (rc != 0) {
pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc, pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
srp_cmd->tag); srp_cmd->tag);
goto busy; goto busy;
} }
if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0))
return;
target_submit(cmd);
return; return;
busy: busy:
......
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