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

[Cluster-devel] cluster/group/gfs_controld Makefile recover.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rohara sourceware org	2007-06-08 19:01:11

Modified files:
	group/gfs_controld: Makefile recover.c 

Log message:
	Read nodir from lockspace xml node via ccs_get.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/Makefile.diff?cvsroot=cluster&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&r1=1.30&r2=1.31

--- cluster/group/gfs_controld/Makefile	2007/06/01 09:45:35	1.10
+++ cluster/group/gfs_controld/Makefile	2007/06/08 19:01:10	1.11
@@ -22,12 +22,14 @@
 	recover.o
 
 CFLAGS += -g -O2
+CFLAGS += -I${ccsincdir}
 CFLAGS += -I${cmanincdir}
 CFLAGS += -idirafter ${KERNEL_SRC}/include/linux
 CFLAGS += -I../include/ -I../lib/
 CFLAGS += -I${incdir}
 
 LDFLAGS += -L${cmanlibdir} -L${openaislibdir} -L${libdir} -lcman -lcpg -lSaCkpt
+LDFLAGS += -L${ccslibdir} -lccs
 LDFLAGS += -L../lib -lgroup
 
 all: depends ${TARGET}
--- cluster/group/gfs_controld/recover.c	2007/06/06 15:44:49	1.30
+++ cluster/group/gfs_controld/recover.c	2007/06/08 19:01:11	1.31
@@ -11,6 +11,7 @@
 ******************************************************************************/
 
 #include "lock_dlm.h"
+#include "ccs.h"
 
 #define SYSFS_DIR	"/sys/fs"
 #define JID_INIT	-9
@@ -2033,15 +2034,18 @@
 	return 0;
 }
 
+#define LOCKSPACE_NODIR "/cluster/dlm/lockspace[ name=\"%s\"]/@nodir"
+
 void notify_mount_client(struct mountgroup *mg)
 {
-	char buf[MAXLINE];
-	int rv, error = 0;
+	char buf[MAXLINE], path[PATH_MAX], *str, tmp[MAXLINE];
+	int cd, rv, error = 0;
 	struct mg_member *memb;
-	
+
 	memb = find_memb_nodeid(mg, our_nodeid);
 
 	memset(buf, 0, MAXLINE);
+	memset(tmp, 0, MAXLINE);
 
 	if (mg->error_msg[0]) {
 		strncpy(buf, mg->error_msg, MAXLINE);
@@ -2058,6 +2062,28 @@
 		else
 			snprintf(buf, MAXLINE, "hostdata=jid=%d:id=%u:first=%d",
 		 		 mg->our_jid, mg->id, mg->first_mounter);
+
+		if ((cd = ccs_connect()) < 0) {
+			log_error("notify_mount_client: ccs_connect failed");
+		}
+
+		memset(path, 0, PATH_MAX);
+		sprintf(path, LOCKSPACE_NODIR, mg->name);
+
+		rv = ccs_get(cd, path, &str);
+		if (rv || !str) {
+			log_debug("notify_mount_client: nodir not found for "
+				  "lockspace %s", mg->name);
+		} else {
+			snprintf(tmp, MAXLINE, ":nodir=%d", atoi(str));
+			strcat(buf, tmp);
+			free(str);
+		}
+
+		if (cd) {
+			log_debug("notify_mount_client: ccs_disconnect");
+			ccs_disconnect(cd);
+		}
 	}
 
 	log_debug("notify_mount_client: %s", buf);


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