summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_iter.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-25 15:01:36 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:48 -0400
commit321bdc73f3aaba5acb9ed7082cf222444541eb74 (patch)
tree8d67b0f1b51e3ca46c0d48247c8e40c4ee5ad042 /fs/bcachefs/btree_iter.c
parent78c0b75c34209c471616566b3978eac4c1c53e99 (diff)
downloadlwn-321bdc73f3aaba5acb9ed7082cf222444541eb74.tar.gz
lwn-321bdc73f3aaba5acb9ed7082cf222444541eb74.zip
bcachefs: bkey_min(), bkey_max()
Parallel to bpos_min(), bpos_max() - trivial refactoring. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_iter.c')
-rw-r--r--fs/bcachefs/btree_iter.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 04051e45f4e0..8c951cfa74ae 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -2022,10 +2022,8 @@ struct bkey_s_c bch2_btree_iter_peek_upto(struct btree_iter *iter, struct bpos e
*/
if (!(iter->flags & BTREE_ITER_IS_EXTENTS))
iter_pos = k.k->p;
- else if (bkey_gt(bkey_start_pos(k.k), iter->pos))
- iter_pos = bkey_start_pos(k.k);
else
- iter_pos = iter->pos;
+ iter_pos = bkey_max(iter->pos, bkey_start_pos(k.k));
if (bkey_gt(iter_pos, end)) {
bch2_btree_iter_set_pos(iter, end);