aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2.h
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2010-10-09 13:24:46 -0400
committerSunil Mushran <sunil.mushran@oracle.com>2010-10-09 13:24:46 -0400
commit98f486f23bc5b6a6fa90e1a0707b7e9fe0e7f3e4 (patch)
tree3998ce4a9c8871299934f7b1b305867ea9d4ac40 /fs/ocfs2/ocfs2.h
parent54b5187b5a1ad6573ade8b18e065dda92501fc52 (diff)
ocfs2: Add an incompat feature flag OCFS2_FEATURE_INCOMPAT_CLUSTERINFO
OCFS2_FEATURE_INCOMPAT_CLUSTERINFO allows us to use sb->s_cluster_info for both userspace and o2cb cluster stacks. It also allows us to extend cluster info to include stack flags. This patch also adds stackflags to sb->s_clusterinfo. It also introduces a clusterinfo flag OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT to denote the enabled global heartbeat mode. This incompat flag can be set/cleared using tunefs.ocfs2 --fs-features. The clusterinfo flag is set/cleared using tunefs.ocfs2 --update-cluster-stack. Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r--fs/ocfs2/ocfs2.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index c67003b6b5a2..d5496a792bdb 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -368,6 +368,8 @@ struct ocfs2_super
368 struct ocfs2_alloc_stats alloc_stats; 368 struct ocfs2_alloc_stats alloc_stats;
369 char dev_str[20]; /* "major,minor" of the device */ 369 char dev_str[20]; /* "major,minor" of the device */
370 370
371 u8 osb_stackflags;
372
371 char osb_cluster_stack[OCFS2_STACK_LABEL_LEN + 1]; 373 char osb_cluster_stack[OCFS2_STACK_LABEL_LEN + 1];
372 struct ocfs2_cluster_connection *cconn; 374 struct ocfs2_cluster_connection *cconn;
373 struct ocfs2_lock_res osb_super_lockres; 375 struct ocfs2_lock_res osb_super_lockres;
@@ -601,10 +603,35 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb)
601 return ret; 603 return ret;
602} 604}
603 605
604static inline int ocfs2_userspace_stack(struct ocfs2_super *osb) 606static inline int ocfs2_clusterinfo_valid(struct ocfs2_super *osb)
605{ 607{
606 return (osb->s_feature_incompat & 608 return (osb->s_feature_incompat &
607 OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK); 609 (OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK |
610 OCFS2_FEATURE_INCOMPAT_CLUSTERINFO));
611}
612
613static inline int ocfs2_userspace_stack(struct ocfs2_super *osb)
614{
615 if (ocfs2_clusterinfo_valid(osb) &&
616 memcmp(osb->osb_cluster_stack, OCFS2_CLASSIC_CLUSTER_STACK,
617 OCFS2_STACK_LABEL_LEN))
618 return 1;
619 return 0;
620}
621
622static inline int ocfs2_o2cb_stack(struct ocfs2_super *osb)
623{
624 if (ocfs2_clusterinfo_valid(osb) &&
625 !memcmp(osb->osb_cluster_stack, OCFS2_CLASSIC_CLUSTER_STACK,
626 OCFS2_STACK_LABEL_LEN))
627 return 1;
628 return 0;
629}
630
631static inline int ocfs2_cluster_o2cb_global_heartbeat(struct ocfs2_super *osb)
632{
633 return ocfs2_o2cb_stack(osb) &&
634 (osb->osb_stackflags & OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT);
608} 635}
609 636
610static inline int ocfs2_mount_local(struct ocfs2_super *osb) 637static inline int ocfs2_mount_local(struct ocfs2_super *osb)