bcachefs: bch2_btree_iter_peek_upto()
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 11 Mar 2022 17:31:52 +0000 (12:31 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:27 +0000 (17:09 -0400)
commit85d8cf161f98993f544c0b2c614873caf7b9c14f
treebc6998212112729d53a479dfb3778d5316adf858
parentd4d24a6509548a6457f185fddd927df7d148464a
bcachefs: bch2_btree_iter_peek_upto()

In BTREE_ITER_FILTER_SNAPHOTS mode, we skip over keys in unrelated
snapshots. When we hit the end of an inode, if the next inode(s) are in
a different subvolume, we could potentially have to skip past many keys
before finding a key we can return to the caller, so they can terminate
the iteration.

This adds a peek_upto() variant to solve this problem, to be used when
we know the range we're searching within.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/dirent.c
fs/bcachefs/fs.c
fs/bcachefs/inode.c
fs/bcachefs/str_hash.h
fs/bcachefs/xattr.c