btrfs: convert block group refcount to refcount_t
authorJosef Bacik <josef@toxicpanda.com>
Mon, 6 Jul 2020 13:14:11 +0000 (09:14 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:42 +0000 (12:55 +0200)
commit48aaeebe4e1f3c76a703dc40e9245af1753dcefe
treee7115f27287120640210360344b54c06d5fbbf54
parent60f8667b618e1cb2ded148a7b767bbb70d6c191c
btrfs: convert block group refcount to refcount_t

We have refcount_t now with the associated library to handle refcounts,
which gives us extra debugging around reference count mistakes that may
be made.  For example it'll warn on any transition from 0->1 or 0->-1,
which is handy for noticing cases where we've messed up reference
counting.  Convert the block group ref counting from an atomic_t to
refcount_t and use the appropriate helpers.

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>
fs/btrfs/block-group.c
fs/btrfs/block-group.h