fs: btrfs: Crossport read_tree_block() from btrfs-progs
This is the one of the basic stone function for btrfs, which:
- Resolves the chunk mappings
- Reads data from disk
- Does various sanity check
With read_tree_block(), we can finally crossport needed btrfs btree
operations to U-Boot.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d88ae67..55f431a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -65,7 +65,7 @@
if (btrfs_search_tree(&tmp_root, location, &path))
return res;
- if (btrfs_comp_keys(location, btrfs_path_leaf_key(&path)))
+ if (__btrfs_comp_keys(location, btrfs_path_leaf_key(&path)))
goto out;
if (item) {
@@ -98,7 +98,7 @@
if (btrfs_search_tree(root, &key, &path))
return -1;
- if (btrfs_comp_keys(&key, btrfs_path_leaf_key(&path)))
+ if (__btrfs_comp_keys(&key, btrfs_path_leaf_key(&path)))
goto out;
extent = btrfs_path_item_ptr(&path, struct btrfs_file_extent_item);
@@ -333,7 +333,7 @@
if (btrfs_search_tree(root, &key, &path))
return -1ULL;
- if (btrfs_comp_keys(&key, btrfs_path_leaf_key(&path)) < 0) {
+ if (__btrfs_comp_keys(&key, btrfs_path_leaf_key(&path)) < 0) {
if (btrfs_prev_slot(&path))
goto out;