summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_tmr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-10-12 11:07:04 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-10-24 03:21:08 +0000
commit04629b7bde553e3703577779f53cb0ba1eddd2c0 (patch)
tree0ad137523361599cdd4c16daad11d6bab2893511 /drivers/target/target_core_tmr.c
parent6c76bf951cb099f5573954b1f56c1121c3a41c72 (diff)
target: Remove unnecessary se_task members
This is a squashed version of the following unnecessary se_task structure member removal patches: target: remove the task_execute_queue field in se_task Instead of using a separate flag we can simply do list_emptry checks on t_execute_list if we make sure to always use list_del_init to remove a task from the list. Also factor some duplicate code into a new __transport_remove_task_from_execute_queue helper. target: remove the read-only task_no field in se_task The task_no field never was initialized and only used in debug printks, so kill it. target: remove the task_padded_sg field in se_task This field is only check in one place and not actually needed there. Rationale: - transport_do_task_sg_chain asserts that we have task_sg_chaining set early on - we only make use of the sg_prev_nents field we calculate based on it if there is another sg list that gets chained onto this one, which never happens for the last (or only) task. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_tmr.c')
-rw-r--r--drivers/target/target_core_tmr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index b5c18648fa22..b8a780fff367 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -226,11 +226,8 @@ static void core_tmr_drain_task_list(
/*
* Remove from task execute list before processing drain_task_list
*/
- if (atomic_read(&task->task_execute_queue) != 0) {
- list_del(&task->t_execute_list);
- atomic_set(&task->task_execute_queue, 0);
- atomic_dec(&dev->execute_tasks);
- }
+ if (!list_empty(&task->t_execute_list))
+ __transport_remove_task_from_execute_queue(task, dev);
}
spin_unlock_irqrestore(&dev->execute_task_lock, flags);