summaryrefslogtreecommitdiff
path: root/disk-io.h
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2016-02-22 14:59:55 +0800
committerDavid Sterba <dsterba@suse.com>2016-02-26 17:27:58 +0100
commit9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf (patch)
treeadc2cea9c6e95ab693b657d092e29f3ea223cb44 /disk-io.h
parent43318324d20cccccfacf2e82ac10e27eefb6cc95 (diff)
btrfs-progs: Add support for tree block operations on fs_info without roots
Since open_ctree_fs_info() now may return a fs_info even without any roots, modify functions like read_tree_block() to operate with such fs_info. This provides the basis for btrfs-find-root to operate on chunk tree with corrupted fs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ coding style adjustments, unified declarations ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'disk-io.h')
-rw-r--r--disk-io.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/disk-io.h b/disk-io.h
index c2eb1d6e..30ccb2bd 100644
--- a/disk-io.h
+++ b/disk-io.h
@@ -75,14 +75,23 @@ static inline u64 btrfs_sb_offset(int mirror)
struct btrfs_device;
int read_whole_eb(struct btrfs_fs_info *info, struct extent_buffer *eb, int mirror);
-struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr,
- u32 blocksize, u64 parent_transid);
+struct extent_buffer* read_tree_block_fs_info(
+ struct btrfs_fs_info *fs_info, u64 bytenr, u32 blocksize,
+ u64 parent_transid);
+static inline struct extent_buffer* read_tree_block(
+ struct btrfs_root *root, u64 bytenr, u32 blocksize,
+ u64 parent_transid)
+{
+ return read_tree_block_fs_info(root->fs_info, bytenr, blocksize,
+ parent_transid);
+}
+
int read_extent_data(struct btrfs_root *root, char *data, u64 logical,
u64 *len, int mirror);
void readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize,
u64 parent_transid);
-struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
- u64 bytenr, u32 blocksize);
+struct extent_buffer* btrfs_find_create_tree_block(
+ struct btrfs_fs_info *fs_info, u64 bytenr, u32 blocksize);
int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
u32 stripesize, struct btrfs_root *root,