btrfs: Free fully occupied bitmap in cluster
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 9 Nov 2010 06:51:45 +0000 (14:51 +0800)
committerLi Zefan <lizf@cn.fujitsu.com>
Wed, 26 Jan 2011 17:04:41 +0000 (01:04 +0800)
If there's no more free space in a bitmap, we should free it.

Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
fs/btrfs/free-space-cache.c

index 850104f05178c0f6e7aa18ae6cfa11fb91267538..cb0137e4047f2972bf2a7c3a277f01b51b311fe3 100644 (file)
@@ -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);