ocfs2: Add backup superblock info to ocfs2_fs.h

This synchronizes us with recent ocfs2-tools changes.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

+42 -1
+42 -1
fs/ocfs2/ocfs2_fs.h
··· 85 85 #define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ 86 86 OCFS2_SB(sb)->s_feature_incompat &= ~(mask) 87 87 88 - #define OCFS2_FEATURE_COMPAT_SUPP 0 88 + #define OCFS2_FEATURE_COMPAT_SUPP OCFS2_FEATURE_COMPAT_BACKUP_SB 89 89 #define OCFS2_FEATURE_INCOMPAT_SUPP OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT 90 90 #define OCFS2_FEATURE_RO_COMPAT_SUPP 0 91 91 ··· 108 108 109 109 /* Support for sparse allocation in b-trees */ 110 110 #define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC 0x0010 111 + 112 + /* 113 + * backup superblock flag is used to indicate that this volume 114 + * has backup superblocks. 115 + */ 116 + #define OCFS2_FEATURE_COMPAT_BACKUP_SB 0x0001 117 + 118 + /* The byte offset of the first backup block will be 1G. 119 + * The following will be 4G, 16G, 64G, 256G and 1T. 120 + */ 121 + #define OCFS2_BACKUP_SB_START 1 << 30 122 + 123 + /* the max backup superblock nums */ 124 + #define OCFS2_MAX_BACKUP_SUPERBLOCKS 6 111 125 112 126 /* 113 127 * Flags on ocfs2_dinode.i_flags ··· 580 566 581 567 return size / sizeof(struct ocfs2_truncate_rec); 582 568 } 569 + 570 + static inline u64 ocfs2_backup_super_blkno(struct super_block *sb, int index) 571 + { 572 + u64 offset = OCFS2_BACKUP_SB_START; 573 + 574 + if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) { 575 + offset <<= (2 * index); 576 + offset /= sb->s_blocksize; 577 + return offset; 578 + } 579 + 580 + return 0; 581 + 582 + } 583 583 #else 584 584 static inline int ocfs2_fast_symlink_chars(int blocksize) 585 585 { ··· 658 630 offsetof(struct ocfs2_dinode, id2.i_dealloc.tl_recs); 659 631 660 632 return size / sizeof(struct ocfs2_truncate_rec); 633 + } 634 + 635 + static inline uint64_t ocfs2_backup_super_blkno(int blocksize, int index) 636 + { 637 + uint64_t offset = OCFS2_BACKUP_SB_START; 638 + 639 + if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) { 640 + offset <<= (2 * index); 641 + offset /= blocksize; 642 + return offset; 643 + } 644 + 645 + return 0; 661 646 } 662 647 #endif /* __KERNEL__ */ 663 648