Skip to content

Commit 03509b7

Browse files
adam900710kdave
authored andcommitted
btrfs: update the comment for find_first_extent_bit
The pitfall here is, if the parameter @bits has multiple bits set, we will return the first range which just has one of the specified bits set. This is a little tricky if we want an exact match. Anyway, update the comment to make that clear. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent a3efb2f commit 03509b7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/btrfs/extent_io.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,11 +1554,12 @@ find_first_extent_bit_state(struct extent_io_tree *tree,
15541554
}
15551555

15561556
/*
1557-
* find the first offset in the io tree with 'bits' set. zero is
1558-
* returned if we find something, and *start_ret and *end_ret are
1559-
* set to reflect the state struct that was found.
1557+
* Find the first offset in the io tree with one or more @bits set.
15601558
*
1561-
* If nothing was found, 1 is returned. If found something, return 0.
1559+
* Note: If there are multiple bits set in @bits, any of them will match.
1560+
*
1561+
* Return 0 if we find something, and update @start_ret and @end_ret.
1562+
* Return 1 if we found nothing.
15621563
*/
15631564
int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
15641565
u64 *start_ret, u64 *end_ret, unsigned bits,

0 commit comments

Comments
 (0)