[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
Branch: 	RHEL5
Changes by:	rohara sourceware org	2007-06-08 18:07:45

Modified files:
	group/gfs_controld: Makefile recover.c 

Log message:
	Get nodir from lockspace XML node via ccs_get.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7&r2=1.7.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.23.2.7&r2=1.23.2.8

--- cluster/group/gfs_controld/Makefile	2006/08/11 15:18:15	1.7
+++ cluster/group/gfs_controld/Makefile	2007/06/08 18:07:45	1.7.2.1
@@ -19,9 +19,11 @@
 	-idirafter ${KERNEL_SRC}/include/linux \
 	-I${incdir} \
 	-I${top_srcdir}/config \
+	-I../../ccs/lib/ \
 	-I../../cman/lib \
 	-I../include/ \
 	-I../lib/
+
 LDFLAGS+= -L../../cman/lib -L${libdir}/openais -L${libdir}
 
 TARGET=gfs_controld
@@ -34,7 +36,8 @@
 		group.o \
 		plock.o \
 		recover.o \
-		../lib/libgroup.a
+		../lib/libgroup.a \
+		../../ccs/lib/libccs.a
 	$(CC) $(LDFLAGS) -o $@ $^ -lcman -lcpg -lSaCkpt
 
 
--- cluster/group/gfs_controld/recover.c	2007/06/06 15:47:42	1.23.2.7
+++ cluster/group/gfs_controld/recover.c	2007/06/08 18:07:45	1.23.2.8
@@ -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]