* [PATCH 08/20] target: Simplify core_tmr_handle_tas_abort()
@ 2018-06-22 21:52 Bart Van Assche
0 siblings, 0 replies; only message in thread
From: Bart Van Assche @ 2018-06-22 21:52 UTC (permalink / raw)
To: target-devel
The code that can set CMD_T_TAS is executed by the same thread as
the thread that executes core_tmr_handle_tas_abort(). That means
that no locking is needed to check CMD_T_TAS from inside
core_tmr_handle_tas_abort(). This patch does not change any
functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_tmr.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index da8125dd3a4c..08af053e7990 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -77,21 +77,12 @@ void core_tmr_release_req(struct se_tmr_req *tmr)
static int core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas)
{
- unsigned long flags;
- bool remove = true, send_tas;
- /*
- * TASK ABORTED status (TAS) bit support
- */
- spin_lock_irqsave(&cmd->t_state_lock, flags);
- send_tas = (cmd->transport_state & CMD_T_TAS);
- spin_unlock_irqrestore(&cmd->t_state_lock, flags);
+ bool send_tas = cmd->transport_state & CMD_T_TAS;
- if (send_tas) {
- remove = false;
+ if (send_tas)
transport_send_task_abort(cmd);
- }
- return transport_cmd_finish_abort(cmd, remove);
+ return transport_cmd_finish_abort(cmd, !send_tas);
}
static int target_check_cdb_and_preempt(struct list_head *list,
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-06-22 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-22 21:52 [PATCH 08/20] target: Simplify core_tmr_handle_tas_abort() Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).