Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45599
b: refs/heads/master
c: 50af94b
h: refs/heads/master
i:
  45597: f689a4d
  45595: ba67e77
  45591: e2acc14
  45583: 51fbdaa
  45567: 7e365dd
v: v3
  • Loading branch information
Mark Fasheh committed Jan 22, 2007
1 parent 29aae0e commit 1792737
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a1bd4a5788435b6ef1664383604b43607eb825a
refs/heads/master: 50af94b14c98f5769860a282a397c6f3b135c8a8
43 changes: 42 additions & 1 deletion trunk/fs/ocfs2/ocfs2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -109,6 +109,20 @@
/* Support for sparse allocation in b-trees */
#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
*/
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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__ */


Expand Down

0 comments on commit 1792737

Please sign in to comment.