btrfs: remove redundant check at find_first_extent_bit_state()

The tree_search() function always returns an entry that either contains
the search offset or the first entry in the tree that starts after the
offset. So checking at find_first_extent_bit_state() if the returned
entry ends at or after the search offset is pointless. Remove the check.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana
2025-04-02 13:23:45 +01:00
committed by David Sterba
parent 56ec21a6dd
commit c54c245f80

View File

@@ -877,7 +877,7 @@ static struct extent_state *find_first_extent_bit_state(struct extent_io_tree *t
*/
state = tree_search(tree, start);
while (state) {
if (state->end >= start && (state->state & bits))
if (state->state & bits)
return state;
state = next_state(state);
}