diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-01-29 16:59:56 -0800 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-04-18 08:56:04 -0700 |
commit | 6953b4c008628b945bfe0cee97f6e78a98773859 (patch) | |
tree | de00a19f59466d9e83b00112696afa5b02abbd9c /fs/ocfs2/super.c | |
parent | 19fdb624dc8ccb663f6e48b3a3a3fa4e4e567fc1 (diff) | |
download | kernel-crypto-6953b4c008628b945bfe0cee97f6e78a98773859.tar.gz kernel-crypto-6953b4c008628b945bfe0cee97f6e78a98773859.tar.xz kernel-crypto-6953b4c008628b945bfe0cee97f6e78a98773859.zip |
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/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index d3c4d323fab..8f536b39ce5 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -40,8 +40,7 @@ #include <linux/crc32.h> #include <linux/debugfs.h> #include <linux/mount.h> - -#include <cluster/nodemanager.h> +#include <linux/seq_file.h> #define MLOG_MASK_PREFIX ML_SUPER #include <cluster/masklog.h> @@ -579,15 +578,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) goto read_super_error; } - /* for now we only have one cluster/node, make sure we see it - * in the heartbeat universe */ - if (parsed_options.mount_opt & OCFS2_MOUNT_HB_LOCAL) { - if (!o2hb_check_local_node_heartbeating()) { - status = -EINVAL; - goto read_super_error; - } - } - /* probe for superblock */ status = ocfs2_sb_probe(sb, &bh, §or_size); if (status < 0) { @@ -1275,8 +1265,15 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) debugfs_remove(osb->osb_debug_root); - if (!mnt_err) - ocfs2_stop_heartbeat(osb); + /* + * This is a small hack to move ocfs2_hb_ctl into stackglue. + * If we're dismounting due to mount error, mount.ocfs2 will clean + * up heartbeat. If we're a local mount, there is no heartbeat. + * If we failed before we got a uuid_str yet, we can't stop + * heartbeat. Otherwise, do it. + */ + if (!mnt_err && !ocfs2_mount_local(osb) && osb->uuid_str) + ocfs2_cluster_hangup(osb->uuid_str, strlen(osb->uuid_str)); atomic_set(&osb->vol_state, VOLUME_DISMOUNTED); |