summaryrefslogtreecommitdiff
path: root/disk-io.h
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-12-05 12:21:31 -0500
committerChris Mason <chris.mason@oracle.com>2008-12-05 12:21:31 -0500
commit5ccd1715fa2eaad0b26037bb53706779c8c93b5f (patch)
tree3957b56e7b0d7d494c952829ff926df8c24377f6 /disk-io.h
parentd79f499eae6671a04e80b5a3081fae8e2a311b54 (diff)
downloadbtrfs-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.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/disk-io.h b/disk-io.h
index 5b827e4..8e9fab9 100644
--- a/disk-io.h
+++ b/disk-io.h
@@ -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,