aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-10-17 13:56:51 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-10-23 23:21:49 -0400
commitf2da9dbdb54f2e9fa00dd01af6ff2ab06b4d90b7 (patch)
treec4ae5aa2e59828b35462dcaf1758290c9d999f49 /drivers/target
parentbfaf40ada2e15bc972cab4cd5452a88720e30647 (diff)
target: remove TRANSPORT_DEFERRED_CMD state
We never check for this state, and it makes testing for a completed state much harder given that it overrides the existing state. Also remove the unused deferred_t_state which is related to it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_tmr.c6
-rw-r--r--drivers/target/target_core_transport.c22
2 files changed, 11 insertions, 17 deletions
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index 4e963da74a0d..532ce317406a 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -237,12 +237,12 @@ static void core_tmr_drain_task_list(
237 cmd = task->task_se_cmd; 237 cmd = task->task_se_cmd;
238 238
239 pr_debug("LUN_RESET: %s cmd: %p task: %p" 239 pr_debug("LUN_RESET: %s cmd: %p task: %p"
240 " ITT/CmdSN: 0x%08x/0x%08x, i_state: %d, t_state/" 240 " ITT/CmdSN: 0x%08x/0x%08x, i_state: %d, t_state: %d"
241 "def_t_state: %d/%d cdb: 0x%02x\n", 241 "cdb: 0x%02x\n",
242 (preempt_and_abort_list) ? "Preempt" : "", cmd, task, 242 (preempt_and_abort_list) ? "Preempt" : "", cmd, task,
243 cmd->se_tfo->get_task_tag(cmd), 0, 243 cmd->se_tfo->get_task_tag(cmd), 0,
244 cmd->se_tfo->get_cmd_state(cmd), cmd->t_state, 244 cmd->se_tfo->get_cmd_state(cmd), cmd->t_state,
245 cmd->deferred_t_state, cmd->t_task_cdb[0]); 245 cmd->t_task_cdb[0]);
246 pr_debug("LUN_RESET: ITT[0x%08x] - pr_res_key: 0x%016Lx" 246 pr_debug("LUN_RESET: ITT[0x%08x] - pr_res_key: 0x%016Lx"
247 " t_task_cdbs: %d t_task_cdbs_left: %d" 247 " t_task_cdbs: %d t_task_cdbs_left: %d"
248 " t_task_cdbs_sent: %d -- t_transport_active: %d" 248 " t_task_cdbs_sent: %d -- t_transport_active: %d"
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 0d055f08044e..87beae6c76a0 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -478,8 +478,6 @@ static int transport_cmd_check_stop(
478 " == TRUE for ITT: 0x%08x\n", __func__, __LINE__, 478 " == TRUE for ITT: 0x%08x\n", __func__, __LINE__,
479 cmd->se_tfo->get_task_tag(cmd)); 479 cmd->se_tfo->get_task_tag(cmd));
480 480
481 cmd->deferred_t_state = cmd->t_state;
482 cmd->t_state = TRANSPORT_DEFERRED_CMD;
483 atomic_set(&cmd->t_transport_active, 0); 481 atomic_set(&cmd->t_transport_active, 0);
484 if (transport_off == 2) 482 if (transport_off == 2)
485 transport_all_task_dev_remove_state(cmd); 483 transport_all_task_dev_remove_state(cmd);
@@ -497,8 +495,6 @@ static int transport_cmd_check_stop(
497 " TRUE for ITT: 0x%08x\n", __func__, __LINE__, 495 " TRUE for ITT: 0x%08x\n", __func__, __LINE__,
498 cmd->se_tfo->get_task_tag(cmd)); 496 cmd->se_tfo->get_task_tag(cmd));
499 497
500 cmd->deferred_t_state = cmd->t_state;
501 cmd->t_state = TRANSPORT_DEFERRED_CMD;
502 if (transport_off == 2) 498 if (transport_off == 2)
503 transport_all_task_dev_remove_state(cmd); 499 transport_all_task_dev_remove_state(cmd);
504 500
@@ -1845,10 +1841,9 @@ static void transport_generic_request_failure(
1845 pr_debug("-----[ Storage Engine Exception for cmd: %p ITT: 0x%08x" 1841 pr_debug("-----[ Storage Engine Exception for cmd: %p ITT: 0x%08x"
1846 " CDB: 0x%02x\n", cmd, cmd->se_tfo->get_task_tag(cmd), 1842 " CDB: 0x%02x\n", cmd, cmd->se_tfo->get_task_tag(cmd),
1847 cmd->t_task_cdb[0]); 1843 cmd->t_task_cdb[0]);
1848 pr_debug("-----[ i_state: %d t_state/def_t_state:" 1844 pr_debug("-----[ i_state: %d t_state: %d transport_error_status: %d\n",
1849 " %d/%d transport_error_status: %d\n",
1850 cmd->se_tfo->get_cmd_state(cmd), 1845 cmd->se_tfo->get_cmd_state(cmd),
1851 cmd->t_state, cmd->deferred_t_state, 1846 cmd->t_state,
1852 cmd->transport_error_status); 1847 cmd->transport_error_status);
1853 pr_debug("-----[ t_tasks: %d t_task_cdbs_left: %d" 1848 pr_debug("-----[ t_tasks: %d t_task_cdbs_left: %d"
1854 " t_task_cdbs_sent: %d t_task_cdbs_ex_left: %d --" 1849 " t_task_cdbs_sent: %d t_task_cdbs_ex_left: %d --"
@@ -4404,10 +4399,9 @@ void transport_wait_for_tasks(struct se_cmd *cmd)
4404 atomic_set(&cmd->t_transport_stop, 1); 4399 atomic_set(&cmd->t_transport_stop, 1);
4405 4400
4406 pr_debug("wait_for_tasks: Stopping %p ITT: 0x%08x" 4401 pr_debug("wait_for_tasks: Stopping %p ITT: 0x%08x"
4407 " i_state: %d, t_state/def_t_state: %d/%d, t_transport_stop" 4402 " i_state: %d, t_state: %d, t_transport_stop = TRUE\n",
4408 " = TRUE\n", cmd, cmd->se_tfo->get_task_tag(cmd), 4403 cmd, cmd->se_tfo->get_task_tag(cmd),
4409 cmd->se_tfo->get_cmd_state(cmd), cmd->t_state, 4404 cmd->se_tfo->get_cmd_state(cmd), cmd->t_state);
4410 cmd->deferred_t_state);
4411 4405
4412 spin_unlock_irqrestore(&cmd->t_state_lock, flags); 4406 spin_unlock_irqrestore(&cmd->t_state_lock, flags);
4413 4407
@@ -4806,9 +4800,9 @@ get_cmd:
4806 transport_complete_qf(cmd); 4800 transport_complete_qf(cmd);
4807 break; 4801 break;
4808 default: 4802 default:
4809 pr_err("Unknown t_state: %d deferred_t_state:" 4803 pr_err("Unknown t_state: %d for ITT: 0x%08x "
4810 " %d for ITT: 0x%08x i_state: %d on SE LUN:" 4804 "i_state: %d on SE LUN: %u\n",
4811 " %u\n", cmd->t_state, cmd->deferred_t_state, 4805 cmd->t_state,
4812 cmd->se_tfo->get_task_tag(cmd), 4806 cmd->se_tfo->get_task_tag(cmd),
4813 cmd->se_tfo->get_cmd_state(cmd), 4807 cmd->se_tfo->get_cmd_state(cmd),
4814 cmd->se_lun->unpacked_lun); 4808 cmd->se_lun->unpacked_lun);