|
From: <vl...@us...> - 2011-06-30 01:01:23
|
Revision: 3645
http://scst.svn.sourceforge.net/scst/?rev=3645&view=rev
Author: vlnb
Date: 2011-06-30 01:01:17 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
- scst_check_local_events() should be called in scst_real_exec() and
scst_local_exec(), because if a command passed in those procedures, it
for sure was delayed in some list, so recheck if it was aborted is
necessary.
- Cleanup
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-06-29 01:45:42 UTC (rev 3644)
+++ trunk/scst/src/scst_targ.c 2011-06-30 01:01:17 UTC (rev 3645)
@@ -2587,13 +2587,17 @@
static inline int scst_real_exec(struct scst_cmd *cmd)
{
- int res;
+ int res, rc;
TRACE_ENTRY();
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_SAME != SCST_EXEC_NOT_COMPLETED);
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_NEXT != SCST_EXEC_COMPLETED);
+ rc = scst_check_local_events(cmd);
+ if (unlikely(rc != 0))
+ goto out_done;
+
__scst_cmd_get(cmd);
res = scst_do_real_exec(cmd);
@@ -2611,8 +2615,14 @@
/* SCST_EXEC_* match SCST_CMD_STATE_RES_* */
+out:
TRACE_EXIT_RES(res);
return res;
+
+out_done:
+ cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME);
+ res = SCST_CMD_STATE_RES_CONT_NEXT;
+ goto out;
}
static int scst_do_local_exec(struct scst_cmd *cmd)
@@ -2678,13 +2688,17 @@
static int scst_local_exec(struct scst_cmd *cmd)
{
- int res;
+ int res, rc;
TRACE_ENTRY();
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_SAME != SCST_EXEC_NOT_COMPLETED);
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_NEXT != SCST_EXEC_COMPLETED);
+ rc = scst_check_local_events(cmd);
+ if (unlikely(rc != 0))
+ goto out_done;
+
__scst_cmd_get(cmd);
res = scst_do_local_exec(cmd);
@@ -2698,8 +2712,15 @@
__scst_cmd_put(cmd);
/* SCST_EXEC_* match SCST_CMD_STATE_RES_* */
+
+out:
TRACE_EXIT_RES(res);
return res;
+
+out_done:
+ cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME);
+ res = SCST_CMD_STATE_RES_CONT_NEXT;
+ goto out;
}
static int scst_pre_exec_checks(struct scst_cmd *cmd)
@@ -2728,7 +2749,7 @@
{
struct scst_cmd *cmd = *active_cmd;
struct scst_cmd *ref_cmd;
- int count = 0, rc;
+ int count = 0;
TRACE_ENTRY();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|