summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-io-tree.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2023-09-12 01:09:23 +0200
committerDavid Sterba <dsterba@suse.com>2023-10-12 16:44:14 +0200
commit99be1a66e1fe6c62fbd7c1b0c50ea38c33ffdd5a (patch)
tree4d83e0ee8336713d3455a43aac36159cb2d5e74b /fs/btrfs/extent-io-tree.h
parentbtrfs: move btrfs_realloc_node() from ctree.c into defrag.c (diff)
downloadlinux-99be1a66e1fe6c62fbd7c1b0c50ea38c33ffdd5a.tar.xz
linux-99be1a66e1fe6c62fbd7c1b0c50ea38c33ffdd5a.zip
btrfs: add specific helper for range bit test exists
The existing helper test_range_bit works in two ways, checks if the whole range contains all the bits, or stop on the first occurrence. By adding a specific helper for the latter case, the inner loop can be simplified and contains fewer conditionals, making it a bit faster. There's no caller that uses the cached state pointer so this reduces the argument count further. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-io-tree.h')
-rw-r--r--fs/btrfs/extent-io-tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent-io-tree.h b/fs/btrfs/extent-io-tree.h
index 28c23a23d121..336b7e8c0f86 100644
--- a/fs/btrfs/extent-io-tree.h
+++ b/fs/btrfs/extent-io-tree.h
@@ -133,6 +133,7 @@ u64 count_range_bits(struct extent_io_tree *tree,
void free_extent_state(struct extent_state *state);
int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end,
u32 bits, int filled, struct extent_state *cached_state);
+bool test_range_bit_exists(struct extent_io_tree *tree, u64 start, u64 end, u32 bit);
int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
u32 bits, struct extent_changeset *changeset);
int __clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,