dlm: master - dlm_controld: move fence code into separate file
David Teigland
teigland at fedoraproject.org
Tue Oct 11 19:00:51 UTC 2011
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=6011133ecf9899148970d979c0c1d930c6cfe474
Commit: 6011133ecf9899148970d979c0c1d930c6cfe474
Parent: a93c6d5bcb9ddf52fa524895a65ce3aedb71819b
Author: David Teigland <teigland at redhat.com>
AuthorDate: Tue Oct 11 13:58:49 2011 -0500
Committer: David Teigland <teigland at redhat.com>
CommitterDate: Tue Oct 11 13:58:49 2011 -0500
dlm_controld: move fence code into separate file
Signed-off-by: David Teigland <teigland at redhat.com>
---
dlm_controld/Makefile | 1 +
dlm_controld/dlm_daemon.h | 2 ++
dlm_controld/fence.c | 41 +++++++++++++++++++++++++++++++++++++++++
dlm_controld/member_cman.c | 31 -------------------------------
4 files changed, 44 insertions(+), 31 deletions(-)
diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index 7bd37a1..a4cc5d7 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -25,6 +25,7 @@ LIB_TARGET = $(LIB_SO).$(LIB_MAJOR).$(LIB_MINOR)
BIN_SOURCE = action.c \
cpg.c \
crc.c \
+ fence.c \
main.c \
plock.c \
config.c \
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 5209762..9d8cd52 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -341,6 +341,8 @@ int setup_cluster_cfg(void);
void close_cluster_cfg(void);
void process_cluster_cfg(int ci);
void kick_node_from_cluster(int nodeid);
+
+/* fence.c */
int fence_node_time(int nodeid, uint64_t *last_fenced_time);
int fence_in_progress(int *count);
diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c
new file mode 100644
index 0000000..15271b6
--- /dev/null
+++ b/dlm_controld/fence.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#include "dlm_daemon.h"
+#include "libfenced.h"
+
+int fence_node_time(int nodeid, uint64_t *last_fenced_time)
+{
+ struct fenced_node nodeinfo;
+ int rv;
+
+ memset(&nodeinfo, 0, sizeof(nodeinfo));
+
+ rv = fenced_node_info(nodeid, &nodeinfo);
+ if (rv < 0)
+ return rv;
+
+ *last_fenced_time = nodeinfo.last_fenced_time;
+ return 0;
+}
+
+int fence_in_progress(int *count)
+{
+ struct fenced_domain domain;
+ int rv;
+
+ memset(&domain, 0, sizeof(domain));
+
+ rv = fenced_domain_info(&domain);
+ if (rv < 0)
+ return rv;
+
+ *count = domain.victim_count;
+ return 0;
+}
+
diff --git a/dlm_controld/member_cman.c b/dlm_controld/member_cman.c
index 6bfb2a9..d645911 100644
--- a/dlm_controld/member_cman.c
+++ b/dlm_controld/member_cman.c
@@ -10,7 +10,6 @@
#include <corosync/corotypes.h>
#include <corosync/cfg.h>
#include <corosync/quorum.h>
-#include "libfenced.h"
static corosync_cfg_handle_t ch;
static quorum_handle_t qh;
@@ -310,33 +309,3 @@ void close_cluster_cfg(void)
corosync_cfg_finalize(ch);
}
-int fence_node_time(int nodeid, uint64_t *last_fenced_time)
-{
- struct fenced_node nodeinfo;
- int rv;
-
- memset(&nodeinfo, 0, sizeof(nodeinfo));
-
- rv = fenced_node_info(nodeid, &nodeinfo);
- if (rv < 0)
- return rv;
-
- *last_fenced_time = nodeinfo.last_fenced_time;
- return 0;
-}
-
-int fence_in_progress(int *count)
-{
- struct fenced_domain domain;
- int rv;
-
- memset(&domain, 0, sizeof(domain));
-
- rv = fenced_domain_info(&domain);
- if (rv < 0)
- return rv;
-
- *count = domain.victim_count;
- return 0;
-}
-
More information about the cluster-commits
mailing list