- 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:
Vladislav Bolkhovitin
2010-01-11 19:41:23 +00:00
parent a0b91ecc55
commit 5b930aa9a4
2 changed files with 15 additions and 10 deletions

View File

@@ -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;
}

View File

@@ -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)