aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r--drivers/target/iscsi/iscsi_target.c12
-rw-r--r--drivers/target/iscsi/iscsi_target_erl2.c41
2 files changed, 17 insertions, 36 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 354a8339a3f9..e4b9ba296dcf 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3940,7 +3940,6 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
3940{ 3940{
3941 struct iscsi_cmd *cmd = NULL, *cmd_tmp = NULL; 3941 struct iscsi_cmd *cmd = NULL, *cmd_tmp = NULL;
3942 struct iscsi_session *sess = conn->sess; 3942 struct iscsi_session *sess = conn->sess;
3943 struct se_cmd *se_cmd;
3944 /* 3943 /*
3945 * We expect this function to only ever be called from either RX or TX 3944 * We expect this function to only ever be called from either RX or TX
3946 * thread context via iscsit_close_connection() once the other context 3945 * thread context via iscsit_close_connection() once the other context
@@ -3953,16 +3952,13 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
3953 list_del(&cmd->i_list); 3952 list_del(&cmd->i_list);
3954 spin_unlock_bh(&conn->cmd_lock); 3953 spin_unlock_bh(&conn->cmd_lock);
3955 iscsit_increment_maxcmdsn(cmd, sess); 3954 iscsit_increment_maxcmdsn(cmd, sess);
3956 se_cmd = &cmd->se_cmd;
3957 /* 3955 /*
3958 * Special cases for active iSCSI TMR, and 3956 * Special cases for active iSCSI TMR, and
3959 * transport_lookup_cmd_lun() failing from 3957 * transport_lookup_cmd_lun() failing from
3960 * iscsit_get_lun_for_cmd() in iscsit_handle_scsi_cmd(). 3958 * iscsit_get_lun_for_cmd() in iscsit_handle_scsi_cmd().
3961 */ 3959 */
3962 if (cmd->tmr_req && se_cmd->transport_wait_for_tasks) 3960 if (cmd->tmr_req)
3963 se_cmd->transport_wait_for_tasks(se_cmd, 1); 3961 transport_generic_free_cmd(&cmd->se_cmd, 1);
3964 else if (cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD)
3965 transport_release_cmd(se_cmd);
3966 else 3962 else
3967 iscsit_release_cmd(cmd); 3963 iscsit_release_cmd(cmd);
3968 3964
@@ -3973,10 +3969,8 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
3973 spin_unlock_bh(&conn->cmd_lock); 3969 spin_unlock_bh(&conn->cmd_lock);
3974 3970
3975 iscsit_increment_maxcmdsn(cmd, sess); 3971 iscsit_increment_maxcmdsn(cmd, sess);
3976 se_cmd = &cmd->se_cmd;
3977 3972
3978 if (se_cmd->transport_wait_for_tasks) 3973 transport_generic_free_cmd(&cmd->se_cmd, 1);
3979 se_cmd->transport_wait_for_tasks(se_cmd, 1);
3980 3974
3981 spin_lock_bh(&conn->cmd_lock); 3975 spin_lock_bh(&conn->cmd_lock);
3982 } 3976 }
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)
143 list_del(&cmd->i_list); 143 list_del(&cmd->i_list);
144 cmd->conn = NULL; 144 cmd->conn = NULL;
145 spin_unlock(&cr->conn_recovery_cmd_lock); 145 spin_unlock(&cr->conn_recovery_cmd_lock);
146 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) || 146 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
147 !(cmd->se_cmd.transport_wait_for_tasks))
148 iscsit_release_cmd(cmd); 147 iscsit_release_cmd(cmd);
149 else 148 else
150 cmd->se_cmd.transport_wait_for_tasks( 149 transport_generic_free_cmd(&cmd->se_cmd, 1);
151 &cmd->se_cmd, 1);
152 spin_lock(&cr->conn_recovery_cmd_lock); 150 spin_lock(&cr->conn_recovery_cmd_lock);
153 } 151 }
154 spin_unlock(&cr->conn_recovery_cmd_lock); 152 spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -170,12 +168,10 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
170 list_del(&cmd->i_list); 168 list_del(&cmd->i_list);
171 cmd->conn = NULL; 169 cmd->conn = NULL;
172 spin_unlock(&cr->conn_recovery_cmd_lock); 170 spin_unlock(&cr->conn_recovery_cmd_lock);
173 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) || 171 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
174 !(cmd->se_cmd.transport_wait_for_tasks))
175 iscsit_release_cmd(cmd); 172 iscsit_release_cmd(cmd);
176 else 173 else
177 cmd->se_cmd.transport_wait_for_tasks( 174 transport_generic_free_cmd(&cmd->se_cmd, 1);
178 &cmd->se_cmd, 1);
179 spin_lock(&cr->conn_recovery_cmd_lock); 175 spin_lock(&cr->conn_recovery_cmd_lock);
180 } 176 }
181 spin_unlock(&cr->conn_recovery_cmd_lock); 177 spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -260,12 +256,10 @@ void iscsit_discard_cr_cmds_by_expstatsn(
260 iscsit_remove_cmd_from_connection_recovery(cmd, sess); 256 iscsit_remove_cmd_from_connection_recovery(cmd, sess);
261 257
262 spin_unlock(&cr->conn_recovery_cmd_lock); 258 spin_unlock(&cr->conn_recovery_cmd_lock);
263 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) || 259 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
264 !(cmd->se_cmd.transport_wait_for_tasks))
265 iscsit_release_cmd(cmd); 260 iscsit_release_cmd(cmd);
266 else 261 else
267 cmd->se_cmd.transport_wait_for_tasks( 262 transport_generic_free_cmd(&cmd->se_cmd, 1);
268 &cmd->se_cmd, 1);
269 spin_lock(&cr->conn_recovery_cmd_lock); 263 spin_lock(&cr->conn_recovery_cmd_lock);
270 } 264 }
271 spin_unlock(&cr->conn_recovery_cmd_lock); 265 spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -319,12 +313,10 @@ int iscsit_discard_unacknowledged_ooo_cmdsns_for_conn(struct iscsi_conn *conn)
319 list_del(&cmd->i_list); 313 list_del(&cmd->i_list);
320 314
321 spin_unlock_bh(&conn->cmd_lock); 315 spin_unlock_bh(&conn->cmd_lock);
322 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) || 316 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
323 !(cmd->se_cmd.transport_wait_for_tasks))
324 iscsit_release_cmd(cmd); 317 iscsit_release_cmd(cmd);
325 else 318 else
326 cmd->se_cmd.transport_wait_for_tasks( 319 transport_generic_free_cmd(&cmd->se_cmd, 1);
327 &cmd->se_cmd, 1);
328 spin_lock_bh(&conn->cmd_lock); 320 spin_lock_bh(&conn->cmd_lock);
329 } 321 }
330 spin_unlock_bh(&conn->cmd_lock); 322 spin_unlock_bh(&conn->cmd_lock);
@@ -378,12 +370,10 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
378 list_del(&cmd->i_list); 370 list_del(&cmd->i_list);
379 spin_unlock_bh(&conn->cmd_lock); 371 spin_unlock_bh(&conn->cmd_lock);
380 372
381 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) || 373 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
382 !(cmd->se_cmd.transport_wait_for_tasks))
383 iscsit_release_cmd(cmd); 374 iscsit_release_cmd(cmd);
384 else 375 else
385 cmd->se_cmd.transport_wait_for_tasks( 376 transport_generic_free_cmd(&cmd->se_cmd, 1);
386 &cmd->se_cmd, 1);
387 spin_lock_bh(&conn->cmd_lock); 377 spin_lock_bh(&conn->cmd_lock);
388 continue; 378 continue;
389 } 379 }
@@ -404,12 +394,10 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
404 list_del(&cmd->i_list); 394 list_del(&cmd->i_list);
405 spin_unlock_bh(&conn->cmd_lock); 395 spin_unlock_bh(&conn->cmd_lock);
406 396
407 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) || 397 if (!(cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD))
408 !(cmd->se_cmd.transport_wait_for_tasks))
409 iscsit_release_cmd(cmd); 398 iscsit_release_cmd(cmd);
410 else 399 else
411 cmd->se_cmd.transport_wait_for_tasks( 400 transport_generic_free_cmd(&cmd->se_cmd, 1);
412 &cmd->se_cmd, 1);
413 spin_lock_bh(&conn->cmd_lock); 401 spin_lock_bh(&conn->cmd_lock);
414 continue; 402 continue;
415 } 403 }
@@ -434,9 +422,8 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
434 422
435 iscsit_free_all_datain_reqs(cmd); 423 iscsit_free_all_datain_reqs(cmd);
436 424
437 if ((cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) && 425 if (cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD)
438 cmd->se_cmd.transport_wait_for_tasks) 426 transport_wait_for_tasks(&cmd->se_cmd);
439 cmd->se_cmd.transport_wait_for_tasks(&cmd->se_cmd, 0);
440 /* 427 /*
441 * Add the struct iscsi_cmd to the connection recovery cmd list 428 * Add the struct iscsi_cmd to the connection recovery cmd list
442 */ 429 */