summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/syncop.c2
-rw-r--r--libglusterfs/src/syncop.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 45416c6e75f..cf92d9ad1f4 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -34,6 +34,7 @@ __run (struct synctask *task)
list_del_init (&task->all_tasks);
switch (task->state) {
case SYNCTASK_INIT:
+ case SYNCTASK_SUSPEND:
break;
case SYNCTASK_RUN:
gf_log (task->xl->name, GF_LOG_WARNING,
@@ -65,6 +66,7 @@ __wait (struct synctask *task)
list_del_init (&task->all_tasks);
switch (task->state) {
case SYNCTASK_INIT:
+ case SYNCTASK_SUSPEND:
break;
case SYNCTASK_RUN:
env->runcount--;
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 12a00d58acc..3e7264d4f65 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -46,6 +46,7 @@ typedef int (*synctask_fn_t) (void *opaque);
typedef enum {
SYNCTASK_INIT = 0,
SYNCTASK_RUN,
+ SYNCTASK_SUSPEND,
SYNCTASK_WAIT,
SYNCTASK_DONE,
} synctask_state_t;
@@ -133,6 +134,7 @@ struct syncargs {
\
STACK_WIND_COOKIE (task->opframe, cbk, (void *)stb, \
subvol, op, params); \
+ task->state = SYNCTASK_SUSPEND; \
synctask_yield (stb->task); \
STACK_RESET (task->opframe->root); \
} while (0)