btrfs: fix documentation for tree_search_for_insert()
authorFilipe Manana <fdmanana@suse.com>
Wed, 2 Apr 2025 12:07:33 +0000 (13:07 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:41 +0000 (14:30 +0200)
commit56ec21a6dd2775ab73237e87c8725fe8c36d04d1
treea69bce24cc279f55552349901327a649b8083871
parent131a4be1c03705ec4d94fc191c7621039d7f26f1
btrfs: fix documentation for tree_search_for_insert()

There are several things wrong with the documentation:

1) At the top it's only mentioned that we search for an entry containing
   the given offset, but when such entry does not exists we search for
   the first entry that starts and ends after that offset;

2) It mentions that @node_ret and @parent_ret aren't changed if the
   returned entry contains the given offset - that is true only if the
   returned entry starts exactly at @offset, otherwise those arguments
   are changed;

3) It mentions that if no entry containing offset is found then we return
   the first entry ending before the offset - that is not true, we return
   the first entry that starts and ends after that offset;

4) It also mentions that NULL is never returned. This is false as in case
   there's no entry containing offset or any entry that starts and ends
   after offset, NULL is returned.

So fix the documentation.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c