aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2_fs.h
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-02-01 15:06:54 -0500
committerMark Fasheh <mfasheh@suse.com>2008-04-18 11:56:03 -0400
commit386a2ef8576e966076c293f6496b9e3d7e3d9035 (patch)
tree08b6cae47060497359a6ab78134a1bf8e38012cc /fs/ocfs2/ocfs2_fs.h
parentfb86b1f07120b66769a39c445da5c4300069dd44 (diff)
ocfs2: New slot map format
The old slot map had a few limitations: - It was limited to one block, so the maximum slot count was 255. - Each slot was signed 16bits, limiting node numbers to INT16_MAX. - An empty slot was marked by the magic 0xFFFF (-1). The new slot map format provides 32bit node numbers (UINT32_MAX), a separate space to mark a slot in use, and extra room to grow. The slot map is now bounded by i_size, not a block. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/ocfs2_fs.h')
-rw-r--r--fs/ocfs2/ocfs2_fs.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index 3299116b8021..c49502329ab0 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -88,7 +88,8 @@
88#define OCFS2_FEATURE_COMPAT_SUPP OCFS2_FEATURE_COMPAT_BACKUP_SB 88#define OCFS2_FEATURE_COMPAT_SUPP OCFS2_FEATURE_COMPAT_BACKUP_SB
89#define OCFS2_FEATURE_INCOMPAT_SUPP (OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT \ 89#define OCFS2_FEATURE_INCOMPAT_SUPP (OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT \
90 | OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC \ 90 | OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC \
91 | OCFS2_FEATURE_INCOMPAT_INLINE_DATA) 91 | OCFS2_FEATURE_INCOMPAT_INLINE_DATA \
92 | OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP)
92#define OCFS2_FEATURE_RO_COMPAT_SUPP OCFS2_FEATURE_RO_COMPAT_UNWRITTEN 93#define OCFS2_FEATURE_RO_COMPAT_SUPP OCFS2_FEATURE_RO_COMPAT_UNWRITTEN
93 94
94/* 95/*
@@ -125,6 +126,10 @@
125/* Support for data packed into inode blocks */ 126/* Support for data packed into inode blocks */
126#define OCFS2_FEATURE_INCOMPAT_INLINE_DATA 0x0040 127#define OCFS2_FEATURE_INCOMPAT_INLINE_DATA 0x0040
127 128
129/* Support for the extended slot map */
130#define OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP 0x100
131
132
128/* 133/*
129 * backup superblock flag is used to indicate that this volume 134 * backup superblock flag is used to indicate that this volume
130 * has backup superblocks. 135 * has backup superblocks.
@@ -476,7 +481,8 @@ struct ocfs2_extent_block
476 481
477/* 482/*
478 * On disk slot map for OCFS2. This defines the contents of the "slot_map" 483 * On disk slot map for OCFS2. This defines the contents of the "slot_map"
479 * system file. 484 * system file. A slot is valid if it contains a node number >= 0. The
485 * value -1 (0xFFFF) is OCFS2_INVALID_SLOT. This marks a slot empty.
480 */ 486 */
481struct ocfs2_slot_map { 487struct ocfs2_slot_map {
482/*00*/ __le16 sm_slots[0]; 488/*00*/ __le16 sm_slots[0];
@@ -486,6 +492,27 @@ struct ocfs2_slot_map {
486 */ 492 */
487}; 493};
488 494
495struct ocfs2_extended_slot {
496/*00*/ __u8 es_valid;
497 __u8 es_reserved1[3];
498 __le32 es_node_num;
499/*10*/
500};
501
502/*
503 * The extended slot map, used when OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP
504 * is set. It separates out the valid marker from the node number, and
505 * has room to grow. Unlike the old slot map, this format is defined by
506 * i_size.
507 */
508struct ocfs2_slot_map_extended {
509/*00*/ struct ocfs2_extended_slot se_slots[0];
510/*
511 * Actual size is i_size of the slot_map system file. It should
512 * match s_max_slots * sizeof(struct ocfs2_extended_slot)
513 */
514};
515
489/* 516/*
490 * On disk superblock for OCFS2 517 * On disk superblock for OCFS2
491 * Note that it is contained inside an ocfs2_dinode, so all offsets 518 * Note that it is contained inside an ocfs2_dinode, so all offsets