aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-11-05 10:45:20 -0500
committerDavid Sterba <dsterba@suse.com>2020-12-08 15:54:07 +0100
commit3fbaf25817f7013fad3ccf76279f0bd5719a5205 (patch)
treef781b57b4ccf79b2f863dd6ca715bc8602f3a33b /fs/btrfs/extent_io.c
parentbtrfs: pass the root owner and level around for readahead (diff)
downloadlinux-dev-3fbaf25817f7013fad3ccf76279f0bd5719a5205.tar.xz
linux-dev-3fbaf25817f7013fad3ccf76279f0bd5719a5205.zip
btrfs: pass the owner_root and level to alloc_extent_buffer
Now that we've plumbed all of the callers to have the owner root and the level, plumb it down into alloc_extent_buffer(). Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 973254b1f216..bd0d4d195d76 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5180,7 +5180,7 @@ free_eb:
#endif
struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
- u64 start)
+ u64 start, u64 owner_root, int level)
{
unsigned long len = fs_info->nodesize;
int num_pages;
@@ -6128,19 +6128,21 @@ int try_release_extent_buffer(struct page *page)
* btrfs_readahead_tree_block - attempt to readahead a child block
* @fs_info: the fs_info
* @bytenr: bytenr to read
+ * @owner_root: objectid of the root that owns this eb
* @gen: generation for the uptodate check, can be 0
+ * @level: level for the eb
*
* Attempt to readahead a tree block at @bytenr. If @gen is 0 then we do a
* normal uptodate check of the eb, without checking the generation. If we have
* to read the block we will not block on anything.
*/
void btrfs_readahead_tree_block(struct btrfs_fs_info *fs_info,
- u64 bytenr, u64 gen)
+ u64 bytenr, u64 owner_root, u64 gen, int level)
{
struct extent_buffer *eb;
int ret;
- eb = btrfs_find_create_tree_block(fs_info, bytenr);
+ eb = btrfs_find_create_tree_block(fs_info, bytenr, owner_root, level);
if (IS_ERR(eb))
return;
@@ -6168,5 +6170,7 @@ void btrfs_readahead_node_child(struct extent_buffer *node, int slot)
{
btrfs_readahead_tree_block(node->fs_info,
btrfs_node_blockptr(node, slot),
- btrfs_node_ptr_generation(node, slot));
+ btrfs_header_owner(node),
+ btrfs_node_ptr_generation(node, slot),
+ btrfs_header_level(node) - 1);
}