diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2018-06-22 14:52:56 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-07-02 16:44:31 -0400 |
commit | 65422d705f1abf65897464b4e9c51ec3e1376ec4 (patch) | |
tree | bd90e67d1427a20c5b8daf4be58918e513dddca9 /drivers/target/target_core_transport.c | |
parent | 709d56512fe8ed6d5092a1d43a4343d23df2b31c (diff) | |
download | linux-stable-65422d705f1abf65897464b4e9c51ec3e1376ec4.tar.gz linux-stable-65422d705f1abf65897464b4e9c51ec3e1376ec4.tar.bz2 linux-stable-65422d705f1abf65897464b4e9c51ec3e1376ec4.zip |
scsi: target: Fold core_tmr_handle_tas_abort() into transport_cmd_finish_abort()
For the two calls to transport_cmd_finish_abort() outside
core_tmr_handle_tas_abort() it is guaranteed that CMD_T_TAS is not set. Use
this property to fold core_tmr_handle_tas_abort() into
transport_cmd_finish_abort(). This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_transport.c')
-rw-r--r-- | drivers/target/target_core_transport.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 47318f64296d..3f95ddea6b1c 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -688,23 +688,27 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd) percpu_ref_put(&lun->lun_ref); } -int transport_cmd_finish_abort(struct se_cmd *cmd, int remove) +int transport_cmd_finish_abort(struct se_cmd *cmd) { + bool send_tas = cmd->transport_state & CMD_T_TAS; bool ack_kref = (cmd->se_cmd_flags & SCF_ACK_KREF); int ret = 0; + if (send_tas) + transport_send_task_abort(cmd); + if (cmd->se_cmd_flags & SCF_SE_LUN_CMD) transport_lun_remove_cmd(cmd); /* * Allow the fabric driver to unmap any resources before * releasing the descriptor via TFO->release_cmd() */ - if (remove) + if (!send_tas) cmd->se_tfo->aborted_task(cmd); if (transport_cmd_check_stop_to_fabric(cmd)) return 1; - if (remove && ack_kref) + if (!send_tas && ack_kref) ret = target_put_sess_cmd(cmd); return ret; |