summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2019-06-20 15:37:46 -0400
committerDavid Sterba <dsterba@suse.com>2019-09-09 14:59:04 +0200
commit3cad128400c2445d9140c0f5720018e075ef66c6 (patch)
tree43632afb0ad6869ff72eac40183aaf03240bf7c9 /fs/btrfs/extent-tree.c
parent2e405ad842546a1a37aaa586d5140d071cb1f802 (diff)
downloadlinux-3cad128400c2445d9140c0f5720018e075ef66c6.tar.gz
linux-3cad128400c2445d9140c0f5720018e075ef66c6.tar.bz2
linux-3cad128400c2445d9140c0f5720018e075ef66c6.zip
btrfs: migrate the block group ref counting stuff
Another easy set to move over to block-group.c. 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-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a454945227ca..dc1fb9286fee 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -68,31 +68,6 @@ static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits)
return (cache->flags & bits) == bits;
}
-void btrfs_get_block_group(struct btrfs_block_group_cache *cache)
-{
- atomic_inc(&cache->count);
-}
-
-void btrfs_put_block_group(struct btrfs_block_group_cache *cache)
-{
- if (atomic_dec_and_test(&cache->count)) {
- WARN_ON(cache->pinned > 0);
- WARN_ON(cache->reserved > 0);
-
- /*
- * If not empty, someone is still holding mutex of
- * full_stripe_lock, which can only be released by caller.
- * And it will definitely cause use-after-free when caller
- * tries to release full stripe lock.
- *
- * No better way to resolve, but only to warn.
- */
- WARN_ON(!RB_EMPTY_ROOT(&cache->full_stripe_locks_root.root));
- kfree(cache->free_space_ctl);
- kfree(cache);
- }
-}
-
/*
* this adds the block group to the fs_info rb tree for the block group
* cache