aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/heartbeat.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-01-29 19:59:56 -0500
committerMark Fasheh <mfasheh@suse.com>2008-04-18 11:56:04 -0400
commit6953b4c008628b945bfe0cee97f6e78a98773859 (patch)
treede00a19f59466d9e83b00112696afa5b02abbd9c /fs/ocfs2/heartbeat.c
parent19fdb624dc8ccb663f6e48b3a3a3fa4e4e567fc1 (diff)
ocfs2: Move o2hb functionality into the stack glue.
The last bit of classic stack used directly in ocfs2 code is o2hb. Specifically, the check for heartbeat during mount and the call to ocfs2_hb_ctl during unmount. We create an extra API, ocfs2_cluster_hangup(), to encapsulate the call to ocfs2_hb_ctl. Other stacks will just leave hangup() empty. The check for heartbeat is moved into ocfs2_cluster_connect(). It will be matched by a similar check for other stacks. With this change, only stackglue.c includes cluster/ headers. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/heartbeat.c')
-rw-r--r--fs/ocfs2/heartbeat.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c
index dcac1a487288..c6e7213db868 100644
--- a/fs/ocfs2/heartbeat.c
+++ b/fs/ocfs2/heartbeat.c
@@ -28,7 +28,6 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/highmem.h> 30#include <linux/highmem.h>
31#include <linux/kmod.h>
32 31
33#define MLOG_MASK_PREFIX ML_SUPER 32#define MLOG_MASK_PREFIX ML_SUPER
34#include <cluster/masklog.h> 33#include <cluster/masklog.h>
@@ -83,38 +82,6 @@ void ocfs2_do_node_down(int node_num, void *data)
83 ocfs2_recovery_thread(osb, node_num); 82 ocfs2_recovery_thread(osb, node_num);
84} 83}
85 84
86void ocfs2_stop_heartbeat(struct ocfs2_super *osb)
87{
88 int ret;
89 char *argv[5], *envp[3];
90
91 if (ocfs2_mount_local(osb))
92 return;
93
94 if (!osb->uuid_str) {
95 /* This can happen if we don't get far enough in mount... */
96 mlog(0, "No UUID with which to stop heartbeat!\n\n");
97 return;
98 }
99
100 argv[0] = (char *)o2nm_get_hb_ctl_path();
101 argv[1] = "-K";
102 argv[2] = "-u";
103 argv[3] = osb->uuid_str;
104 argv[4] = NULL;
105
106 mlog(0, "Run: %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3]);
107
108 /* minimal command environment taken from cpu_run_sbin_hotplug */
109 envp[0] = "HOME=/";
110 envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
111 envp[2] = NULL;
112
113 ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
114 if (ret < 0)
115 mlog_errno(ret);
116}
117
118static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, 85static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
119 int bit) 86 int bit)
120{ 87{