From: Josef Bacik <josef@redhat.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Chris Mason <chris.mason@oracle.com>,
Josef Bacik <josef@redhat.com>,
linux-btrfs@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/6] btrfs: free fully occupied bitmap in cluster
Date: Mon, 23 Aug 2010 09:04:38 -0400 [thread overview]
Message-ID: <20100823130438.GC2404@localhost.localdomain> (raw)
In-Reply-To: <4C71CD84.1000809@cn.fujitsu.com>
On Mon, Aug 23, 2010 at 09:23:16AM +0800, Li Zefan wrote:
> If there's no more free space in a bitmap, we should free it,
> otherwise seems it won't get freed until we free the block group.
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> 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 017fd55..631e14f 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -1035,6 +1035,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);
> --
> 1.7.0.1
>
Oops, good catch
Reviewed-by: Josef Bacik <josef@redhat.com>
Thanks,
Josef
next prev parent reply other threads:[~2010-08-23 13:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-23 1:22 [PATCH 0/6] btrfs: some bug fixes for free space cache Li Zefan
2010-08-23 1:22 ` [PATCH 1/6] btrfs: fix threshold calculation for block groups smaller than 1GB Li Zefan
2010-08-23 13:02 ` Josef Bacik
2010-08-23 1:23 ` [PATCH 2/6] btrfs: add helper function free_bitmap() Li Zefan
2010-08-23 13:03 ` Josef Bacik
2010-08-23 1:23 ` [PATCH 3/6] btrfs: free fully occupied bitmap in cluster Li Zefan
2010-08-23 13:04 ` Josef Bacik [this message]
2010-08-23 1:23 ` [PATCH 4/6] btrfs: update stats when allocating from a cluster Li Zefan
2010-08-23 13:09 ` Josef Bacik
2010-08-24 0:50 ` Li Zefan
2010-08-24 2:50 ` Josef Bacik
2010-08-23 1:23 ` [PATCH 5/6] btrfs: add a helper try_merge_free_space() Li Zefan
2010-08-23 13:15 ` Josef Bacik
2010-08-23 1:24 ` [PATCH 6/6] btrfs: check mergeable free space when removing a cluster Li Zefan
2010-08-23 13:15 ` Josef Bacik
2010-08-24 1:04 ` Li Zefan
2010-08-24 2:58 ` Josef Bacik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100823130438.GC2404@localhost.localdomain \
--to=josef@redhat.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).