bcachefs: Rework iter->pos handling
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 7 Jan 2020 03:25:09 +0000 (22:25 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:34 +0000 (17:08 -0400)
commit9626aeb167144db2ba235bde5f9f1863c3ef354b
treed92648cf2688e9433457373bf2af9ff85340e6c9
parentf2e8c69fcb63d280d1013b84973889e3aecd6603
bcachefs: Rework iter->pos handling

- Rework some of the helper comparison functions for consistency

- Currently trying to refactor all the logic that's different for
extents in the btree iterator code. The main difference is that for non
extents we search for a key greater than or equal to the search key,
while for extents we search for a key strictly greater than the search
key (iter->pos).

So that logic is now handled by btree_iter_search_key(), which computes
the real search key based on iter->pos and whether or not we're
searching for a key >= or > iter->pos.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bset.c
fs/bcachefs/bset.h
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_update_interior.c