Skip to contentSkip to conversation

Btrfs: make sure we call recalculate_thresholds() in btrfs_remove_free_space()

PATCH New Li Dongyang 1 participant 1 message Feb 25, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: make sure we call recalculate_thresholds() in btrfs_remove_free_space()

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

---
 fs/btrfs/free-space-cache.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
fs/btrfs/free-space-cache.c +5 -5
index a039065..f631817 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.4.1