summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target_erl2.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2011-10-09 01:00:58 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2011-10-24 03:20:54 +0000
commitd14921d6ad192868184686b3af5bb99cf3380510 (patch)
treea6ffc3a5a695d6dc50ca1885cf41f2c372607fca /drivers/target/iscsi/iscsi_target_erl2.c
parentdd503a5fcc0dfb8b5fd887bd967b6f431176864b (diff)
downloadlinux-d14921d6ad192868184686b3af5bb99cf3380510.tar.gz
linux-d14921d6ad192868184686b3af5bb99cf3380510.tar.bz2
linux-d14921d6ad192868184686b3af5bb99cf3380510.zip
target: Convert ->transport_wait_for_tasks usage to transport_generic_free_cmd
This patch converts se_cmd->transport_wait_for_tasks(se_cmd, 1) usage to use transport_generic_free_cmd() directly in target-core and iscsi-target fabric usage. The includes: *) Removal of the optional transport_generic_free_cmd() call from within transport_generic_wait_for_tasks() *) Usage of existing SCF_SUPPORTED_SAM_OPCODE to determine when transport_generic_wait_for_tasks() processing may occur instead of checking se_cmd->transport_wait_for_tasks() *) Move transport_generic_wait_for_tasks() call ahead of core_dec_lacl_count() and transport_lun_remove_cmd() in transport_generic_free_cmd() to follow existing logic for iscsi-target w/ se_cmd->transport_wait_for_tasks(se_cmd, 1) *) Removal of se_cmd->transport_wait_for_tasks() function pointer *) Rename transport_generic_wait_for_tasks() -> transport_wait_for_tasks(), and add docbook comment. *) Add EXPORT_SYMBOL for transport_wait_for_tasks() For the case in iscsi_target_erl2.c:iscsit_prepare_cmds_for_realligance() where se_cmd->transport_wait_for_tasks(se_cmd, 0) is called, this patch adds a direct call to transport_wait_for_tasks(). (hch: Fix transport_generic_free_cmd() usage in iscsit_release_commands_from_conn) (nab: Add patch: Ensure that TMRs hit wait_for_tasks logic during release) 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/iscsi/iscsi_target_erl2.c')
-rw-r--r--drivers/target/iscsi/iscsi_target_erl2.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c
index 000356baf0b5..c3803b2fdd65 100644
--- a/drivers/target/iscsi/iscsi_target_erl2.c
+++ b/drivers/target/iscsi/iscsi_target_erl2.c
@@ -143,12 +143,10 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
list_del(&cmd->i_list);
cmd->conn = NULL;
spin_unlock(&cr->conn_recovery_cmd_lock);
- if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) ||
- !(cmd->se_cmd.transport_wait_for_tasks))
+ if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
iscsit_release_cmd(cmd);
else
- cmd->se_cmd.transport_wait_for_tasks(
- &cmd->se_cmd, 1);
+ transport_generic_free_cmd(&cmd->se_cmd, 1);
spin_lock(&cr->conn_recovery_cmd_lock);
}
spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -170,12 +168,10 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
list_del(&cmd->i_list);
cmd->conn = NULL;
spin_unlock(&cr->conn_recovery_cmd_lock);
- if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) ||
- !(cmd->se_cmd.transport_wait_for_tasks))
+ if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
iscsit_release_cmd(cmd);
else
- cmd->se_cmd.transport_wait_for_tasks(
- &cmd->se_cmd, 1);
+ transport_generic_free_cmd(&cmd->se_cmd, 1);
spin_lock(&cr->conn_recovery_cmd_lock);
}
spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -260,12 +256,10 @@ void iscsit_discard_cr_cmds_by_expstatsn(
iscsit_remove_cmd_from_connection_recovery(cmd, sess);
spin_unlock(&cr->conn_recovery_cmd_lock);
- if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) ||
- !(cmd->se_cmd.transport_wait_for_tasks))
+ if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
iscsit_release_cmd(cmd);
else
- cmd->se_cmd.transport_wait_for_tasks(
- &cmd->se_cmd, 1);
+ transport_generic_free_cmd(&cmd->se_cmd, 1);
spin_lock(&cr->conn_recovery_cmd_lock);
}
spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -319,12 +313,10 @@ int iscsit_discard_unacknowledged_ooo_cmdsns_for_conn(struct iscsi_conn *conn)
list_del(&cmd->i_list);
spin_unlock_bh(&conn->cmd_lock);
- if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) ||
- !(cmd->se_cmd.transport_wait_for_tasks))
+ if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
iscsit_release_cmd(cmd);
else
- cmd->se_cmd.transport_wait_for_tasks(
- &cmd->se_cmd, 1);
+ transport_generic_free_cmd(&cmd->se_cmd, 1);
spin_lock_bh(&conn->cmd_lock);
}
spin_unlock_bh(&conn->cmd_lock);
@@ -378,12 +370,10 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
list_del(&cmd->i_list);
spin_unlock_bh(&conn->cmd_lock);
- if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) ||
- !(cmd->se_cmd.transport_wait_for_tasks))
+ if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
iscsit_release_cmd(cmd);
else
- cmd->se_cmd.transport_wait_for_tasks(
- &cmd->se_cmd, 1);
+ transport_generic_free_cmd(&cmd->se_cmd, 1);
spin_lock_bh(&conn->cmd_lock);
continue;
}
@@ -404,12 +394,10 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
list_del(&cmd->i_list);
spin_unlock_bh(&conn->cmd_lock);
- if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) ||
- !(cmd->se_cmd.transport_wait_for_tasks))
+ if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
iscsit_release_cmd(cmd);
else
- cmd->se_cmd.transport_wait_for_tasks(
- &cmd->se_cmd, 1);
+ transport_generic_free_cmd(&cmd->se_cmd, 1);
spin_lock_bh(&conn->cmd_lock);
continue;
}
@@ -434,9 +422,8 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
iscsit_free_all_datain_reqs(cmd);
- if ((cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) &&
- cmd->se_cmd.transport_wait_for_tasks)
- cmd->se_cmd.transport_wait_for_tasks(&cmd->se_cmd, 0);
+ if (cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD)
+ transport_wait_for_tasks(&cmd->se_cmd);
/*
* Add the struct iscsi_cmd to the connection recovery cmd list
*/