diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-11-09 01:51:45 -0500 |
---|---|---|
committer | Li Zefan <lizf@cn.fujitsu.com> | 2011-01-26 12:04:41 -0500 |
commit | 70b7da304f9f9bbf1566085155895e32e775a745 (patch) | |
tree | 74c6de5ac85b7944292f2486b25946754d57989d /fs/btrfs/free-space-cache.c | |
parent | edf6e2d1ddbac7f326b34a27adbca71ece53ccce (diff) |
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 <josef@redhat.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 850104f05178..cb0137e4047f 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, | |||
1788 | 1788 | ||
1789 | ret = search_start; | 1789 | ret = search_start; |
1790 | bitmap_clear_bits(block_group, entry, ret, bytes); | 1790 | bitmap_clear_bits(block_group, entry, ret, bytes); |
1791 | if (entry->bytes == 0) | ||
1792 | free_bitmap(block_group, entry); | ||
1791 | out: | 1793 | out: |
1792 | spin_unlock(&cluster->lock); | 1794 | spin_unlock(&cluster->lock); |
1793 | spin_unlock(&block_group->tree_lock); | 1795 | spin_unlock(&block_group->tree_lock); |