diff mbox series

[2/3] btrfs: stop searching for EXTENT_DIRTY bit in the excluded extents io tree

Message ID c1a1c0a13d53a86121dde3eb97ba0d62de3a9e68.1743166248.git.fdmanana@suse.com (mailing list archive)
State New
Headers show
Series btrfs: some cleanups related to io trees | expand

Commit Message

Filipe Manana March 28, 2025, 2:24 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

At btrfs_add_new_free_space() we keep searching for ranges in the excluded
extents io tree that have the EXTENT_DIRTY bit set, however we never ever
set that bit for ranges in that tree. That is a leftover from when that
function used the global freed extents trees (fs_info->freed_extents[2]),
where we used both the EXTENT_DIRTY and EXTENT_UPTODATE bits, but those
trees are gone with commit fe119a6eeb67 ("btrfs: switch to per-transaction
pinned extents"), which introduced the fs_info->excluded_extents io tree,
where only EXTENT_UPTODATE is set.

So remove the EXTENT_DIRTY bit search at btrfs_add_new_free_space().

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/block-group.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index a8129f1ce78c..8a02375f27e8 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -527,8 +527,7 @@  int btrfs_add_new_free_space(struct btrfs_block_group *block_group, u64 start,
 	while (start < end) {
 		if (!find_first_extent_bit(&info->excluded_extents, start,
 					   &extent_start, &extent_end,
-					   EXTENT_DIRTY | EXTENT_UPTODATE,
-					   NULL))
+					   EXTENT_UPTODATE, NULL))
 			break;
 
 		if (extent_start <= start) {