From 618b1c0e20ac7bccebba0346ab1e1403fadd6aa0 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 5 Jul 2021 22:02:07 -0400 Subject: bcachefs: Split out SPOS_MAX Internal btree code really wants a POS_MAX with all fields ~0; external code more likely wants the snapshot field to be 0, because when we're passing it to bch2_trans_get_iter() it's used for the snapshot we're operating in, which should be 0 for most btrees that don't use snapshots. Signed-off-by: Kent Overstreet --- fs/bcachefs/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/bcachefs/debug.c') diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index d6dde62b6d48..cbadb38f680f 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -313,7 +313,7 @@ static ssize_t bch2_read_btree_formats(struct file *file, char __user *buf, if (err) return err; - if (!i->size || !bpos_cmp(POS_MAX, i->from)) + if (!i->size || !bpos_cmp(SPOS_MAX, i->from)) return i->ret; bch2_trans_init(&trans, i->c, 0, 0); @@ -329,7 +329,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 = bpos_cmp(POS_MAX, b->key.k.p) + i->from = bpos_cmp(SPOS_MAX, b->key.k.p) ? bpos_successor(b->key.k.p) : b->key.k.p; -- cgit v1.2.3