From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/daemon cman.c gd_internal.h join ...
Date: 17 Sep 2007 13:47:59 -0000 [thread overview]
Message-ID: <20070917134759.2908.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2007-09-17 13:47:58
Modified files:
group/daemon : cman.c gd_internal.h joinleave.c
Log message:
set dirty flag in cman
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cman.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.27.2.2&r2=1.27.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44.2.3&r2=1.44.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.19.2.2&r2=1.19.2.3
--- cluster/group/daemon/cman.c 2006/12/14 19:54:43 1.27.2.2
+++ cluster/group/daemon/cman.c 2007/09/17 13:47:58 1.27.2.3
@@ -5,6 +5,7 @@
#include "gd_internal.h"
static cman_handle_t ch;
+static cman_handle_t ch_admin;
static int old_quorate;
static cman_node_t old_nodes[MAX_NODES];
static int old_node_count;
@@ -15,16 +16,16 @@
int kill_cman(int nodeid)
{
- cman_handle_t ach;
+ return cman_kill_node(ch_admin, nodeid);
+}
+
+int set_cman_dirty(void)
+{
int rv;
- ach = cman_admin_init(NULL);
- if (!ach) {
- log_print("cman_admin_init error %d %d", (int) ch, errno);
- return -ENOTCONN;
- }
- rv = cman_kill_node(ach, nodeid);
- cman_finish(ach);
+ rv = cman_set_dirty(ch_admin);
+ if (rv)
+ log_print("cman_set_dirty error %d", rv);
return rv;
}
@@ -141,20 +142,24 @@
return -ENOTCONN;
}
+ ch_admin = cman_admin_init(NULL);
+ if (!ch_admin) {
+ log_print("cman_admin_init error %d %d", (int) ch_admin, errno);
+ rv = -ENOTCONN;
+ goto fail1;
+ }
+
rv = cman_start_notification(ch, cman_callback);
if (rv < 0) {
log_print("cman_start_notification error %d %d", rv, errno);
- cman_finish(ch);
- return rv;
+ goto fail2;
}
memset(&node, 0, sizeof(node));
rv = cman_get_node(ch, CMAN_NODEID_US, &node);
if (rv < 0) {
log_print("cman_get_node us error %d %d", rv, errno);
- cman_stop_notification(ch);
- cman_finish(ch);
- goto out;
+ goto fail3;
}
cman_node_count = 0;
@@ -162,7 +167,7 @@
rv = cman_get_nodes(ch, MAX_NODES, &cman_node_count, cman_nodes);
if (rv < 0) {
log_print("cman_get_nodes error %d %d", rv, errno);
- goto out;
+ goto fail3;
}
cman_quorate = cman_is_quorate(ch);
@@ -176,9 +181,14 @@
fd = cman_get_fd(ch);
client_add(fd, process_cman, close_cman);
+ return 0;
- rv = 0;
- out:
+ fail3:
+ cman_stop_notification(ch);
+ fail2:
+ cman_finish(ch_admin);
+ fail1:
+ cman_finish(ch);
return rv;
}
--- cluster/group/daemon/gd_internal.h 2007/02/09 16:03:24 1.44.2.3
+++ cluster/group/daemon/gd_internal.h 2007/09/17 13:47:58 1.44.2.4
@@ -277,6 +277,7 @@
/* cman.c */
int setup_cman(void);
int kill_cman(int nodeid);
+int set_cman_dirty(void);
/* cpg.c */
int setup_cpg(void);
--- cluster/group/daemon/joinleave.c 2007/09/07 19:22:08 1.19.2.2
+++ cluster/group/daemon/joinleave.c 2007/09/17 13:47:58 1.19.2.3
@@ -87,6 +87,10 @@
goto out;
}
+ rv = set_cman_dirty();
+ if (rv)
+ goto out;
+
rv = create_group(name, level, &g);
if (rv)
goto out;
next reply other threads:[~2007-09-17 13:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-17 13:47 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-08-20 14:50 [Cluster-devel] cluster/group/daemon cman.c gd_internal.h join teigland
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=20070917134759.2908.qmail@sourceware.org \
--to=teigland@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.