dlm: master - dlm_controld: tidy cman code
David Teigland
teigland at fedoraproject.org
Thu Oct 15 18:59:35 UTC 2009
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=3fe2f1f087d64c52a4bdf7b86cc68699a2ac2a10
Commit: 3fe2f1f087d64c52a4bdf7b86cc68699a2ac2a10
Parent: e0a214768b9b91e4b466405f0d24c4c634e6cfb2
Author: David Teigland <teigland at redhat.com>
AuthorDate: Thu Oct 15 12:55:15 2009 -0500
Committer: David Teigland <teigland at redhat.com>
CommitterDate: Thu Oct 15 12:55:15 2009 -0500
dlm_controld: tidy cman code
To match the same code in gfs_controld.
Signed-off-by: David Teigland <teigland at redhat.com>
---
group/dlm_controld/main.c | 2 +-
group/dlm_controld/member_cman.c | 40 ++++++++++++-------------------------
2 files changed, 14 insertions(+), 28 deletions(-)
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index fe5be04..f90cd21 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -881,7 +881,7 @@ static void loop(void)
setup_monitor();
- rv = setup_configfs();
+ rv = setup_configfs(); /* calls update_cluster() */
if (rv < 0)
goto out;
diff --git a/group/dlm_controld/member_cman.c b/group/dlm_controld/member_cman.c
index 880e3c1..b7fa8c3 100644
--- a/group/dlm_controld/member_cman.c
+++ b/group/dlm_controld/member_cman.c
@@ -12,19 +12,6 @@ static int old_node_count;
static uint32_t quorum_nodes[MAX_NODES];
static int quorum_node_count;
-void kick_node_from_cluster(int nodeid)
-{
- if (!nodeid) {
- log_error("telling corosync to shut down cluster locally");
- corosync_cfg_try_shutdown(ch,
- COROSYNC_CFG_SHUTDOWN_FLAG_IMMEDIATE);
- } else {
- log_error("telling corosync to remove nodeid %d from cluster",
- nodeid);
- corosync_cfg_kill_node(ch, nodeid, "dlm_controld");
- }
-}
-
static int is_member(uint32_t *node_list, int count, uint32_t nodeid)
{
int i;
@@ -46,20 +33,6 @@ int is_cluster_member(uint32_t nodeid)
return is_member(quorum_nodes, quorum_node_count, nodeid);
}
-/* what's the replacement for this? */
-#if 0
-static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
-{
- case CMAN_REASON_CONFIG_UPDATE:
- setup_logging();
- setup_ccs();
- break;
-}
-#endif
-
-/* add a configfs dir for cluster members that don't have one,
- del the configfs dir for cluster members that are now gone */
-
static void quorum_callback(quorum_handle_t h, uint32_t quorate,
uint64_t ring_seq, uint32_t node_list_entries,
uint32_t *node_list)
@@ -177,6 +150,19 @@ void close_cluster(void)
quorum_finalize(qh);
}
+void kick_node_from_cluster(int nodeid)
+{
+ if (!nodeid) {
+ log_error("telling corosync to shut down cluster locally");
+ corosync_cfg_try_shutdown(ch,
+ COROSYNC_CFG_SHUTDOWN_FLAG_IMMEDIATE);
+ } else {
+ log_error("telling corosync to remove nodeid %d from cluster",
+ nodeid);
+ corosync_cfg_kill_node(ch, nodeid, "dlm_controld");
+ }
+}
+
static void shutdown_callback(corosync_cfg_handle_t h,
corosync_cfg_shutdown_flags_t flags)
{
More information about the cluster-commits
mailing list