aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2012-04-03 18:51:20 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-04-14 20:40:36 -0400
commita12f41f8412ff57057906ebbe146fda37db158ac (patch)
treee3138df9188c5fff3156e53c8f6781240ee062cb /drivers
parent8b1e1244db85d58f7c612870ec2c1afd9098ae93 (diff)
target: Rename target_allocate_tasks to target_setup_cmd_from_cdb
This patch renames a horribly misnamed function that no longer allocate tasks to something more descriptive for it's modern use in target core. (nab: Fix up ib_srpt to use this as well ahead of a target_submit_cmd conversion) Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c2
-rw-r--r--drivers/target/iscsi/iscsi_target.c9
-rw-r--r--drivers/target/loopback/tcm_loop.c4
-rw-r--r--drivers/target/target_core_transport.c10
4 files changed, 10 insertions, 15 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 1e3866eb80a8..e2c8198020de 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1768,7 +1768,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch,
1768 kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref); 1768 kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref);
1769 goto send_sense; 1769 goto send_sense;
1770 } 1770 }
1771 ret = transport_generic_allocate_tasks(cmd, srp_cmd->cdb); 1771 ret = target_setup_cmd_from_cdb(cmd, srp_cmd->cdb);
1772 if (ret < 0) { 1772 if (ret < 0) {
1773 kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref); 1773 kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref);
1774 if (cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT) { 1774 if (cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT) {
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 179aaceeb732..d68363a79db7 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1016,13 +1016,8 @@ done:
1016 send_check_condition = 1; 1016 send_check_condition = 1;
1017 goto attach_cmd; 1017 goto attach_cmd;
1018 } 1018 }
1019 /* 1019
1020 * The Initiator Node has access to the LUN (the addressing method 1020 transport_ret = target_setup_cmd_from_cdb(&cmd->se_cmd, hdr->cdb);
1021 * is handled inside of iscsit_get_lun_for_cmd()). Now it's time to
1022 * allocate 1->N transport tasks (depending on sector count and
1023 * maximum request size the physical HBA(s) can handle.
1024 */
1025 transport_ret = transport_generic_allocate_tasks(&cmd->se_cmd, hdr->cdb);
1026 if (transport_ret == -ENOMEM) { 1021 if (transport_ret == -ENOMEM) {
1027 return iscsit_add_reject_from_cmd( 1022 return iscsit_add_reject_from_cmd(
1028 ISCSI_REASON_BOOKMARK_NO_RESOURCES, 1023 ISCSI_REASON_BOOKMARK_NO_RESOURCES,
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index a9b4eeefe9fc..38dfac2b0a1c 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -213,7 +213,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
213 * associated read buffers, go ahead and do that here for type 213 * associated read buffers, go ahead and do that here for type
214 * SCF_SCSI_CONTROL_SG_IO_CDB. Also note that this is currently 214 * SCF_SCSI_CONTROL_SG_IO_CDB. Also note that this is currently
215 * guaranteed to be a single SGL for SCF_SCSI_CONTROL_SG_IO_CDB 215 * guaranteed to be a single SGL for SCF_SCSI_CONTROL_SG_IO_CDB
216 * by target core in transport_generic_allocate_tasks() -> 216 * by target core in target_setup_cmd_from_cdb() ->
217 * transport_generic_cmd_sequencer(). 217 * transport_generic_cmd_sequencer().
218 */ 218 */
219 if (se_cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB && 219 if (se_cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB &&
@@ -227,7 +227,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
227 } 227 }
228 } 228 }
229 229
230 ret = transport_generic_allocate_tasks(se_cmd, sc->cmnd); 230 ret = target_setup_cmd_from_cdb(se_cmd, sc->cmnd);
231 if (ret == -ENOMEM) { 231 if (ret == -ENOMEM) {
232 transport_send_check_condition_and_sense(se_cmd, 232 transport_send_check_condition_and_sense(se_cmd,
233 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); 233 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0);
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 1bd8837543a8..61e85d8546a7 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1550,11 +1550,11 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd)
1550 return 0; 1550 return 0;
1551} 1551}
1552 1552
1553/* transport_generic_allocate_tasks(): 1553/* target_setup_cmd_from_cdb():
1554 * 1554 *
1555 * Called from fabric RX Thread. 1555 * Called from fabric RX Thread.
1556 */ 1556 */
1557int transport_generic_allocate_tasks( 1557int target_setup_cmd_from_cdb(
1558 struct se_cmd *cmd, 1558 struct se_cmd *cmd,
1559 unsigned char *cdb) 1559 unsigned char *cdb)
1560{ 1560{
@@ -1620,7 +1620,7 @@ int transport_generic_allocate_tasks(
1620 spin_unlock(&cmd->se_lun->lun_sep_lock); 1620 spin_unlock(&cmd->se_lun->lun_sep_lock);
1621 return 0; 1621 return 0;
1622} 1622}
1623EXPORT_SYMBOL(transport_generic_allocate_tasks); 1623EXPORT_SYMBOL(target_setup_cmd_from_cdb);
1624 1624
1625/* 1625/*
1626 * Used by fabric module frontends to queue tasks directly. 1626 * Used by fabric module frontends to queue tasks directly.
@@ -1728,7 +1728,7 @@ void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,
1728 * Sanitize CDBs via transport_generic_cmd_sequencer() and 1728 * Sanitize CDBs via transport_generic_cmd_sequencer() and
1729 * allocate the necessary tasks to complete the received CDB+data 1729 * allocate the necessary tasks to complete the received CDB+data
1730 */ 1730 */
1731 rc = transport_generic_allocate_tasks(se_cmd, cdb); 1731 rc = target_setup_cmd_from_cdb(se_cmd, cdb);
1732 if (rc != 0) { 1732 if (rc != 0) {
1733 transport_generic_request_failure(se_cmd); 1733 transport_generic_request_failure(se_cmd);
1734 return; 1734 return;
@@ -2583,7 +2583,7 @@ static int target_check_write_same_discard(unsigned char *flags, struct se_devic
2583 * Generic Command Sequencer that should work for most DAS transport 2583 * Generic Command Sequencer that should work for most DAS transport
2584 * drivers. 2584 * drivers.
2585 * 2585 *
2586 * Called from transport_generic_allocate_tasks() in the $FABRIC_MOD 2586 * Called from target_setup_cmd_from_cdb() in the $FABRIC_MOD
2587 * RX Thread. 2587 * RX Thread.
2588 * 2588 *
2589 * FIXME: Need to support other SCSI OPCODES where as well. 2589 * FIXME: Need to support other SCSI OPCODES where as well.