Merge branch 'cleanup/blocksize-diet-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
This commit is contained in:
@@ -1846,8 +1846,7 @@ again:
|
||||
break;
|
||||
}
|
||||
|
||||
eb = read_tree_block(dest, old_bytenr, blocksize,
|
||||
old_ptr_gen);
|
||||
eb = read_tree_block(dest, old_bytenr, old_ptr_gen);
|
||||
if (!eb || !extent_buffer_uptodate(eb)) {
|
||||
ret = (!eb) ? -ENOMEM : -EIO;
|
||||
free_extent_buffer(eb);
|
||||
@@ -1977,7 +1976,6 @@ int walk_down_reloc_tree(struct btrfs_root *root, struct btrfs_path *path,
|
||||
u64 bytenr;
|
||||
u64 ptr_gen = 0;
|
||||
u64 last_snapshot;
|
||||
u32 blocksize;
|
||||
u32 nritems;
|
||||
|
||||
last_snapshot = btrfs_root_last_snapshot(&root->root_item);
|
||||
@@ -2003,8 +2001,7 @@ int walk_down_reloc_tree(struct btrfs_root *root, struct btrfs_path *path,
|
||||
}
|
||||
|
||||
bytenr = btrfs_node_blockptr(eb, path->slots[i]);
|
||||
blocksize = root->nodesize;
|
||||
eb = read_tree_block(root, bytenr, blocksize, ptr_gen);
|
||||
eb = read_tree_block(root, bytenr, ptr_gen);
|
||||
if (!eb || !extent_buffer_uptodate(eb)) {
|
||||
free_extent_buffer(eb);
|
||||
return -EIO;
|
||||
@@ -2712,7 +2709,7 @@ static int do_relocation(struct btrfs_trans_handle *trans,
|
||||
|
||||
blocksize = root->nodesize;
|
||||
generation = btrfs_node_ptr_generation(upper->eb, slot);
|
||||
eb = read_tree_block(root, bytenr, blocksize, generation);
|
||||
eb = read_tree_block(root, bytenr, generation);
|
||||
if (!eb || !extent_buffer_uptodate(eb)) {
|
||||
free_extent_buffer(eb);
|
||||
err = -EIO;
|
||||
@@ -2874,7 +2871,7 @@ static int get_tree_block_key(struct reloc_control *rc,
|
||||
|
||||
BUG_ON(block->key_ready);
|
||||
eb = read_tree_block(rc->extent_root, block->bytenr,
|
||||
block->key.objectid, block->key.offset);
|
||||
block->key.offset);
|
||||
if (!eb || !extent_buffer_uptodate(eb)) {
|
||||
free_extent_buffer(eb);
|
||||
return -EIO;
|
||||
@@ -2889,20 +2886,6 @@ static int get_tree_block_key(struct reloc_control *rc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reada_tree_block(struct reloc_control *rc,
|
||||
struct tree_block *block)
|
||||
{
|
||||
BUG_ON(block->key_ready);
|
||||
if (block->key.type == BTRFS_METADATA_ITEM_KEY)
|
||||
readahead_tree_block(rc->extent_root, block->bytenr,
|
||||
block->key.objectid,
|
||||
rc->extent_root->nodesize);
|
||||
else
|
||||
readahead_tree_block(rc->extent_root, block->bytenr,
|
||||
block->key.objectid, block->key.offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* helper function to relocate a tree block
|
||||
*/
|
||||
@@ -2982,7 +2965,8 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
|
||||
while (rb_node) {
|
||||
block = rb_entry(rb_node, struct tree_block, rb_node);
|
||||
if (!block->key_ready)
|
||||
reada_tree_block(rc, block);
|
||||
readahead_tree_block(rc->extent_root, block->bytenr,
|
||||
block->key.objectid);
|
||||
rb_node = rb_next(rb_node);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user