length = blocksize;
while (1) {
- ret = btrfs_map_block(&root->fs_info->mapping_tree, READ,
- eb->start, &length, &multi,
- mirror_num, NULL);
+ ret = btrfs_map_block(root->fs_info, READ, eb->start, &length,
+ &multi, mirror_num, NULL);
if (ret) {
error("cannot map block %llu length %llu mirror %d: %d",
(unsigned long long)eb->start,
fsync(eb->fd);
}
- num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
- eb->start, eb->len);
+ num_copies = btrfs_num_copies(root->fs_info, eb->start,
+ eb->len);
if (num_copies == 1)
break;
{
struct extent_buffer *eb;
- eb = read_tree_block_fs_info(fs_info, bytenr, fs_info->nodesize, 0);
+ eb = read_tree_block(fs_info, bytenr, fs_info->nodesize, 0);
if (!extent_buffer_uptodate(eb))
return -EIO;;
struct btrfs_root *root,
struct extent_buffer *eb)
{
+ struct btrfs_fs_info *fs_info = root->fs_info;
int i;
if (!eb)
for (i = 0; i < btrfs_header_nritems(eb); i++) {
struct extent_buffer *next;
- next = read_tree_block(root, btrfs_node_blockptr(eb, i),
- root->fs_info->nodesize,
+ next = read_tree_block(fs_info, btrfs_node_blockptr(eb, i),
+ fs_info->nodesize,
btrfs_node_ptr_generation(eb, i));
if (!extent_buffer_uptodate(next))
continue;
return -EINVAL;
}
- eb = read_tree_block_fs_info(fs_info, block, fs_info->nodesize, 0);
+ eb = read_tree_block(fs_info, block, fs_info->nodesize, 0);
if (!extent_buffer_uptodate(eb)) {
fprintf(stderr, "Couldn't read in tree block %s\n", field);
return -EINVAL;