diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2010-10-09 13:24:46 -0400 |
---|---|---|
committer | Sunil Mushran <sunil.mushran@oracle.com> | 2010-10-09 13:24:46 -0400 |
commit | 98f486f23bc5b6a6fa90e1a0707b7e9fe0e7f3e4 (patch) | |
tree | 3998ce4a9c8871299934f7b1b305867ea9d4ac40 /fs/ocfs2/ocfs2_fs.h | |
parent | 54b5187b5a1ad6573ade8b18e065dda92501fc52 (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_fs.h')
-rw-r--r-- | fs/ocfs2/ocfs2_fs.h | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h index fa31d05e41b7..d5b1d99abc3c 100644 --- a/fs/ocfs2/ocfs2_fs.h +++ b/fs/ocfs2/ocfs2_fs.h | |||
@@ -101,7 +101,8 @@ | |||
101 | | OCFS2_FEATURE_INCOMPAT_META_ECC \ | 101 | | OCFS2_FEATURE_INCOMPAT_META_ECC \ |
102 | | OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS \ | 102 | | OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS \ |
103 | | OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE \ | 103 | | OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE \ |
104 | | OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG) | 104 | | OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG \ |
105 | | OCFS2_FEATURE_INCOMPAT_CLUSTERINFO) | ||
105 | #define OCFS2_FEATURE_RO_COMPAT_SUPP (OCFS2_FEATURE_RO_COMPAT_UNWRITTEN \ | 106 | #define OCFS2_FEATURE_RO_COMPAT_SUPP (OCFS2_FEATURE_RO_COMPAT_UNWRITTEN \ |
106 | | OCFS2_FEATURE_RO_COMPAT_USRQUOTA \ | 107 | | OCFS2_FEATURE_RO_COMPAT_USRQUOTA \ |
107 | | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA) | 108 | | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA) |
@@ -170,6 +171,13 @@ | |||
170 | #define OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG 0x2000 | 171 | #define OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG 0x2000 |
171 | 172 | ||
172 | /* | 173 | /* |
174 | * Incompat bit to indicate useable clusterinfo with stackflags for all | ||
175 | * cluster stacks (userspace adnd o2cb). If this bit is set, | ||
176 | * INCOMPAT_USERSPACE_STACK becomes superfluous and thus should not be set. | ||
177 | */ | ||
178 | #define OCFS2_FEATURE_INCOMPAT_CLUSTERINFO 0x4000 | ||
179 | |||
180 | /* | ||
173 | * backup superblock flag is used to indicate that this volume | 181 | * backup superblock flag is used to indicate that this volume |
174 | * has backup superblocks. | 182 | * has backup superblocks. |
175 | */ | 183 | */ |
@@ -292,10 +300,13 @@ | |||
292 | #define OCFS2_VOL_UUID_LEN 16 | 300 | #define OCFS2_VOL_UUID_LEN 16 |
293 | #define OCFS2_MAX_VOL_LABEL_LEN 64 | 301 | #define OCFS2_MAX_VOL_LABEL_LEN 64 |
294 | 302 | ||
295 | /* The alternate, userspace stack fields */ | 303 | /* The cluster stack fields */ |
296 | #define OCFS2_STACK_LABEL_LEN 4 | 304 | #define OCFS2_STACK_LABEL_LEN 4 |
297 | #define OCFS2_CLUSTER_NAME_LEN 16 | 305 | #define OCFS2_CLUSTER_NAME_LEN 16 |
298 | 306 | ||
307 | /* Classic (historically speaking) cluster stack */ | ||
308 | #define OCFS2_CLASSIC_CLUSTER_STACK "o2cb" | ||
309 | |||
299 | /* Journal limits (in bytes) */ | 310 | /* Journal limits (in bytes) */ |
300 | #define OCFS2_MIN_JOURNAL_SIZE (4 * 1024 * 1024) | 311 | #define OCFS2_MIN_JOURNAL_SIZE (4 * 1024 * 1024) |
301 | 312 | ||
@@ -305,6 +316,11 @@ | |||
305 | */ | 316 | */ |
306 | #define OCFS2_MIN_XATTR_INLINE_SIZE 256 | 317 | #define OCFS2_MIN_XATTR_INLINE_SIZE 256 |
307 | 318 | ||
319 | /* | ||
320 | * Cluster info flags (ocfs2_cluster_info.ci_stackflags) | ||
321 | */ | ||
322 | #define OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT (0x01) | ||
323 | |||
308 | struct ocfs2_system_inode_info { | 324 | struct ocfs2_system_inode_info { |
309 | char *si_name; | 325 | char *si_name; |
310 | int si_iflags; | 326 | int si_iflags; |
@@ -566,9 +582,21 @@ struct ocfs2_slot_map_extended { | |||
566 | */ | 582 | */ |
567 | }; | 583 | }; |
568 | 584 | ||
585 | /* | ||
586 | * ci_stackflags is only valid if the incompat bit | ||
587 | * OCFS2_FEATURE_INCOMPAT_CLUSTERINFO is set. | ||
588 | */ | ||
569 | struct ocfs2_cluster_info { | 589 | struct ocfs2_cluster_info { |
570 | /*00*/ __u8 ci_stack[OCFS2_STACK_LABEL_LEN]; | 590 | /*00*/ __u8 ci_stack[OCFS2_STACK_LABEL_LEN]; |
571 | __le32 ci_reserved; | 591 | union { |
592 | __le32 ci_reserved; | ||
593 | struct { | ||
594 | __u8 ci_stackflags; | ||
595 | __u8 ci_reserved1; | ||
596 | __u8 ci_reserved2; | ||
597 | __u8 ci_reserved3; | ||
598 | }; | ||
599 | }; | ||
572 | /*08*/ __u8 ci_cluster[OCFS2_CLUSTER_NAME_LEN]; | 600 | /*08*/ __u8 ci_cluster[OCFS2_CLUSTER_NAME_LEN]; |
573 | /*18*/ | 601 | /*18*/ |
574 | }; | 602 | }; |
@@ -605,9 +633,9 @@ struct ocfs2_super_block { | |||
605 | * group header */ | 633 | * group header */ |
606 | /*50*/ __u8 s_label[OCFS2_MAX_VOL_LABEL_LEN]; /* Label for mounting, etc. */ | 634 | /*50*/ __u8 s_label[OCFS2_MAX_VOL_LABEL_LEN]; /* Label for mounting, etc. */ |
607 | /*90*/ __u8 s_uuid[OCFS2_VOL_UUID_LEN]; /* 128-bit uuid */ | 635 | /*90*/ __u8 s_uuid[OCFS2_VOL_UUID_LEN]; /* 128-bit uuid */ |
608 | /*A0*/ struct ocfs2_cluster_info s_cluster_info; /* Selected userspace | 636 | /*A0*/ struct ocfs2_cluster_info s_cluster_info; /* Only valid if either |
609 | stack. Only valid | 637 | userspace or clusterinfo |
610 | with INCOMPAT flag. */ | 638 | INCOMPAT flag set. */ |
611 | /*B8*/ __le16 s_xattr_inline_size; /* extended attribute inline size | 639 | /*B8*/ __le16 s_xattr_inline_size; /* extended attribute inline size |
612 | for this fs*/ | 640 | for this fs*/ |
613 | __le16 s_reserved0; | 641 | __le16 s_reserved0; |