From: Li Zefan Date: Tue, 9 Nov 2010 06:51:45 +0000 (+0800) Subject: btrfs: Free fully occupied bitmap in cluster X-Git-Tag: v2.6.38-rc4~2^2~21^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70b7da304f9f9bbf1566085155895e32e775a745;p=profile%2Fcommon%2Fkernel-common.git btrfs: Free fully occupied bitmap in cluster If there's no more free space in a bitmap, we should free it. Reviewed-by: Josef Bacik Signed-off-by: Li Zefan --- diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 850104f..cb0137e 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1788,6 +1788,8 @@ static u64 btrfs_alloc_from_bitmap(struct btrfs_block_group_cache *block_group, ret = search_start; bitmap_clear_bits(block_group, entry, ret, bytes); + if (entry->bytes == 0) + free_bitmap(block_group, entry); out: spin_unlock(&cluster->lock); spin_unlock(&block_group->tree_lock);