scsi: target: core: Rename transport_init_se_cmd()
authorMike Christie <michael.christie@oracle.com>
Sat, 27 Feb 2021 16:59:44 +0000 (10:59 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Mar 2021 22:37:00 +0000 (17:37 -0500)
Rename transport_init_se_cmd() to __target_init_cmd() to reflect that it is
more of an internal function that drivers should normally not use and
because we are going to add a new init function in the next patches.

Link: https://lore.kernel.org/r/20210227170006.5077-4-michael.christie@oracle.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/iscsi/iscsi_target.c
drivers/target/target_core_transport.c
drivers/target/target_core_xcopy.c
drivers/usb/gadget/function/f_tcm.c
include/target/target_core_fabric.h

index d0e7ed8f28cc8d7db00c36a533d95690b674c4ee..ef9133a674f6ed48c3f3619654a76f8655d74255 100644 (file)
@@ -1154,10 +1154,10 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
        /*
         * Initialize struct se_cmd descriptor from target_core_mod infrastructure
         */
-       transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops,
-                       conn->sess->se_sess, be32_to_cpu(hdr->data_length),
-                       cmd->data_direction, sam_task_attr,
-                       cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun));
+       __target_init_cmd(&cmd->se_cmd, &iscsi_ops,
+                        conn->sess->se_sess, be32_to_cpu(hdr->data_length),
+                        cmd->data_direction, sam_task_attr,
+                        cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun));
 
        pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x,"
                " ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt,
@@ -2013,10 +2013,10 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
                                             buf);
        }
 
-       transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops,
-                             conn->sess->se_sess, 0, DMA_NONE,
-                             TCM_SIMPLE_TAG, cmd->sense_buffer + 2,
-                             scsilun_to_int(&hdr->lun));
+       __target_init_cmd(&cmd->se_cmd, &iscsi_ops,
+                         conn->sess->se_sess, 0, DMA_NONE,
+                         TCM_SIMPLE_TAG, cmd->sense_buffer + 2,
+                         scsilun_to_int(&hdr->lun));
 
        target_get_sess_cmd(&cmd->se_cmd, true);
 
index b8d7edadce46e0093c26cc43e2cbbfecbd26674a..44ebabad3b99a9a658daeefb5853632246049136 100644 (file)
@@ -1304,7 +1304,7 @@ target_check_max_data_sg_nents(struct se_cmd *cmd, struct se_device *dev,
  * Compare the data buffer size from the CDB with the data buffer limit from the transport
  * header. Set @cmd->residual_count and SCF_OVERFLOW_BIT or SCF_UNDERFLOW_BIT if necessary.
  *
- * Note: target drivers set @cmd->data_length by calling transport_init_se_cmd().
+ * Note: target drivers set @cmd->data_length by calling __target_init_cmd().
  *
  * Return: TCM_NO_SENSE
  */
@@ -1371,7 +1371,7 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
  *
  * Preserves the value of @cmd->tag.
  */
-void transport_init_se_cmd(
+void __target_init_cmd(
        struct se_cmd *cmd,
        const struct target_core_fabric_ops *tfo,
        struct se_session *se_sess,
@@ -1405,7 +1405,7 @@ void transport_init_se_cmd(
 
        cmd->state_active = false;
 }
-EXPORT_SYMBOL(transport_init_se_cmd);
+EXPORT_SYMBOL(__target_init_cmd);
 
 static sense_reason_t
 transport_check_alloc_task_attr(struct se_cmd *cmd)
@@ -1625,9 +1625,9 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess
         * exceptions are handled by sending exception status via
         * target_core_fabric_ops->queue_status() callback
         */
-       transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess,
-                               data_length, data_dir, task_attr, sense,
-                               unpacked_lun);
+       __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess,
+                         data_length, data_dir, task_attr, sense,
+                         unpacked_lun);
 
        if (flags & TARGET_SCF_UNKNOWN_SIZE)
                se_cmd->unknown_data_length = 1;
@@ -1799,8 +1799,8 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
        se_tpg = se_sess->se_tpg;
        BUG_ON(!se_tpg);
 
-       transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess,
-                             0, DMA_NONE, TCM_SIMPLE_TAG, sense, unpacked_lun);
+       __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess,
+                         0, DMA_NONE, TCM_SIMPLE_TAG, sense, unpacked_lun);
        /*
         * FIXME: Currently expect caller to handle se_cmd->se_tmr_req
         * allocation failure.
index 66d6f1d06f219d716e3ce7895b49984b8cbad432..e86cc613558703502356308b8aa4a9e8dc2dccfc 100644 (file)
@@ -615,8 +615,8 @@ static int target_xcopy_read_source(
        pr_debug("XCOPY: Built READ_16: LBA: %llu Sectors: %u Length: %u\n",
                (unsigned long long)src_lba, src_sectors, length);
 
-       transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length,
-                             DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0);
+       __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length,
+                         DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0);
 
        rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, src_dev, &cdb[0],
                                remote_port);
@@ -660,8 +660,8 @@ static int target_xcopy_write_destination(
        pr_debug("XCOPY: Built WRITE_16: LBA: %llu Sectors: %u Length: %u\n",
                (unsigned long long)dst_lba, dst_sectors, length);
 
-       transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length,
-                             DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0);
+       __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length,
+                         DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0);
 
        rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, dst_dev, &cdb[0],
                                remote_port);
index 410fa89eae8f651dc8b31ed4e0524f8e157db3d6..dcce6e2605f52069a5aef3f05cc57044c69354d5 100644 (file)
@@ -1050,11 +1050,11 @@ static void usbg_cmd_work(struct work_struct *work)
        tv_nexus = tpg->tpg_nexus;
        dir = get_cmd_dir(cmd->cmd_buf);
        if (dir < 0) {
-               transport_init_se_cmd(se_cmd,
-                               tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
-                               tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
-                               cmd->prio_attr, cmd->sense_iu.sense,
-                               cmd->unpacked_lun);
+               __target_init_cmd(se_cmd,
+                                 tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
+                                 tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
+                                 cmd->prio_attr, cmd->sense_iu.sense,
+                                 cmd->unpacked_lun);
                goto out;
        }
 
@@ -1181,11 +1181,11 @@ static void bot_cmd_work(struct work_struct *work)
        tv_nexus = tpg->tpg_nexus;
        dir = get_cmd_dir(cmd->cmd_buf);
        if (dir < 0) {
-               transport_init_se_cmd(se_cmd,
-                               tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
-                               tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
-                               cmd->prio_attr, cmd->sense_iu.sense,
-                               cmd->unpacked_lun);
+               __target_init_cmd(se_cmd,
+                                 tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
+                                 tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
+                                 cmd->prio_attr, cmd->sense_iu.sense,
+                                 cmd->unpacked_lun);
                goto out;
        }
 
index d60a3eb7517abf6ba90838b274e47d8560dd5415..4975c4d2a9338e622396fc9c76b36d110a046b53 100644 (file)
@@ -148,7 +148,7 @@ void        transport_deregister_session_configfs(struct se_session *);
 void   transport_deregister_session(struct se_session *);
 
 
-void   transport_init_se_cmd(struct se_cmd *,
+void   __target_init_cmd(struct se_cmd *,
                const struct target_core_fabric_ops *,
                struct se_session *, u32, int, int, unsigned char *, u64);
 sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);