diff options
author | Christoph Hellwig | 2011-12-21 20:14:05 +0100 |
---|---|---|
committer | Nicholas Bellinger | 2012-02-25 23:37:46 +0100 |
commit | 3d26fea01d5f80e3e585d69d8d73a60e1ca563a0 (patch) | |
tree | 6955955e14533854f9e9eaae7b7475e819bc53d5 /drivers/target/target_core_transport.c | |
parent | target: replace various cmd flags with a transport state (diff) | |
download | kernel-qcow2-linux-3d26fea01d5f80e3e585d69d8d73a60e1ca563a0.tar.gz kernel-qcow2-linux-3d26fea01d5f80e3e585d69d8d73a60e1ca563a0.tar.xz kernel-qcow2-linux-3d26fea01d5f80e3e585d69d8d73a60e1ca563a0.zip |
target: remove the transport_lun_active field in struct se_cmd
There is no reason to have a flag telling if a command is on the per-lun list,
we can simply do a list_empty check before removing it as long as we're careful
to always use list_del_init.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_transport.c')
-rw-r--r-- | drivers/target/target_core_transport.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index f704123752c3..78ea638aa3b3 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -546,14 +546,8 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd) spin_unlock_irqrestore(&cmd->t_state_lock, flags); spin_lock_irqsave(&lun->lun_cmd_lock, flags); - if (atomic_read(&cmd->transport_lun_active)) { - list_del(&cmd->se_lun_node); - atomic_set(&cmd->transport_lun_active, 0); -#if 0 - pr_debug("Removed ITT: 0x%08x from LUN LIST[%d]\n" - cmd->se_tfo->get_task_tag(cmd), lun->unpacked_lun); -#endif - } + if (!list_empty(&cmd->se_lun_node)) + list_del_init(&cmd->se_lun_node); spin_unlock_irqrestore(&lun->lun_cmd_lock, flags); } @@ -4163,9 +4157,8 @@ static void __transport_clear_lun_from_sessions(struct se_lun *lun) while (!list_empty(&lun->lun_cmd_list)) { cmd = list_first_entry(&lun->lun_cmd_list, struct se_cmd, se_lun_node); - list_del(&cmd->se_lun_node); + list_del_init(&cmd->se_lun_node); - atomic_set(&cmd->transport_lun_active, 0); /* * This will notify iscsi_target_transport.c: * transport_cmd_check_stop() that a LUN shutdown is in |