Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50af94b14c98f5769860a282a397c6f3b135c8a8
Commit:     50af94b14c98f5769860a282a397c6f3b135c8a8
Parent:     6a1bd4a5788435b6ef1664383604b43607eb825a
Author:     Mark Fasheh <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 21 14:44:59 2007 -0800
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Sun Jan 21 16:20:10 2007 -0800

    ocfs2: Add backup superblock info to ocfs2_fs.h
    
    This synchronizes us with recent ocfs2-tools changes.
    
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/ocfs2/ocfs2_fs.h |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index b5c6856..c99e905 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -85,7 +85,7 @@
 #define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask)                  \
        OCFS2_SB(sb)->s_feature_incompat &= ~(mask)
 
-#define OCFS2_FEATURE_COMPAT_SUPP      0
+#define OCFS2_FEATURE_COMPAT_SUPP      OCFS2_FEATURE_COMPAT_BACKUP_SB
 #define OCFS2_FEATURE_INCOMPAT_SUPP    OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT
 #define OCFS2_FEATURE_RO_COMPAT_SUPP   0
 
@@ -110,6 +110,20 @@
 #define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC    0x0010
 
 /*
+ * backup superblock flag is used to indicate that this volume
+ * has backup superblocks.
+ */
+#define OCFS2_FEATURE_COMPAT_BACKUP_SB         0x0001
+
+/* The byte offset of the first backup block will be 1G.
+ * The following will be 4G, 16G, 64G, 256G and 1T.
+ */
+#define OCFS2_BACKUP_SB_START                  1 << 30
+
+/* the max backup superblock nums */
+#define OCFS2_MAX_BACKUP_SUPERBLOCKS   6
+
+/*
  * Flags on ocfs2_dinode.i_flags
  */
 #define OCFS2_VALID_FL         (0x00000001)    /* Inode is valid */
@@ -566,6 +580,20 @@ static inline int ocfs2_truncate_recs_per_inode(struct 
super_block *sb)
 
        return size / sizeof(struct ocfs2_truncate_rec);
 }
+
+static inline u64 ocfs2_backup_super_blkno(struct super_block *sb, int index)
+{
+       u64 offset = OCFS2_BACKUP_SB_START;
+
+       if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) {
+               offset <<= (2 * index);
+               offset /= sb->s_blocksize;
+               return offset;
+       }
+
+       return 0;
+
+}
 #else
 static inline int ocfs2_fast_symlink_chars(int blocksize)
 {
@@ -631,6 +659,19 @@ static inline int ocfs2_truncate_recs_per_inode(int 
blocksize)
 
        return size / sizeof(struct ocfs2_truncate_rec);
 }
+
+static inline uint64_t ocfs2_backup_super_blkno(int blocksize, int index)
+{
+       uint64_t offset = OCFS2_BACKUP_SB_START;
+
+       if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) {
+               offset <<= (2 * index);
+               offset /= blocksize;
+               return offset;
+       }
+
+       return 0;
+}
 #endif  /* __KERNEL__ */
 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to