iscsi-target: Only perform wait_for_tasks when performing shutdown
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 3 Oct 2013 20:37:21 +0000 (13:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Oct 2013 23:08:34 +0000 (16:08 -0700)
commita0348152bd365caadc105f11da03fc020bcc6226
treee7d1900dc2dfcedcb8443ef1e3412be94579e476
parent009dfd4415d898150824d352905fcb80ae1de16e
iscsi-target: Only perform wait_for_tasks when performing shutdown

commit e255a28598e8e63070322fc89bd34189dd660a89 upstream.

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.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/iscsi_target_util.c