summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-11-20 09:52:48 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-20 09:52:48 -0500
commitaa62e84c84436593edb56c9b9c61fa701c69f80e (patch)
tree41d06e2caee4af7a1d8933d9481f80c95a84acf0 /disk-io.c
parent49bc666d5fcedc7221eeeef0499e21a45c3ca4ad (diff)
Btrfs image tool
This patch adds btrfs image tool. The image tool is a debugging tool that creates/restores btrfs metadump image. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/disk-io.c b/disk-io.c
index d2e1bdd6..ccfd6e34 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -646,8 +646,10 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
(unsigned long)btrfs_header_chunk_tree_uuid(chunk_root->node),
BTRFS_UUID_SIZE);
- ret = btrfs_read_chunk_tree(chunk_root);
- BUG_ON(ret);
+ if (!(btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_METADUMP)) {
+ ret = btrfs_read_chunk_tree(chunk_root);
+ BUG_ON(ret);
+ }
blocksize = btrfs_level_size(tree_root,
btrfs_super_root_level(disk_super));