All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	mst@redhat.com, stefanha@redhat.com
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH 08/14] tcm_loop: Convert to new submission API
Date: Thu, 11 Feb 2021 06:27:22 -0600	[thread overview]
Message-ID: <20210211122728.31721-9-michael.christie@oracle.com> (raw)
In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com>

target_submit_cmd_map_sgls is being removed, so convert loop to
the new submission API.

Even though loop does its own shutdown sync, this has loop use
target_init_cmd/target_submit_prep/target_submit since it
needed to map sgls and in the final patches it will use the
API to use LIO's workqueue.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/target/loopback/tcm_loop.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index badba437e5f9..461f4125fcab 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -113,7 +113,6 @@ static void tcm_loop_submission_work(struct work_struct *work)
 	struct tcm_loop_tpg *tl_tpg;
 	struct scatterlist *sgl_bidi = NULL;
 	u32 sgl_bidi_count = 0, transfer_length;
-	int rc;
 
 	tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
 	tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
@@ -151,17 +150,16 @@ static void tcm_loop_submission_work(struct work_struct *work)
 	}
 
 	se_cmd->tag = tl_cmd->sc_cmd_tag;
-	rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd,
-			&tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun,
-			transfer_length, TCM_SIMPLE_TAG,
-			sc->sc_data_direction, 0,
-			scsi_sglist(sc), scsi_sg_count(sc),
-			sgl_bidi, sgl_bidi_count,
-			scsi_prot_sglist(sc), scsi_prot_sg_count(sc));
-	if (rc < 0) {
-		set_host_byte(sc, DID_NO_CONNECT);
-		goto out_done;
-	}
+	target_init_cmd(se_cmd, tl_nexus->se_sess, &tl_cmd->tl_sense_buf[0],
+			tl_cmd->sc->device->lun, transfer_length,
+			TCM_SIMPLE_TAG, sc->sc_data_direction, 0);
+
+	if (target_submit_prep(se_cmd, sc->cmnd, scsi_sglist(sc),
+			       scsi_sg_count(sc), sgl_bidi, sgl_bidi_count,
+			       scsi_prot_sglist(sc), scsi_prot_sg_count(sc)))
+		return;
+
+	target_submit(se_cmd);
 	return;
 
 out_done:
-- 
2.25.1


  parent reply	other threads:[~2021-02-11 12:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 12:27 [PATCH 01/14] target: remove target_submit_cmd_map_sgls Mike Christie
2021-02-11 12:27 ` [PATCH 01/14] target: move t_task_cdb initialization Mike Christie
2021-02-11 12:27 ` [PATCH 02/14] target: drop kref_get_unless_zero in target_get_sess_cmd Mike Christie
2021-02-11 15:09   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 03/14] target: rename transport_init_se_cmd Mike Christie
2021-02-11 15:10   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 04/14] target: break up target_submit_cmd_map_sgls Mike Christie
2021-02-11 15:12   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 05/14] srpt: Convert to new submission API Mike Christie
2021-02-11 15:13   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 06/14] ibmvscsi_tgt: " Mike Christie
2021-02-11 15:14   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 07/14] qla2xxx: " Mike Christie
2021-02-11 15:14   ` Christoph Hellwig
2021-02-11 12:27 ` Mike Christie [this message]
2021-02-11 15:14   ` [PATCH 08/14] tcm_loop: " Christoph Hellwig
2021-02-11 12:27 ` [PATCH 09/14] sbp_target: " Mike Christie
2021-02-11 15:15   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 10/14] usb gadget: " Mike Christie
2021-02-11 15:15   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 11/14] vhost-scsi: " Mike Christie
2021-02-11 12:27 ` [PATCH 12/14] xen-scsiback: " Mike Christie
2021-02-11 15:16   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 13/14] tcm_fc: " Mike Christie
2021-02-11 15:16   ` Christoph Hellwig
2021-02-11 12:27 ` [PATCH 14/14] target: remove target_submit_cmd_map_sgls Mike Christie
2021-02-11 15:17   ` Christoph Hellwig
2021-02-11 18:11     ` Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210211122728.31721-9-michael.christie@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=mst@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.