diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-10-23 21:16:13 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-10-23 23:22:06 -0400 |
commit | 415a090ade7e674018e3fa4255938e4c312339b3 (patch) | |
tree | 075991035ca3410cdd2a9110d2cde1c1ca485e4d /drivers/target | |
parent | af3f00c75949369d937f499f49118e879939724d (diff) |
target: Fix incorrect transport_sent usage
This patch converts target-core to use se_cmd->t_transport_sent instead of
a duplicated se_cmd->transport_sent member in a handful of locations.
It also updates iscsi_target to properly use ->t_transport_sent instead of
it's own iscsi_cmd_t->transport_sent value that was not being assigned.
Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_core.h | 1 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tmr.c | 4 | ||||
-rw-r--r-- | drivers/target/target_core_transport.c | 6 |
3 files changed, 5 insertions, 6 deletions
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index 84818d7a7057..3723d90d5ae5 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h | |||
@@ -428,7 +428,6 @@ struct iscsi_cmd { | |||
428 | /* Number of times struct iscsi_cmd is present in immediate queue */ | 428 | /* Number of times struct iscsi_cmd is present in immediate queue */ |
429 | atomic_t immed_queue_count; | 429 | atomic_t immed_queue_count; |
430 | atomic_t response_queue_count; | 430 | atomic_t response_queue_count; |
431 | atomic_t transport_sent; | ||
432 | spinlock_t datain_lock; | 431 | spinlock_t datain_lock; |
433 | spinlock_t dataout_timeout_lock; | 432 | spinlock_t dataout_timeout_lock; |
434 | /* spinlock for protecting struct iscsi_cmd->i_state */ | 433 | /* spinlock for protecting struct iscsi_cmd->i_state */ |
diff --git a/drivers/target/iscsi/iscsi_target_tmr.c b/drivers/target/iscsi/iscsi_target_tmr.c index c3617d8ff3ea..490207eacde9 100644 --- a/drivers/target/iscsi/iscsi_target_tmr.c +++ b/drivers/target/iscsi/iscsi_target_tmr.c | |||
@@ -250,7 +250,7 @@ static int iscsit_task_reassign_complete_write( | |||
250 | * so if we have received all DataOUT we can safety ignore Initiator. | 250 | * so if we have received all DataOUT we can safety ignore Initiator. |
251 | */ | 251 | */ |
252 | if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) { | 252 | if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) { |
253 | if (!atomic_read(&cmd->transport_sent)) { | 253 | if (!atomic_read(&cmd->se_cmd.t_transport_sent)) { |
254 | pr_debug("WRITE ITT: 0x%08x: t_state: %d" | 254 | pr_debug("WRITE ITT: 0x%08x: t_state: %d" |
255 | " never sent to transport\n", | 255 | " never sent to transport\n", |
256 | cmd->init_task_tag, cmd->se_cmd.t_state); | 256 | cmd->init_task_tag, cmd->se_cmd.t_state); |
@@ -314,7 +314,7 @@ static int iscsit_task_reassign_complete_read( | |||
314 | cmd->acked_data_sn = (tmr_req->exp_data_sn - 1); | 314 | cmd->acked_data_sn = (tmr_req->exp_data_sn - 1); |
315 | } | 315 | } |
316 | 316 | ||
317 | if (!atomic_read(&cmd->transport_sent)) { | 317 | if (!atomic_read(&cmd->se_cmd.t_transport_sent)) { |
318 | pr_debug("READ ITT: 0x%08x: t_state: %d never sent to" | 318 | pr_debug("READ ITT: 0x%08x: t_state: %d never sent to" |
319 | " transport\n", cmd->init_task_tag, | 319 | " transport\n", cmd->init_task_tag, |
320 | cmd->se_cmd.t_state); | 320 | cmd->se_cmd.t_state); |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index ac048db21240..5027619552f0 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2294,7 +2294,7 @@ check_depth: | |||
2294 | 2294 | ||
2295 | if (atomic_read(&cmd->t_task_cdbs_sent) == | 2295 | if (atomic_read(&cmd->t_task_cdbs_sent) == |
2296 | cmd->t_task_list_num) | 2296 | cmd->t_task_list_num) |
2297 | atomic_set(&cmd->transport_sent, 1); | 2297 | atomic_set(&cmd->t_transport_sent, 1); |
2298 | 2298 | ||
2299 | transport_start_task_timer(task); | 2299 | transport_start_task_timer(task); |
2300 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 2300 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
@@ -2311,7 +2311,7 @@ check_depth: | |||
2311 | task->task_flags &= ~TF_ACTIVE; | 2311 | task->task_flags &= ~TF_ACTIVE; |
2312 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 2312 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
2313 | del_timer_sync(&task->task_timer); | 2313 | del_timer_sync(&task->task_timer); |
2314 | atomic_set(&cmd->transport_sent, 0); | 2314 | atomic_set(&cmd->t_transport_sent, 0); |
2315 | transport_stop_tasks_for_cmd(cmd); | 2315 | transport_stop_tasks_for_cmd(cmd); |
2316 | atomic_inc(&dev->depth_left); | 2316 | atomic_inc(&dev->depth_left); |
2317 | transport_generic_request_failure(cmd, 0, 1); | 2317 | transport_generic_request_failure(cmd, 0, 1); |
@@ -2351,7 +2351,7 @@ check_depth: | |||
2351 | task->task_flags &= ~TF_ACTIVE; | 2351 | task->task_flags &= ~TF_ACTIVE; |
2352 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 2352 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
2353 | del_timer_sync(&task->task_timer); | 2353 | del_timer_sync(&task->task_timer); |
2354 | atomic_set(&cmd->transport_sent, 0); | 2354 | atomic_set(&cmd->t_transport_sent, 0); |
2355 | transport_stop_tasks_for_cmd(cmd); | 2355 | transport_stop_tasks_for_cmd(cmd); |
2356 | atomic_inc(&dev->depth_left); | 2356 | atomic_inc(&dev->depth_left); |
2357 | transport_generic_request_failure(cmd, 0, 1); | 2357 | transport_generic_request_failure(cmd, 0, 1); |