* [Cluster-devel] cluster/group/gfs_controld Makefile recover.c
@ 2007-06-08 18:07 rohara
0 siblings, 0 replies; 2+ messages in thread
From: rohara @ 2007-06-08 18:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] cluster/group/gfs_controld Makefile recover.c
@ 2007-06-08 19:01 rohara
0 siblings, 0 replies; 2+ messages in thread
From: rohara @ 2007-06-08 19:01 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rohara at 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-08 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-08 19:01 [Cluster-devel] cluster/group/gfs_controld Makefile recover.c rohara
-- strict thread matches above, loose matches on Subject: below --
2007-06-08 18:07 rohara
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.