return NULL;
return read_tree_block(fs_info, btrfs_node_blockptr(parent, slot),
- fs_info->nodesize,
btrfs_node_ptr_generation(parent, slot));
}
void reada_for_search(struct btrfs_root *root, struct btrfs_path *path,
int level, int slot, u64 objectid)
{
+ struct btrfs_fs_info *fs_info = root->fs_info;
struct extent_buffer *node;
struct btrfs_disk_key disk_key;
u32 nritems;
int direction = path->reada;
struct extent_buffer *eb;
u32 nr;
- u32 blocksize;
u32 nscan = 0;
if (level != 1)
node = path->nodes[level];
search = btrfs_node_blockptr(node, slot);
- blocksize = root->fs_info->nodesize;
- eb = btrfs_find_tree_block(root, search, blocksize);
+ eb = btrfs_find_tree_block(fs_info, search, fs_info->nodesize);
if (eb) {
free_extent_buffer(eb);
return;
if ((search >= lowest_read && search <= highest_read) ||
(search < lowest_read && lowest_read - search <= 32768) ||
(search > highest_read && search - highest_read <= 32768)) {
- readahead_tree_block(root, search, blocksize,
+ readahead_tree_block(fs_info, search,
btrfs_node_ptr_generation(node, nr));
- nread += blocksize;
+ nread += fs_info->nodesize;
}
nscan++;
if (path->reada < 2 && (nread > SZ_256K || nscan > 32))