forked from Mirrors/btrfs-progs
btrfs-progs: drop blocksize argument from readahead_tree_block
Tree blocks are always nodesize. As readahead is only an optimization, exact size is not required and is only advisory. Signed-off-by: David Sterba <dsterba@suse.com>master
parent
2030f49751
commit
145a5969bd
|
@ -1989,8 +1989,7 @@ static void reada_walk_down(struct btrfs_root *root,
|
|||
for (i = slot; i < nritems; i++) {
|
||||
bytenr = btrfs_node_blockptr(node, i);
|
||||
ptr_gen = btrfs_node_ptr_generation(node, i);
|
||||
readahead_tree_block(fs_info, bytenr, fs_info->nodesize,
|
||||
ptr_gen);
|
||||
readahead_tree_block(fs_info, bytenr, ptr_gen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7650,8 +7649,7 @@ static int run_next_block(struct btrfs_root *root,
|
|||
continue;
|
||||
|
||||
/* fixme, get the parent transid */
|
||||
readahead_tree_block(fs_info, bits[i].start,
|
||||
bits[i].size, 0);
|
||||
readahead_tree_block(fs_info, bits[i].start, 0);
|
||||
}
|
||||
}
|
||||
*last = bits[0].start;
|
||||
|
|
2
ctree.c
2
ctree.c
|
@ -1018,7 +1018,7 @@ void reada_for_search(struct btrfs_root *root, struct btrfs_path *path,
|
|||
if ((search >= lowest_read && search <= highest_read) ||
|
||||
(search < lowest_read && lowest_read - search <= 32768) ||
|
||||
(search > highest_read && search - highest_read <= 32768)) {
|
||||
readahead_tree_block(fs_info, search, fs_info->nodesize,
|
||||
readahead_tree_block(fs_info, search,
|
||||
btrfs_node_ptr_generation(node, nr));
|
||||
nread += fs_info->nodesize;
|
||||
}
|
||||
|
|
|
@ -189,21 +189,21 @@ struct extent_buffer* btrfs_find_create_tree_block(
|
|||
}
|
||||
|
||||
void readahead_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
|
||||
u32 blocksize, u64 parent_transid)
|
||||
u64 parent_transid)
|
||||
{
|
||||
struct extent_buffer *eb;
|
||||
u64 length;
|
||||
struct btrfs_multi_bio *multi = NULL;
|
||||
struct btrfs_device *device;
|
||||
|
||||
eb = btrfs_find_tree_block(fs_info, bytenr, blocksize);
|
||||
eb = btrfs_find_tree_block(fs_info, bytenr, fs_info->nodesize);
|
||||
if (!(eb && btrfs_buffer_uptodate(eb, parent_transid)) &&
|
||||
!btrfs_map_block(fs_info, READ, bytenr, &length, &multi, 0,
|
||||
NULL)) {
|
||||
device = multi->stripes[0].dev;
|
||||
device->total_ios++;
|
||||
blocksize = min(blocksize, (u32)SZ_64K);
|
||||
readahead(device->fd, multi->stripes[0].physical, blocksize);
|
||||
readahead(device->fd, multi->stripes[0].physical,
|
||||
fs_info->nodesize);
|
||||
}
|
||||
|
||||
free_extent_buffer(eb);
|
||||
|
|
|
@ -121,7 +121,7 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
|
|||
int read_extent_data(struct btrfs_fs_info *fs_info, char *data, u64 logical,
|
||||
u64 *len, int mirror);
|
||||
void readahead_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
|
||||
u32 blocksize, u64 parent_transid);
|
||||
u64 parent_transid);
|
||||
struct extent_buffer* btrfs_find_create_tree_block(
|
||||
struct btrfs_fs_info *fs_info, u64 bytenr);
|
||||
|
||||
|
|
|
@ -1029,7 +1029,7 @@ static int add_extent(u64 start, u64 size, struct metadump_struct *md,
|
|||
return ret;
|
||||
md->pending_start = start;
|
||||
}
|
||||
readahead_tree_block(md->root->fs_info, start, size, 0);
|
||||
readahead_tree_block(md->root->fs_info, start, 0);
|
||||
md->pending_size += size;
|
||||
md->data = data;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue