mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
- Improved handling of commands with TASK ABORTED status
- Minor cleanup git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1449 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1646,12 +1646,16 @@ int cmnd_rx_continue(struct iscsi_cmnd *req)
|
||||
|
||||
dir = scst_cmd_get_data_direction(scst_cmd);
|
||||
|
||||
/* Check prelim_compl_flags here to save R2Ts */
|
||||
if (unlikely(scst_cmd_completed(scst_cmd) ||
|
||||
unlikely(req->prelim_compl_flags != 0) ||
|
||||
unlikely(scst_cmd_aborted(scst_cmd)))) {
|
||||
if (scst_cmd_aborted(scst_cmd))
|
||||
set_bit(ISCSI_CMD_ABORTED, &req->prelim_compl_flags);
|
||||
/*
|
||||
* Check for preliminary completion here to save R2Ts. For TASK QUEUE
|
||||
* FULL statuses that might be a big performance win.
|
||||
*/
|
||||
if (unlikely(scst_cmd_prelim_completed(scst_cmd) ||
|
||||
unlikely(req->prelim_compl_flags != 0))) {
|
||||
/*
|
||||
* If necessary, ISCSI_CMD_ABORTED will be set by
|
||||
* iscsi_xmit_response().
|
||||
*/
|
||||
res = iscsi_preliminary_complete(req, req, true);
|
||||
goto trace;
|
||||
}
|
||||
|
||||
@@ -2497,7 +2497,7 @@ static inline void scst_sess_set_tgt_priv(struct scst_session *sess,
|
||||
* safely ignore this warning since in_atomic() is used here only for debugging
|
||||
* purposes.
|
||||
*/
|
||||
static inline int scst_cmd_atomic(struct scst_cmd *cmd)
|
||||
static inline bool scst_cmd_atomic(struct scst_cmd *cmd)
|
||||
{
|
||||
int res = cmd->atomic;
|
||||
#ifdef CONFIG_SCST_EXTRACHECKS
|
||||
@@ -2513,11 +2513,12 @@ static inline int scst_cmd_atomic(struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if cmd has been completed.
|
||||
* Returns TRUE if cmd has been preliminary completed, i.e. completed or
|
||||
* aborted.
|
||||
*/
|
||||
static inline int scst_cmd_completed(struct scst_cmd *cmd)
|
||||
static inline bool scst_cmd_prelim_completed(struct scst_cmd *cmd)
|
||||
{
|
||||
return cmd->completed;
|
||||
return cmd->completed || test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags);
|
||||
}
|
||||
|
||||
static inline enum scst_exec_context __scst_estimate_context(bool direct)
|
||||
|
||||
Reference in New Issue
Block a user