summaryrefslogtreecommitdiff
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-03-03 13:55:12 +0800
committerDavid Sterba <dsterba@suse.com>2020-05-25 11:25:20 +0200
commit13fe1bdb22f8302afa5e588e89a7a94606ef35fb (patch)
tree4d44d6eb3478183d10fae59e01c4c425380ccc55 /fs/btrfs/relocation.c
parent023acb07bc996636b39c70e07966f70e70c0a008 (diff)
btrfs: backref: rename and move backref_cache_cleanup()
Since we're releasing all existing nodes/edges, other than cleanup the mess after error, "release" is a more proper naming here. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 4b7d7d54c64b..19481fd4afe6 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -175,36 +175,6 @@ static void mapping_tree_init(struct mapping_tree *tree)
spin_lock_init(&tree->lock);
}
-static void backref_cache_cleanup(struct btrfs_backref_cache *cache)
-{
- struct btrfs_backref_node *node;
- int i;
-
- while (!list_empty(&cache->detached)) {
- node = list_entry(cache->detached.next,
- struct btrfs_backref_node, list);
- btrfs_backref_cleanup_node(cache, node);
- }
-
- while (!list_empty(&cache->leaves)) {
- node = list_entry(cache->leaves.next,
- struct btrfs_backref_node, lower);
- btrfs_backref_cleanup_node(cache, node);
- }
-
- cache->last_trans = 0;
-
- for (i = 0; i < BTRFS_MAX_LEVEL; i++)
- ASSERT(list_empty(&cache->pending[i]));
- ASSERT(list_empty(&cache->pending_edge));
- ASSERT(list_empty(&cache->useless_node));
- ASSERT(list_empty(&cache->changed));
- ASSERT(list_empty(&cache->detached));
- ASSERT(RB_EMPTY_ROOT(&cache->rb_root));
- ASSERT(!cache->nr_nodes);
- ASSERT(!cache->nr_edges);
-}
-
static void backref_tree_panic(struct rb_node *rb_node, int errno, u64 bytenr)
{
@@ -3948,7 +3918,7 @@ restart:
rc->create_reloc_tree = 0;
set_reloc_control(rc);
- backref_cache_cleanup(&rc->backref_cache);
+ btrfs_backref_release_cache(&rc->backref_cache);
btrfs_block_rsv_release(fs_info, rc->block_rsv, (u64)-1, NULL);
/*