[Sheepdog] [PATCH] rename obscure sys->synchronized name

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Apr 21 06:03:46 CEST 2010


We use sys->synchronized to see if the node finishes the JOIN
procedure or not. Let's use more clear name, join_finished.

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

diff --git a/collie/collie.h b/collie/collie.h
index 163da8e..c1fd31c 100644
--- a/collie/collie.h
+++ b/collie/collie.h
@@ -57,7 +57,8 @@ struct request {
 
 struct cluster_info {
 	cpg_handle_t handle;
-	int synchronized;
+	/* set after finishing the JOIN procedure */
+	int join_finished;
 	uint32_t this_nodeid;
 	uint32_t this_pid;
 	struct sheepdog_node_list_entry this_node;
diff --git a/collie/group.c b/collie/group.c
index f1d1a19..9dc7d3d 100644
--- a/collie/group.c
+++ b/collie/group.c
@@ -359,7 +359,7 @@ static int is_master(void)
 {
 	struct node *node;
 
-	if (!sys->synchronized)
+	if (!sys->join_finished)
 		return 0;
 
 	node = list_first_entry(&sys->sd_node_list, struct node, list);
@@ -564,7 +564,7 @@ static void update_cluster_info(struct join_message *msg)
 	if (!sys->nr_sobjs)
 		sys->nr_sobjs = msg->nr_sobjs;
 
-	if (sys->synchronized)
+	if (sys->join_finished)
 		goto out;
 
 	for (i = 0; i < nr_nodes; i++) {
@@ -580,7 +580,7 @@ static void update_cluster_info(struct join_message *msg)
 				msg->nodes[i].nodeid, msg->nodes[i].pid);
 	}
 
-	sys->synchronized = 1;
+	sys->join_finished = 1;
 
 	if (sys->status == SD_STATUS_STARTUP && msg->cluster_status == SD_STATUS_OK) {
 		if (msg->epoch > 0) {
@@ -802,7 +802,7 @@ static void __sd_deliver(struct cpg_event *cevent)
 	 * we don't want to perform any deliver events until we
 	 * join; we wait for our JOIN message.
 	 */
-	if (!sys->synchronized) {
+	if (!sys->join_finished) {
 		if (m->pid != sys->this_pid || m->nodeid != sys->this_nodeid) {
 			cevent->skip = 1;
 			return;
@@ -944,7 +944,7 @@ static void __sd_confch(struct cpg_event *cevent)
 	if (member_list_entries == joined_list_entries - left_list_entries &&
 	    sys->this_nodeid == member_list[0].nodeid &&
 	    sys->this_pid == member_list[0].pid){
-		sys->synchronized = 1;
+		sys->join_finished = 1;
 		w->first_cpg_node = 1;
 	}
 
@@ -1395,7 +1395,6 @@ join_retry:
 		sys->this_node.id = hval;
 	}
 
-	sys->synchronized = 0;
 	sys->status = SD_STATUS_STARTUP;
 	INIT_LIST_HEAD(&sys->sd_node_list);
 	INIT_LIST_HEAD(&sys->cpg_node_list);
-- 
1.6.5




More information about the sheepdog mailing list