diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-10-03 16:37:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 19:08:34 -0400 |
commit | a0348152bd365caadc105f11da03fc020bcc6226 (patch) | |
tree | e7d1900dc2dfcedcb8443ef1e3412be94579e476 /drivers/target/iscsi | |
parent | 009dfd4415d898150824d352905fcb80ae1de16e (diff) |
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>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 96e7fdbba9fc..77dad2474c8c 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c | |||
@@ -734,7 +734,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) | |||
734 | * Fallthrough | 734 | * Fallthrough |
735 | */ | 735 | */ |
736 | case ISCSI_OP_SCSI_TMFUNC: | 736 | case ISCSI_OP_SCSI_TMFUNC: |
737 | rc = transport_generic_free_cmd(&cmd->se_cmd, 1); | 737 | rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); |
738 | if (!rc && shutdown && se_cmd && se_cmd->se_sess) { | 738 | if (!rc && shutdown && se_cmd && se_cmd->se_sess) { |
739 | __iscsit_free_cmd(cmd, true, shutdown); | 739 | __iscsit_free_cmd(cmd, true, shutdown); |
740 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); | 740 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); |
@@ -750,7 +750,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) | |||
750 | se_cmd = &cmd->se_cmd; | 750 | se_cmd = &cmd->se_cmd; |
751 | __iscsit_free_cmd(cmd, true, shutdown); | 751 | __iscsit_free_cmd(cmd, true, shutdown); |
752 | 752 | ||
753 | rc = transport_generic_free_cmd(&cmd->se_cmd, 1); | 753 | rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); |
754 | if (!rc && shutdown && se_cmd->se_sess) { | 754 | if (!rc && shutdown && se_cmd->se_sess) { |
755 | __iscsit_free_cmd(cmd, true, shutdown); | 755 | __iscsit_free_cmd(cmd, true, shutdown); |
756 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); | 756 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); |