summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/bkey.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-08-30 15:18:31 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:11 -0400
commit807dda8c83620ab0fd1d93bbe8bdc4a289cbd045 (patch)
tree5d922396c83f69dbe5ea8905956200b76060b99d /fs/bcachefs/bkey.h
parent67e0dd8f0d8b4bf09098c4692abcb43a20089dff (diff)
downloadlinux-807dda8c83620ab0fd1d93bbe8bdc4a289cbd045.tar.gz
linux-807dda8c83620ab0fd1d93bbe8bdc4a289cbd045.tar.bz2
linux-807dda8c83620ab0fd1d93bbe8bdc4a289cbd045.zip
bcachefs: Kill bpos_diff() XXX check for perf regression
This improves the btree iterator lookup code by using trans_for_each_iter_inorder(). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/bkey.h')
-rw-r--r--fs/bcachefs/bkey.h31
1 files changed, 0 insertions, 31 deletions
diff --git a/fs/bcachefs/bkey.h b/fs/bcachefs/bkey.h
index 72b4267031d8..904ceb67a029 100644
--- a/fs/bcachefs/bkey.h
+++ b/fs/bcachefs/bkey.h
@@ -171,37 +171,6 @@ static inline struct bpos bpos_max(struct bpos l, struct bpos r)
return bpos_cmp(l, r) > 0 ? l : r;
}
-#define sbb(a, b, borrow) \
-do { \
- typeof(a) d1, d2; \
- \
- d1 = a - borrow; \
- borrow = d1 > a; \
- \
- d2 = d1 - b; \
- borrow += d2 > d1; \
- a = d2; \
-} while (0)
-
-/* returns a - b: */
-static inline struct bpos bpos_sub(struct bpos a, struct bpos b)
-{
- int borrow = 0;
-
- sbb(a.snapshot, b.snapshot, borrow);
- sbb(a.offset, b.offset, borrow);
- sbb(a.inode, b.inode, borrow);
- return a;
-}
-
-static inline struct bpos bpos_diff(struct bpos l, struct bpos r)
-{
- if (bpos_cmp(l, r) > 0)
- swap(l, r);
-
- return bpos_sub(r, l);
-}
-
void bch2_bpos_swab(struct bpos *);
void bch2_bkey_swab_key(const struct bkey_format *, struct bkey_packed *);