diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-03-04 16:20:16 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-17 15:42:52 -0400 |
commit | 75ca59fbb61537fcb065e3f2fb366bab997a2cb3 (patch) | |
tree | 6f708475622a2ab5f425b4f831387ca91b0751f5 /fs/bcachefs/debug.c | |
parent | 8dd34636e6dc2d1a9f842ad7a89b517bec0c31a7 (diff) |
bcachefs: Split out bpos_cmp() and bkey_cmp()
With snapshots, we're going to need to differentiate between comparisons
that should and shouldn't include the snapshot field. bpos_cmp is now
the comparison function that does include the snapshot field, used by
core btree code.
Upper level filesystem code generally does _not_ want to compare against
the snapshot field - that code wants keys to compare as equal even when
one of them is in an ancestor snapshot.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r-- | fs/bcachefs/debug.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index c6d49f44aa01..2cedf6578f5b 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -273,7 +273,7 @@ static ssize_t bch2_read_btree_formats(struct file *file, char __user *buf, if (err) return err; - if (!i->size || !bkey_cmp(POS_MAX, i->from)) + if (!i->size || !bpos_cmp(POS_MAX, i->from)) return i->ret; bch2_trans_init(&trans, i->c, 0, 0); @@ -289,7 +289,7 @@ static ssize_t bch2_read_btree_formats(struct file *file, char __user *buf, * can't easily correctly restart a btree node traversal across * all nodes, meh */ - i->from = bkey_cmp(POS_MAX, b->key.k.p) + i->from = bpos_cmp(POS_MAX, b->key.k.p) ? bkey_successor(b->key.k.p) : b->key.k.p; |