[Sheepdog] [PATCH 5/6] add cflags to cpg_event struct

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed May 5 21:08:36 CEST 2010


we need more states than 'skip' for cpg_event struct.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 collie/collie.h |    6 +++++-
 collie/group.c  |    6 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/collie/collie.h b/collie/collie.h
index 1428645..2c21fc0 100644
--- a/collie/collie.h
+++ b/collie/collie.h
@@ -31,10 +31,14 @@ enum cpg_event_type {
 	CPG_EVENT_REQUEST,
 };
 
+enum cpg_event_bits {
+	CPG_EVENT_SKIP = 1,
+};
+
 struct cpg_event {
 	enum cpg_event_type ctype;
 	struct list_head cpg_event_list;
-	unsigned int skip;
+	unsigned long cflags;
 };
 
 struct client_info {
diff --git a/collie/group.c b/collie/group.c
index 16e973b..2361a39 100644
--- a/collie/group.c
+++ b/collie/group.c
@@ -789,7 +789,7 @@ static void update_running_vm_state(struct cpg_event *cevent)
 		list_add(&vm->list, &sys->vm_list);
 	}
 out:
-	cevent->skip = 1;
+	set_bit(CPG_EVENT_SKIP, &cevent->cflags);
 }
 
 static void __sd_deliver(struct cpg_event *cevent)
@@ -810,7 +810,7 @@ static void __sd_deliver(struct cpg_event *cevent)
 	 */
 	if (!sys->join_finished) {
 		if (m->pid != sys->this_pid || m->nodeid != sys->this_nodeid) {
-			cevent->skip = 1;
+			set_bit(CPG_EVENT_SKIP, &cevent->cflags);
 			return;
 		}
 	}
@@ -1241,7 +1241,7 @@ static void cpg_event_done(struct work *w, int idx)
 	if (cpg_event_suspended())
 		goto out;
 
-	if (cevent->skip)
+	if (test_bit(CPG_EVENT_SKIP, &cevent->cflags))
 		goto out;
 
 	switch (cevent->ctype) {
-- 
1.6.5




More information about the sheepdog mailing list