From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/daemon cman.c
Date: 22 Aug 2007 13:58:21 -0000 [thread overview]
Message-ID: <20070822135821.30024.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2007-08-22 13:58:19
Modified files:
group/daemon : cman.c
Log message:
use an admin handle from cman to call set_dirty
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cman.c.diff?cvsroot=cluster&r1=1.31&r2=1.32
--- cluster/group/daemon/cman.c 2007/08/21 19:33:55 1.31
+++ cluster/group/daemon/cman.c 2007/08/22 13:58:19 1.32
@@ -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,30 +16,17 @@
int kill_cman(int nodeid)
{
- cman_handle_t ach;
- 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);
- return rv;
+ return cman_kill_node(ch_admin, nodeid);
}
int set_cman_dirty(void)
{
int rv;
-#if 0
- rv = cman_set_dirty(ch);
+ rv = cman_set_dirty(ch_admin);
if (rv)
log_print("cman_set_dirty error %d", rv);
return rv;
-#endif
- return 0;
}
static int is_member(cman_node_t *node_list, int count, int nodeid)
@@ -154,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;
@@ -175,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);
@@ -189,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;
}
next reply other threads:[~2007-08-22 13:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-22 13:58 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-08-21 19:33 [Cluster-devel] cluster/group/daemon cman.c teigland
2006-12-14 19:55 teigland
2006-12-14 19:54 teigland
2006-12-14 19:54 teigland
2006-06-30 21:00 teigland
2006-06-30 15:34 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=20070822135821.30024.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).