linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Dongyang <jerry87905@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs: make sure we call recalculate_thresholds() in btrfs_remove_free_space()
Date: Fri, 25 Feb 2011 20:16:06 +0800	[thread overview]
Message-ID: <20110225121606.GA4248@Archlinux> (raw)

we should recalculate the thresholds everytime when we add/free a bitmap,
make sure we do this in btrfs_remove_free_space() by calling free_bitmap(),Thanks

Signed-off-by: Li Dongyang <lidongyang@novell.com>
---
 fs/btrfs/free-space-cache.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index a039065..f631817 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1515,12 +1515,12 @@ again:
 	}
 
 	if (info->bytes == bytes) {
-		unlink_free_space(block_group, info);
-		if (info->bitmap) {
-			kfree(info->bitmap);
-			block_group->total_bitmaps--;
+		if (info->bitmap)
+			free_bitmap(block_group, info);
+		else {
+			unlink_free_space(block_group, info);
+			kfree(info);
 		}
-		kfree(info);
 		goto out_lock;
 	}
 
-- 
1.7.4.1


                 reply	other threads:[~2011-02-25 12:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110225121606.GA4248@Archlinux \
    --to=jerry87905@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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).