Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6953b4c0 authored by Joel Becker's avatar Joel Becker Committed by Mark Fasheh
Browse files

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: default avatarJoel Becker <joel.becker@oracle.com>
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
parent 19fdb624
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -32,10 +32,6 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>

#include <cluster/heartbeat.h>
#include <cluster/nodemanager.h>
#include <cluster/tcp.h>

#define MLOG_MASK_PREFIX ML_DLM_GLUE
#include <cluster/masklog.h>

+0 −33
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/kmod.h>

#define MLOG_MASK_PREFIX ML_SUPER
#include <cluster/masklog.h>
@@ -83,38 +82,6 @@ void ocfs2_do_node_down(int node_num, void *data)
	ocfs2_recovery_thread(osb, node_num);
}

void ocfs2_stop_heartbeat(struct ocfs2_super *osb)
{
	int ret;
	char *argv[5], *envp[3];

	if (ocfs2_mount_local(osb))
		return;

	if (!osb->uuid_str) {
		/* This can happen if we don't get far enough in mount... */
		mlog(0, "No UUID with which to stop heartbeat!\n\n");
		return;
	}

	argv[0] = (char *)o2nm_get_hb_ctl_path();
	argv[1] = "-K";
	argv[2] = "-u";
	argv[3] = osb->uuid_str;
	argv[4] = NULL;

	mlog(0, "Run: %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3]);

	/* minimal command environment taken from cpu_run_sbin_hotplug */
	envp[0] = "HOME=/";
	envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
	envp[2] = NULL;

	ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
	if (ret < 0)
		mlog_errno(ret);
}

static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
					    int bit)
{
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@
void ocfs2_init_node_maps(struct ocfs2_super *osb);

void ocfs2_do_node_down(int node_num, void *data);
void ocfs2_stop_heartbeat(struct ocfs2_super *osb);

/* node map functions - used to keep track of mounted and in-recovery
 * nodes. */
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@

#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/smp_lock.h>

#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h>
+0 −4
Original line number Diff line number Diff line
@@ -36,10 +36,6 @@
#include <linux/mutex.h>
#include <linux/jbd.h>

#include "cluster/nodemanager.h"
#include "cluster/heartbeat.h"
#include "cluster/tcp.h"

/* For union ocfs2_dlm_lksb */
#include "stackglue.h"

Loading