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

[Cluster-devel] cluster/cman/daemon Makefile barrier.c commands.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield sourceware org	2007-06-26 12:29:17

Modified files:
	cman/daemon    : Makefile barrier.c commands.c 

Log message:
	Use new timers system in openais 0.80.3

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.47&r2=1.47.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/barrier.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8&r2=1.8.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.7&r2=1.55.2.8

--- cluster/cman/daemon/Makefile	2006/08/11 15:18:04	1.47
+++ cluster/cman/daemon/Makefile	2007/06/26 12:29:17	1.47.2.1
@@ -16,7 +16,7 @@
 include ${top_srcdir}/make/defines.mk
 
 CFLAGS+= -fPIC -I${ccsincdir} -I${incdir} -I${top_srcdir}/config \
-	-DCMAN_RELEASE_NAME=\"${RELEASE}\" -I../lib -DOPENAIS_EXTERNAL_SERVICE
+	-DCMAN_RELEASE_NAME=\"${RELEASE}\" -DOPENAIS_EXTERNAL_SERVICE
 
 ifeq ($(DEBUG),y)
 CFLAGS+= -O0 -g -DDEBUG
@@ -30,7 +30,7 @@
 all:  ${TARGET}
 
 service_cman.lcrso: ${CMAN_OBJS}
-	$(CC) $(CFLAGS) -shared -Wl,-soname,service_cman.lcrso -o $@ ${CMAN_OBJS} -L../lib -L${ccslibdir} -lccs
+	$(CC) $(CFLAGS) -shared -Wl,-soname,service_cman.lcrso -o $@ ${CMAN_OBJS} -L${ccslibdir} -lccs
 
 daemon.o: daemon.c list.h cnxman-socket.h cnxman-private.h \
   daemon.h logging.h commands.h barrier.h cmanccs.h
--- cluster/cman/daemon/barrier.c	2006/06/30 13:00:26	1.8
+++ cluster/cman/daemon/barrier.c	2007/06/26 12:29:17	1.8.2.1
@@ -33,6 +33,7 @@
 
 #include <openais/totem/totemip.h>
 #include <openais/totem/aispoll.h>
+#include <openais/service/timer.h>
 #include "list.h"
 #include "cnxman-socket.h"
 #include "cnxman-private.h"
@@ -43,7 +44,6 @@
 #include "ais.h"
 
 extern int we_are_a_cluster_member;
-extern poll_handle ais_poll_handle;
 
 /* A barrier */
 struct cl_barrier {
@@ -62,7 +62,7 @@
 	unsigned long timeout;	/* In seconds */
 
 	struct connection *con;
-	poll_timer_handle timer;
+	openais_timer_handle timer;
 };
 
 /* A list of all current barriers */
@@ -71,7 +71,7 @@
 static void send_barrier_complete_msg(struct cl_barrier *barrier)
 {
 	if (barrier->timeout) {
-		poll_timer_delete(ais_poll_handle, barrier->timer);
+		openais_timer_delete(barrier->timer);
 		barrier->timeout = 0;
 	}
 
@@ -285,8 +285,8 @@
 
 		/* Start the timer if one was wanted */
 		if (barrier->timeout) {
-			poll_timer_add(ais_poll_handle, barrier->timeout, barrier,
-				       barrier_timer_fn, &barrier->timer);
+			openais_timer_add_duration((unsigned long long)barrier->timeout*1000000000ULL, barrier,
+						   barrier_timer_fn, &barrier->timer);
 		}
 
 		P_BARRIER("Sending WAIT for %s\n", barrier->name);
--- cluster/cman/daemon/commands.c	2007/05/18 12:46:30	1.55.2.7
+++ cluster/cman/daemon/commands.c	2007/06/26 12:29:17	1.55.2.8
@@ -34,6 +34,7 @@
 #include <openais/totem/totempg.h>
 #include <openais/service/swab.h>
 #include <openais/service/print.h>
+#include <openais/service/timer.h>
 #include <openais/totem/aispoll.h>
 #include "list.h"
 #include "cnxman-socket.h"
@@ -69,19 +70,18 @@
        char cluster_name[MAX_CLUSTER_NAME_LEN+1];
 static char nodename[MAX_CLUSTER_MEMBER_NAME_LEN+1];
 static int wanted_nodeid;
-extern poll_handle ais_poll_handle;
 static struct cluster_node *quorum_device;
 static uint16_t cluster_id;
 static int ais_running;
 static time_t join_time;
-static poll_timer_handle quorum_device_timer;
+static openais_timer_handle quorum_device_timer;
 
 /* If CCS gets out of sync, we poll it until it isn't */
-static poll_timer_handle ccsd_timer;
+static openais_timer_handle ccsd_timer;
 static unsigned int wanted_config_version;
 static int config_error;
 
-static poll_timer_handle shutdown_timer;
+static openais_timer_handle shutdown_timer;
 static struct connection *shutdown_con;
 static uint32_t shutdown_flags;
 static int shutdown_yes;
@@ -858,7 +858,7 @@
 	/* All replies safely gathered in ? */
 	if (shutdown_yes + shutdown_no >= shutdown_expected) {
 
-		poll_timer_delete(ais_poll_handle, shutdown_timer);
+		openais_timer_delete(shutdown_timer);
 
 		if (shutdown_yes >= shutdown_expected ||
 		    shutdown_flags & SHUTDOWN_ANYWAY) {
@@ -941,10 +941,10 @@
 	}
 	else {
 
-		/* Start the timer. If we don't get a full set of replies before this goes
-		   off we'll cancel the shutdown */
-		poll_timer_add(ais_poll_handle, shutdown_timeout, NULL,
-			       shutdown_timer_fn, &shutdown_timer);
+		/* Start the timer. If we don't get a full set of replies before
+ 		 * this goes off we'll cancel the shutdown */
+		openais_timer_add_duration((unsigned long long)shutdown_timeout*1000000, NULL,
+					   shutdown_timer_fn, &shutdown_timer);
 
 		notify_listeners(NULL, EVENT_REASON_TRY_SHUTDOWN, flags);
 
@@ -1023,10 +1023,10 @@
 	ccs_err = read_ccs_nodes(&config_version, 0);
 	if (ccs_err || config_version < wanted_config_version) {
 		log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
-				wanted_config_version);
+			wanted_config_version);
 
-		poll_timer_add(ais_poll_handle, ccsd_poll_interval, NULL,
-			       ccsd_timer_fn, &ccsd_timer);
+		openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
+					   ccsd_timer_fn, &ccsd_timer);
 	}
 	else {
 		log_msg(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
@@ -1049,8 +1049,8 @@
 		recalculate_quorum(0);
 	}
 	else {
-		poll_timer_add(ais_poll_handle, quorumdev_poll, quorum_device,
-			       quorum_device_timer_fn, &quorum_device_timer);
+		openais_timer_add_duration((unsigned long long)quorumdev_poll*1000000, quorum_device,
+					   quorum_device_timer_fn, &quorum_device_timer);
 	}
 }
 
@@ -1069,15 +1069,15 @@
                         quorum_device->state = NODESTATE_MEMBER;
                         recalculate_quorum(0);
 
-			poll_timer_add(ais_poll_handle, quorumdev_poll, quorum_device,
-				       quorum_device_timer_fn, &quorum_device_timer);
+			openais_timer_add_duration((unsigned long long)quorumdev_poll*1000000, quorum_device,
+						   quorum_device_timer_fn, &quorum_device_timer);
                 }
         }
         else {
                 if (quorum_device->state == NODESTATE_MEMBER) {
                         quorum_device->state = NODESTATE_DEAD;
                         recalculate_quorum(0);
-			poll_timer_delete(ais_poll_handle, quorum_device_timer);
+			openais_timer_delete(quorum_device_timer);
                 }
         }
 
@@ -1492,8 +1492,8 @@
 				msg->config_version);
 
 			wanted_config_version = msg->config_version;
-			poll_timer_add(ais_poll_handle, ccsd_poll_interval, NULL,
-				       ccsd_timer_fn, &ccsd_timer);
+			openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
+						   ccsd_timer_fn, &ccsd_timer);
 		}
 		if (config_version > msg->config_version) {
 			// TODO tell everyone else to update...
@@ -1652,8 +1652,8 @@
 			recalculate_quorum(0);
 
 			wanted_config_version = config_version;
-			poll_timer_add(ais_poll_handle, ccsd_poll_interval, NULL,
-				       ccsd_timer_fn, &ccsd_timer);
+			openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
+						   ccsd_timer_fn, &ccsd_timer);
 		}
 		break;
 	}


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