diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-06 04:36:41 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-20 17:10:41 -0400 |
commit | 0b66818ac6de67a6125ae203272fb76e79b3a20f (patch) | |
tree | d0bbb25b6b486c9152b9b37d26b7221f5ca64d2c | |
parent | 862e6389a78992d4ee44bf4f60051fe560470320 (diff) |
target: Drop unnecessary CMD_T_DEV_ACTIVE check from transport_lun_remove_cmd
This patch drops an unnecessary acquire/release of se_cmd->t_state_lock within
transport_lun_remove_cmd() when checking CMD_T_DEV_ACTIVE for invoking
target_remove_from_state_list().
For all fast path completion cases, transport_lun_remove_cmd() is always
called ahead of transport_cmd_check_stop(), and since transport_cmd_check_stop()
is calling target_remove_from_state_list() when remove_from_lists=true,
the t_state_lock usage in transport_lun_remove_cmd() can safely be removed.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@kernel.org>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Cc: Moussa Ba <moussaba@micron.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_transport.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 39319efe50c1..bc37666bc941 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -530,13 +530,6 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd) | |||
530 | if (!lun) | 530 | if (!lun) |
531 | return; | 531 | return; |
532 | 532 | ||
533 | spin_lock_irqsave(&cmd->t_state_lock, flags); | ||
534 | if (cmd->transport_state & CMD_T_DEV_ACTIVE) { | ||
535 | cmd->transport_state &= ~CMD_T_DEV_ACTIVE; | ||
536 | target_remove_from_state_list(cmd); | ||
537 | } | ||
538 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | ||
539 | |||
540 | spin_lock_irqsave(&lun->lun_cmd_lock, flags); | 533 | spin_lock_irqsave(&lun->lun_cmd_lock, flags); |
541 | if (!list_empty(&cmd->se_lun_node)) | 534 | if (!list_empty(&cmd->se_lun_node)) |
542 | list_del_init(&cmd->se_lun_node); | 535 | list_del_init(&cmd->se_lun_node); |