aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 74257d6436ad..d83085381bcc 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2855,9 +2855,10 @@ static void update_processed_blocks(struct reloc_control *rc,
2855 } 2855 }
2856} 2856}
2857 2857
2858static int tree_block_processed(u64 bytenr, u32 blocksize, 2858static int tree_block_processed(u64 bytenr, struct reloc_control *rc)
2859 struct reloc_control *rc)
2860{ 2859{
2860 u32 blocksize = rc->extent_root->nodesize;
2861
2861 if (test_range_bit(&rc->processed_blocks, bytenr, 2862 if (test_range_bit(&rc->processed_blocks, bytenr,
2862 bytenr + blocksize - 1, EXTENT_DIRTY, 1, NULL)) 2863 bytenr + blocksize - 1, EXTENT_DIRTY, 1, NULL))
2863 return 1; 2864 return 1;
@@ -2965,8 +2966,7 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
2965 while (rb_node) { 2966 while (rb_node) {
2966 block = rb_entry(rb_node, struct tree_block, rb_node); 2967 block = rb_entry(rb_node, struct tree_block, rb_node);
2967 if (!block->key_ready) 2968 if (!block->key_ready)
2968 readahead_tree_block(rc->extent_root, block->bytenr, 2969 readahead_tree_block(rc->extent_root, block->bytenr);
2969 block->key.objectid);
2970 rb_node = rb_next(rb_node); 2970 rb_node = rb_next(rb_node);
2971 } 2971 }
2972 2972
@@ -3353,7 +3353,7 @@ static int __add_tree_block(struct reloc_control *rc,
3353 bool skinny = btrfs_fs_incompat(rc->extent_root->fs_info, 3353 bool skinny = btrfs_fs_incompat(rc->extent_root->fs_info,
3354 SKINNY_METADATA); 3354 SKINNY_METADATA);
3355 3355
3356 if (tree_block_processed(bytenr, blocksize, rc)) 3356 if (tree_block_processed(bytenr, rc))
3357 return 0; 3357 return 0;
3358 3358
3359 if (tree_search(blocks, bytenr)) 3359 if (tree_search(blocks, bytenr))
@@ -3611,7 +3611,7 @@ static int find_data_references(struct reloc_control *rc,
3611 if (added) 3611 if (added)
3612 goto next; 3612 goto next;
3613 3613
3614 if (!tree_block_processed(leaf->start, leaf->len, rc)) { 3614 if (!tree_block_processed(leaf->start, rc)) {
3615 block = kmalloc(sizeof(*block), GFP_NOFS); 3615 block = kmalloc(sizeof(*block), GFP_NOFS);
3616 if (!block) { 3616 if (!block) {
3617 err = -ENOMEM; 3617 err = -ENOMEM;