summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/block-group.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2024-01-25 09:53:06 +0000
committerDavid Sterba <dsterba@suse.com>2024-02-09 20:29:14 +0100
commit1693d5442c458ae8d5b0d58463b873cd879569ed (patch)
treea1730d989c2cb5c86f0ae9e144ac1dc5b5dfe8fe /fs/btrfs/block-group.c
parent5571e41ec6e56e35f34ae9f5b3a335ef510e0ade (diff)
downloadlinux-1693d5442c458ae8d5b0d58463b873cd879569ed.tar.gz
linux-1693d5442c458ae8d5b0d58463b873cd879569ed.tar.bz2
linux-1693d5442c458ae8d5b0d58463b873cd879569ed.zip
btrfs: add and use helper to check if block group is used
Add a helper function to determine if a block group is being used and make use of it at btrfs_delete_unused_bgs(). This helper will also be used in future code changes. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-group.c')
-rw-r--r--fs/btrfs/block-group.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index a9be9ac99222..9daef18bcbbc 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1512,8 +1512,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
}
spin_lock(&block_group->lock);
- if (block_group->reserved || block_group->pinned ||
- block_group->used || block_group->ro ||
+ if (btrfs_is_block_group_used(block_group) || block_group->ro ||
list_is_singular(&block_group->list)) {
/*
* We want to bail if we made new allocations or have