summaryrefslogtreecommitdiff
path: root/disk-io.h
diff options
context:
space:
mode:
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 5b827e4f..8e9fab9d 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,