Reimplement dropping of TM requests in a more reliable manner

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5395 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-03-26 23:51:36 +00:00
parent 87ce86ee2d
commit 8599ec4452
5 changed files with 59 additions and 28 deletions
+13 -6
View File
@@ -2289,6 +2289,7 @@ struct scst_mgmt_cmd {
unsigned int cmd_sn_set:1; /* set, if cmd_sn field is valid */
/* Set if dev handler's task_mgmt_fn_received was called */
unsigned int task_mgmt_fn_received_called:1;
unsigned int mcmd_dropped:1; /* set if mcmd was dropped */
/*
* Number of commands to finish before sending response,
@@ -3717,12 +3718,6 @@ static inline int scst_mgmt_cmd_get_status(struct scst_mgmt_cmd *mcmd)
return mcmd->status;
}
/* Returns mgmt cmd's TM fn */
static inline int scst_mgmt_cmd_get_fn(struct scst_mgmt_cmd *mcmd)
{
return mcmd->fn;
}
static inline void scst_mgmt_cmd_set_status(struct scst_mgmt_cmd *mcmd,
int status)
{
@@ -3732,6 +3727,18 @@ static inline void scst_mgmt_cmd_set_status(struct scst_mgmt_cmd *mcmd,
mcmd->status = status;
}
/* Returns mgmt cmd's TM fn */
static inline int scst_mgmt_cmd_get_fn(struct scst_mgmt_cmd *mcmd)
{
return mcmd->fn;
}
/* Returns true if mgmt cmd should be dropped, i.e. response not sent */
static inline bool scst_mgmt_cmd_dropped(struct scst_mgmt_cmd *mcmd)
{
return mcmd->mcmd_dropped;
}
/*
* Called by dev handler's task_mgmt_fn_*() to notify SCST core that mcmd
* is going to complete asynchronously.