All of lore.kernel.org
 help / color / mirror / Atom feed
From: rohara@sourceware.org <rohara@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/gfs_controld Makefile recover.c
Date: 8 Jun 2007 18:07:46 -0000	[thread overview]
Message-ID: <20070608180746.22584.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rohara at 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);



             reply	other threads:[~2007-06-08 18:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 18:07 rohara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-08 19:01 [Cluster-devel] cluster/group/gfs_controld Makefile recover.c rohara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070608180746.22584.qmail@sourceware.org \
    --to=rohara@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.