[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/daemon cman.c gd_internal.h join ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	teigland sourceware org	2007-09-17 13:47:58

Modified files:
	group/daemon   : cman.c gd_internal.h joinleave.c 

Log message:
	set dirty flag in cman

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cman.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.27.2.2&r2=1.27.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44.2.3&r2=1.44.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.19.2.2&r2=1.19.2.3

--- cluster/group/daemon/cman.c	2006/12/14 19:54:43	1.27.2.2
+++ cluster/group/daemon/cman.c	2007/09/17 13:47:58	1.27.2.3
@@ -5,6 +5,7 @@
 #include "gd_internal.h"
 
 static cman_handle_t	ch;
+static cman_handle_t	ch_admin;
 static int		old_quorate;
 static cman_node_t	old_nodes[MAX_NODES];
 static int		old_node_count;
@@ -15,16 +16,16 @@
 
 int kill_cman(int nodeid)
 {
-	cman_handle_t ach;
+	return cman_kill_node(ch_admin, nodeid);
+}
+
+int set_cman_dirty(void)
+{
 	int rv;
 
-	ach = cman_admin_init(NULL);
-	if (!ach) {
-		log_print("cman_admin_init error %d %d", (int) ch, errno);
-		return -ENOTCONN;
-	}
-	rv = cman_kill_node(ach, nodeid);
-	cman_finish(ach);
+	rv = cman_set_dirty(ch_admin);
+	if (rv)
+		log_print("cman_set_dirty error %d", rv);
 	return rv;
 }
 
@@ -141,20 +142,24 @@
 		return -ENOTCONN;
 	}
 
+	ch_admin = cman_admin_init(NULL);
+	if (!ch_admin) {
+		log_print("cman_admin_init error %d %d", (int) ch_admin, errno);
+		rv = -ENOTCONN;
+		goto fail1;
+	}
+
 	rv = cman_start_notification(ch, cman_callback);
 	if (rv < 0) {
 		log_print("cman_start_notification error %d %d", rv, errno);
-		cman_finish(ch);
-		return rv;
+		goto fail2;
 	}
 
 	memset(&node, 0, sizeof(node));
 	rv = cman_get_node(ch, CMAN_NODEID_US, &node);
 	if (rv < 0) {
 		log_print("cman_get_node us error %d %d", rv, errno);
-		cman_stop_notification(ch);
-		cman_finish(ch);
-		goto out;
+		goto fail3;
 	}
 
 	cman_node_count = 0;
@@ -162,7 +167,7 @@
 	rv = cman_get_nodes(ch, MAX_NODES, &cman_node_count, cman_nodes);
 	if (rv < 0) {
 		log_print("cman_get_nodes error %d %d", rv, errno);
-		goto out;
+		goto fail3;
 	}
 
 	cman_quorate = cman_is_quorate(ch);
@@ -176,9 +181,14 @@
 
 	fd = cman_get_fd(ch);
 	client_add(fd, process_cman, close_cman);
+	return 0;
 
-	rv = 0;
- out:
+ fail3:
+	cman_stop_notification(ch);
+ fail2:
+	cman_finish(ch_admin);
+ fail1:
+	cman_finish(ch);
 	return rv;
 }
 
--- cluster/group/daemon/gd_internal.h	2007/02/09 16:03:24	1.44.2.3
+++ cluster/group/daemon/gd_internal.h	2007/09/17 13:47:58	1.44.2.4
@@ -277,6 +277,7 @@
 /* cman.c */
 int setup_cman(void);
 int kill_cman(int nodeid);
+int set_cman_dirty(void);
 
 /* cpg.c */
 int setup_cpg(void);
--- cluster/group/daemon/joinleave.c	2007/09/07 19:22:08	1.19.2.2
+++ cluster/group/daemon/joinleave.c	2007/09/17 13:47:58	1.19.2.3
@@ -87,6 +87,10 @@
 		goto out;
 	}
 
+	rv = set_cman_dirty();
+	if (rv)
+		goto out;
+
 	rv = create_group(name, level, &g);
 	if (rv)
 		goto out;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]