From aa5f0626f8a7797278e55e9976c2e868962af8da Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 16 Apr 2013 13:13:38 -0400 Subject: Btrfs-progs: make restore deal with really broken file systems All we need for restore to work is the chunk root, the tree root and the fs root we want to restore from. So to do this we need to make a few adjustments 1) Make open_ctree_fs_info fail completely if it can't read the chunk tree. There is no sense in continuing if we can't read the chunk tree since we won't be able to translate logical to physical blocks. 2) Use open_ctree_fs_info in restore, and if we didn't load a tree root or fs root go ahead and try to set those up manually ourselves. This is related to work I did last year on restore, but it uses the open_ctree_fs_info instead of my open coded open_ctree. Thanks, Signed-off-by: Josef Bacik --- disk-io.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'disk-io.h') diff --git a/disk-io.h b/disk-io.h index ff879581..c29ee8e2 100644 --- a/disk-io.h +++ b/disk-io.h @@ -50,11 +50,9 @@ int clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, int writes); struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr, int writes); -struct btrfs_root *open_ctree_recovery(const char *filename, u64 sb_bytenr, - u64 root_tree_bytenr); struct btrfs_fs_info *open_ctree_fs_info(const char *filename, - u64 sb_bytenr, int writes, - int partial); + u64 sb_bytenr, u64 root_tree_bytenr, + int writes, int partial); int close_ctree(struct btrfs_root *root); int write_all_supers(struct btrfs_root *root); int write_ctree_super(struct btrfs_trans_handle *trans, -- cgit v1.2.3