diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-05 12:21:31 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-05 12:21:31 -0500 |
commit | 5ccd1715fa2eaad0b26037bb53706779c8c93b5f (patch) | |
tree | 3957b56e7b0d7d494c952829ff926df8c24377f6 /disk-io.h | |
parent | d79f499eae6671a04e80b5a3081fae8e2a311b54 (diff) | |
download | btrfs-progs-5ccd1715fa2eaad0b26037bb53706779c8c93b5f.tar.gz |
superblock duplication
This patch updates btrfs-progs for superblock duplication.
Note: I didn't make this patch as complete as the one for
kernel since updating the converter requires changing the
code again. Thank you,
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'disk-io.h')
-rw-r--r-- | disk-io.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -19,9 +19,20 @@ #ifndef __DISKIO__ #define __DISKIO__ -#define BTRFS_SUPER_INFO_OFFSET (16 * 1024) +#define BTRFS_SUPER_INFO_OFFSET (64 * 1024) #define BTRFS_SUPER_INFO_SIZE 4096 +#define BTRFS_SUPER_MIRROR_MAX 3 +#define BTRFS_SUPER_MIRROR_SHIFT 12 + +static inline u64 btrfs_sb_offset(int mirror) +{ + u64 start = 16 * 1024; + if (mirror) + return start << (BTRFS_SUPER_MIRROR_SHIFT * mirror); + return BTRFS_SUPER_INFO_OFFSET; +} + struct btrfs_device; struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, |