Skip to contentSkip to conversation

cluster/group/gfs_controld Makefile cpg.c grou ...

Cluster-devel [email protected] 1 participant 1 message Jun 15, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-06-15 20:41:46

Modified files:
group/gfs_controld: Makefile cpg.c group.c lock_dlm.h main.c
member_cman.c recover.c

Log message:
Complete the code to support withdraw, not yet tested. This also switches from using dlm locks for withdraw notifications to simply using messages. The way the daemon now works allows a much simpler approach to withdraw than what we had before where we needed the dlm locks. Setting up a dlm lockspace for the daemon was also an annoyingly heavy-weight step and the dlm kernel state of the daemon made cleaning up from crashes difficult.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/Makefile.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/group.c.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/main.c.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/member_cman.c.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&r1=1.2&r2=1.3

group/gfs_controld/Makefile +1 -4
@@ -22,8 +22,7 @@
 	-I../include/ \
 	-I../lib/ \
 	-I../../cman/lib/ \
-	-I../../cman/daemon/openais/trunk/include/ \
-	-I../../dlm/lib/
+	-I../../cman/daemon/openais/trunk/include/
 
 TARGET=gfs_controld
 
@@ -38,8 +37,6 @@
 		group.o \
 		plock.o \
 		recover.o \
-		withdraw.o \
-		../../dlm/lib/libdlm_lt.a \
 		../../cman/lib/libcman.a \
 		../../cman/daemon/openais/trunk/lib/libcpg.a \
 		../lib/libgroup.a
group/gfs_controld/cpg.c +5 -0
@@ -24,6 +24,7 @@
 void receive_options(struct mountgroup *mg, char *buf, int len, int from);
 void receive_remount(struct mountgroup *mg, char *buf, int len, int from);
 void receive_plock(struct mountgroup *mg, char *buf, int len, int from);
+void receive_withdraw(struct mountgroup *mg, char *buf, int len, int from);
 void receive_recovery_status(struct mountgroup *mg, char *buf, int len,
 			     int from);
 void receive_recovery_done(struct mountgroup *mg, char *buf, int len, int from);
@@ -88,6 +89,10 @@
 		receive_recovery_done(mg, data, len, nodeid);
 		break;
 
+	case MSG_WITHDRAW:
+		receive_withdraw(mg, data, len, nodeid);
+		break;
+
 	default:
 		log_error("unknown message type %d from %d",
 			  hd->type, hd->nodeid);
group/gfs_controld/group.c +0 -2
@@ -147,8 +147,6 @@
 		log_debug("groupd callback: terminate %s", cb_name);
 		mg->last_callback = DO_TERMINATE;
 		do_terminate(mg);
-		list_del(&mg->list);
-		free(mg);
 		break;
 
 	case DO_SETID:
group/gfs_controld/lock_dlm.h +3 -7
@@ -36,7 +36,6 @@
 #include "list.h"
 #include "linux_endian.h"
 #include "libgroup.h"
-#include "libdlm.h"
 
 #define MAXARGS			64
 #define MAXLINE			256
@@ -184,11 +183,10 @@
 	int			wait_gfs_recover_done;
 	int			gone_event;
 	int			gone_type;
-	int			mount_finished;
+	int			finished;
 	int			local_recovery_status;
 	int			recovery_status;
-	int			withdraw;
-	struct dlm_lksb		wd_lksb;
+	int			withdrawing;
 	int			needs_journals;
 };
 
@@ -197,6 +195,7 @@
 	MSG_OPTIONS,
 	MSG_REMOUNT,
 	MSG_PLOCK,
+	MSG_WITHDRAW,
 	MSG_RECOVERY_STATUS,
 	MSG_RECOVERY_DONE,
 };
@@ -223,12 +222,9 @@
 int process_cpg(void);
 int setup_groupd(void);
 int process_groupd(void);
-int setup_libdlm(void);
-int process_libdlm(void);
 int setup_plocks(void);
 int process_plocks(void);
 void exit_cman(void);
-void exit_libdlm(void);
 
 int do_mount(int ci, char *dir, char *type, char *proto, char *table,
 	     char *options);
group/gfs_controld/main.c +2 -12
@@ -29,10 +29,10 @@
 static int listen_fd;
 static int groupd_fd;
 static int uevent_fd;
-static int libdlm_fd;
 static int plocks_fd;
 
 extern struct list_head mounts;
+extern struct list_head withdrawn_mounts;
 int no_withdraw;
 
 static void make_args(char *buf, int *argc, char **argv, char sep)
@@ -266,14 +266,6 @@
 		goto out;
 	client_add(uevent_fd, &maxi);
 
-	if (no_withdraw)
-		goto next;
-
-	rv = libdlm_fd = setup_libdlm();
-	if (rv < 0)
-		goto next;
-	client_add(libdlm_fd, &maxi);
- next:
 	rv = plocks_fd = setup_plocks();
 	if (rv < 0)
 		goto out;
@@ -309,9 +301,6 @@
 					process_cpg();
 				else if (pollfd[i].fd == uevent_fd)
 					process_uevent();
-				else if (!no_withdraw &&
-					 pollfd[i].fd == libdlm_fd)
-					process_libdlm();
 				else if (pollfd[i].fd == plocks_fd)
 					process_plocks();
 				else
@@ -456,6 +445,7 @@
 {
 	prog_name = argv[0];
 	INIT_LIST_HEAD(&mounts);
+	INIT_LIST_HEAD(&withdrawn_mounts);
 	client_init();
 
 	decode_arguments(argc, argv);
group/gfs_controld/member_cman.c +0 -3
@@ -43,10 +43,7 @@
 
 void exit_cman(void)
 {
-	/* do we want to try to forcibly clean some stuff up
-	   in the kernel here? */
 	log_error("cluster is down, exiting");
-	exit_libdlm();
 	exit(1);
 }
 
group/gfs_controld/recover.c +117 -32

257 lines not on this page · raw message