iscsi-target: Only perform wait_for_tasks when performing shutdown

This patch changes transport_generic_free_cmd() to only wait_for_tasks
when shutdown=true is passed to iscsit_free_cmd().

With the advent of >= v3.10 iscsi-target code using se_cmd->cmd_kref,
the extra wait_for_tasks with shutdown=false is unnecessary, and may
end up causing an extra context switch when releasing WRITEs.

Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

Changed files
+2 -2
drivers
target
+2 -2
drivers/target/iscsi/iscsi_target_util.c
··· 736 736 * Fallthrough 737 737 */ 738 738 case ISCSI_OP_SCSI_TMFUNC: 739 - rc = transport_generic_free_cmd(&cmd->se_cmd, 1); 739 + rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); 740 740 if (!rc && shutdown && se_cmd && se_cmd->se_sess) { 741 741 __iscsit_free_cmd(cmd, true, shutdown); 742 742 target_put_sess_cmd(se_cmd->se_sess, se_cmd); ··· 752 752 se_cmd = &cmd->se_cmd; 753 753 __iscsit_free_cmd(cmd, true, shutdown); 754 754 755 - rc = transport_generic_free_cmd(&cmd->se_cmd, 1); 755 + rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); 756 756 if (!rc && shutdown && se_cmd->se_sess) { 757 757 __iscsit_free_cmd(cmd, true, shutdown); 758 758 target_put_sess_cmd(se_cmd->se_sess, se_cmd);