All of lore.kernel.org
 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 4/5] scsi: target: Unexport target_queue_submission
Date: Mon, 10 Jul 2023 16:44:41 -0500	[thread overview]
Message-ID: <20230710214442.6718-5-michael.christie@oracle.com> (raw)
In-Reply-To: <20230710214442.6718-1-michael.christie@oracle.com>

target_queue_submission is not called by drivers anymore so unexport it.
This moves target_submit to before target_queue_submission so we can
easily call it. It does not change any behavior.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/target/target_core_transport.c | 59 +++++++++++++-------------
 include/target/target_core_fabric.h    |  1 -
 2 files changed, 29 insertions(+), 31 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 5349a2dd8187..701ca3593599 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1826,34 +1826,6 @@ static void __target_submit(struct se_cmd *se_cmd)
 	transport_handle_cdb_direct(se_cmd);
 }
 
-/**
- * target_submit - submit cmd to LIO core or queue it's submission
- * @se_cmd: command descriptor to submit
- */
-void target_submit(struct se_cmd *se_cmd)
-{
-	struct se_dev_attrib *da = &se_cmd->se_dev->dev_attrib;
-	u32 direct_submit;
-
-	if (da->direct_submit == DA_FABRIC_DEFAULT_SUBMIT) {
-		if (se_cmd->se_sess->se_tpg->se_tpg_tfo->default_direct_submit)
-			direct_submit = DA_DIRECT_SUBMIT;
-		else
-			direct_submit = DA_QUEUE_SUBMIT;
-	} else if (da->direct_submit == DA_DIRECT_SUBMIT &&
-		   se_cmd->se_sess->se_tpg->se_tpg_tfo->direct_submit_supp) {
-		direct_submit = DA_DIRECT_SUBMIT;
-	} else {
-		direct_submit = DA_QUEUE_SUBMIT;
-	}
-
-	if (direct_submit == DA_DIRECT_SUBMIT)
-		__target_submit(se_cmd);
-	else
-		target_queue_submission(se_cmd);
-}
-EXPORT_SYMBOL_GPL(target_submit);
-
 /**
  * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
  *
@@ -1960,7 +1932,7 @@ void target_queued_submit_work(struct work_struct *work)
  * target_queue_submission - queue the cmd to run on the LIO workqueue
  * @se_cmd: command descriptor to submit
  */
-void target_queue_submission(struct se_cmd *se_cmd)
+static void target_queue_submission(struct se_cmd *se_cmd)
 {
 	struct se_device *se_dev = se_cmd->se_dev;
 	int cpu = se_cmd->cpuid;
@@ -1970,7 +1942,34 @@ void target_queue_submission(struct se_cmd *se_cmd)
 	llist_add(&se_cmd->se_cmd_list, &sq->cmd_list);
 	queue_work_on(cpu, target_submission_wq, &sq->work);
 }
-EXPORT_SYMBOL_GPL(target_queue_submission);
+
+/**
+ * target_submit - submit cmd to LIO core or queue it's submission
+ * @se_cmd: command descriptor to submit
+ */
+void target_submit(struct se_cmd *se_cmd)
+{
+	struct se_dev_attrib *da = &se_cmd->se_dev->dev_attrib;
+	u32 direct_submit;
+
+	if (da->direct_submit == DA_FABRIC_DEFAULT_SUBMIT) {
+		if (se_cmd->se_sess->se_tpg->se_tpg_tfo->default_direct_submit)
+			direct_submit = DA_DIRECT_SUBMIT;
+		else
+			direct_submit = DA_QUEUE_SUBMIT;
+	} else if (da->direct_submit == DA_DIRECT_SUBMIT &&
+		   se_cmd->se_sess->se_tpg->se_tpg_tfo->direct_submit_supp) {
+		direct_submit = DA_DIRECT_SUBMIT;
+	} else {
+		direct_submit = DA_QUEUE_SUBMIT;
+	}
+
+	if (direct_submit == DA_DIRECT_SUBMIT)
+		__target_submit(se_cmd);
+	else
+		target_queue_submission(se_cmd);
+}
+EXPORT_SYMBOL_GPL(target_submit);
 
 static void target_complete_tmr_failure(struct work_struct *work)
 {
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 5b2367c0839e..77f69b75e851 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -183,7 +183,6 @@ sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb,
 sense_reason_t target_cmd_parse_cdb(struct se_cmd *);
 void	target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
 		unsigned char *, u64, u32, int, int, int);
-void	target_queue_submission(struct se_cmd *se_cmd);
 
 int	target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 		unsigned char *sense, u64 unpacked_lun,
-- 
2.34.1


  parent reply	other threads:[~2023-07-10 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 21:44 [PATCH 0/5] scsi: target: Allow userspace to config cmd submission Mike Christie
2023-07-10 21:44 ` [PATCH 1/5] scsi: target: Make write_pending_must_be_called a bit field Mike Christie
2023-07-10 21:44 ` [PATCH 2/5] scsi: target: Have drivers report if they support direct submissions Mike Christie
2023-07-10 21:44 ` [PATCH 3/5] scsi: target: Allow userspace to request " Mike Christie
2023-07-10 21:44 ` Mike Christie [this message]
2023-07-10 21:44 ` [PATCH 5/5] scsi: target: Export fabric driver direct submit settings Mike Christie
2023-07-13 13:06   ` Konstantin Shelekhin
2023-07-13 15:50     ` 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=20230710214442.6718-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 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.