target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH v2 5/8] target: Kill transport_handle_cdb_direct
Date: Wed, 27 Sep 2023 21:09:04 -0500	[thread overview]
Message-ID: <20230928020907.5730-5-michael.christie@oracle.com> (raw)
In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com>

This moves the code from transport_handle_cdb_direct to target_submit and
has iSCSI call target_submit.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/target/iscsi/iscsi_target_erl1.c |  2 +-
 drivers/target/iscsi/iscsi_target_tmr.c  |  2 +-
 drivers/target/target_core_transport.c   | 27 +++++++-----------------
 include/target/target_core_fabric.h      |  3 +--
 4 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
index f460a66c0e7c..679720021183 100644
--- a/drivers/target/iscsi/iscsi_target_erl1.c
+++ b/drivers/target/iscsi/iscsi_target_erl1.c
@@ -948,7 +948,7 @@ int iscsit_execute_cmd(struct iscsit_cmd *cmd, int ooo)
 
 			iscsit_set_unsolicited_dataout(cmd);
 		}
-		return transport_handle_cdb_direct(&cmd->se_cmd);
+		return target_submit(&cmd->se_cmd);
 
 	case ISCSI_OP_NOOP_OUT:
 	case ISCSI_OP_TEXT:
diff --git a/drivers/target/iscsi/iscsi_target_tmr.c b/drivers/target/iscsi/iscsi_target_tmr.c
index afc801f255f5..9c4aa01b6351 100644
--- a/drivers/target/iscsi/iscsi_target_tmr.c
+++ b/drivers/target/iscsi/iscsi_target_tmr.c
@@ -318,7 +318,7 @@ static int iscsit_task_reassign_complete_read(
 		pr_debug("READ ITT: 0x%08x: t_state: %d never sent to"
 			" transport\n", cmd->init_task_tag,
 			cmd->se_cmd.t_state);
-		transport_handle_cdb_direct(se_cmd);
+		target_submit(se_cmd);
 		return 0;
 	}
 
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index c2ddd09051e8..d78f24c2dfcf 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1576,12 +1576,14 @@ target_cmd_parse_cdb(struct se_cmd *cmd)
 }
 EXPORT_SYMBOL(target_cmd_parse_cdb);
 
-/*
- * Used by fabric module frontends to queue tasks directly.
- * May only be used from process context.
+/**
+ * target_submit - perform final initialization and submit cmd to LIO core
+ * @cmd: command descriptor to submit
+ *
+ * target_submit_prep or something similar must have been called on the cmd,
+ * and this must be called from process context.
  */
-int transport_handle_cdb_direct(
-	struct se_cmd *cmd)
+int target_submit(struct se_cmd *cmd)
 {
 	sense_reason_t ret;
 
@@ -1641,7 +1643,7 @@ int transport_handle_cdb_direct(
 		transport_generic_request_failure(cmd, ret);
 	return 0;
 }
-EXPORT_SYMBOL(transport_handle_cdb_direct);
+EXPORT_SYMBOL_GPL(target_submit);
 
 sense_reason_t
 transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl,
@@ -1808,19 +1810,6 @@ int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
 }
 EXPORT_SYMBOL_GPL(target_submit_prep);
 
-/**
- * target_submit - perform final initialization and submit cmd to LIO core
- * @se_cmd: command descriptor to submit
- *
- * target_submit_prep must have been called on the cmd, and this must be
- * called from process context.
- */
-void target_submit(struct se_cmd *se_cmd)
-{
-	transport_handle_cdb_direct(se_cmd);
-}
-EXPORT_SYMBOL_GPL(target_submit);
-
 /**
  * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
  *
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index e5fcfb845529..a808c3c32004 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -175,7 +175,7 @@ int	target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
 		struct scatterlist *sgl, u32 sgl_count,
 		struct scatterlist *sgl_bidi, u32 sgl_bidi_count,
 		struct scatterlist *sgl_prot, u32 sgl_prot_count, gfp_t gfp);
-void	target_submit(struct se_cmd *se_cmd);
+int	target_submit(struct se_cmd *se_cmd);
 sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);
 sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb,
 				   gfp_t gfp);
@@ -188,7 +188,6 @@ int	target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 		unsigned char *sense, u64 unpacked_lun,
 		void *fabric_tmr_ptr, unsigned char tm_type,
 		gfp_t, u64, int);
-int	transport_handle_cdb_direct(struct se_cmd *);
 sense_reason_t	transport_generic_new_cmd(struct se_cmd *);
 
 void	target_put_cmd_and_wait(struct se_cmd *cmd);
-- 
2.34.1


  parent reply	other threads:[~2023-09-28  2:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  2:09 [PATCH v2 1/8] scsi: target: Make write_pending_must_be_called a bit field Mike Christie
2023-09-28  2:09 ` [PATCH v2 2/8] scsi: target: Have drivers report if they support direct submissions Mike Christie
2023-09-28  2:09 ` [PATCH v2 3/8] target: Move core_alua_check_nonop_delay call Mike Christie
2023-09-28  2:09 ` [PATCH v2 4/8] target: Move buffer clearing hack Mike Christie
2023-09-28  2:09 ` Mike Christie [this message]
2023-09-28  2:09 ` [PATCH v2 6/8] scsi: target: Allow userspace to request direct submissions Mike Christie
2023-09-28  2:09 ` [PATCH v2 7/8] scsi: target: Unexport target_queue_submission Mike Christie
2023-09-28  2:09 ` [PATCH v2 8/8] scsi: target: Export fabric driver direct submit settings Mike Christie
2023-09-28  2:31 ` [PATCH v2 0/8] scsi: target: Allow userspace to config cmd submission Mike Christie
2023-10-13 19:57   ` Martin K. Petersen
2023-10-17  1:11   ` Martin K. Petersen

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=20230928020907.5730-5-michael.christie@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).