aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDaniel Vacek <[email protected]>2025-03-18 09:54:38 +0000
committerDavid Sterba <[email protected]>2025-05-15 12:30:39 +0000
commit062f3d02a21ce4ec212fa53f8e05db65554b09d1 (patch)
tree59a694b1a636041d64e4e6656baf9fe72b422b93 /fs/btrfs
parentbtrfs: remove unused flag EXTENT_BUFFER_CORRUPT (diff)
downloadkernel-062f3d02a21ce4ec212fa53f8e05db65554b09d1.tar.gz
kernel-062f3d02a21ce4ec212fa53f8e05db65554b09d1.zip
btrfs: remove unused flag EXTENT_BUFFER_IN_TREE
This flag is set after inserting the eb to the buffer tree and cleared on it's removal. It was added in commit 34b41acec1ccc0 ("Btrfs: use a bit to track if we're in the radix tree") and wanted to make use of it, faa2dbf004e89e ("Btrfs: add sanity tests for new qgroup accounting code"). Both are 10+ years old, we can remove the flag. Signed-off-by: Daniel Vacek <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent_io.c18
-rw-r--r--fs/btrfs/extent_io.h1
2 files changed, 6 insertions, 13 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index af135d362ff1..89f866777698 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3044,7 +3044,6 @@ again:
goto again;
}
check_buffer_tree_ref(eb);
- set_bit(EXTENT_BUFFER_IN_TREE, &eb->bflags);
return eb;
free_eb:
@@ -3364,7 +3363,6 @@ again:
}
/* add one reference for the tree */
check_buffer_tree_ref(eb);
- set_bit(EXTENT_BUFFER_IN_TREE, &eb->bflags);
/*
* Now it's safe to unlock the pages because any calls to
@@ -3428,18 +3426,14 @@ static int release_extent_buffer(struct extent_buffer *eb)
WARN_ON(atomic_read(&eb->refs) == 0);
if (atomic_dec_and_test(&eb->refs)) {
- if (test_and_clear_bit(EXTENT_BUFFER_IN_TREE, &eb->bflags)) {
- struct btrfs_fs_info *fs_info = eb->fs_info;
+ struct btrfs_fs_info *fs_info = eb->fs_info;
- spin_unlock(&eb->refs_lock);
+ spin_unlock(&eb->refs_lock);
- spin_lock(&fs_info->buffer_lock);
- radix_tree_delete(&fs_info->buffer_radix,
- eb->start >> fs_info->sectorsize_bits);
- spin_unlock(&fs_info->buffer_lock);
- } else {
- spin_unlock(&eb->refs_lock);
- }
+ spin_lock(&fs_info->buffer_lock);
+ radix_tree_delete_item(&fs_info->buffer_radix,
+ eb->start >> fs_info->sectorsize_bits, eb);
+ spin_unlock(&fs_info->buffer_lock);
btrfs_leak_debug_del_eb(eb);
/* Should be safe to release folios at this point. */
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 4a09bf7d0443..a2a3d4d15ade 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -42,7 +42,6 @@ enum {
EXTENT_BUFFER_STALE,
EXTENT_BUFFER_WRITEBACK,
EXTENT_BUFFER_UNMAPPED,
- EXTENT_BUFFER_IN_TREE,
/* write IO error */
EXTENT_BUFFER_WRITE_ERR,
/* Indicate the extent buffer is written zeroed out (for zoned) */