diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-24 09:12:22 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:47 +0200 |
commit | e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef (patch) | |
tree | 3b8608b0ae6e06d405bf6ef63e098416c68830db /fs/bcachefs/keylist.c | |
parent | bcachefs: New magic number (diff) | |
download | linux-e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef.tar.xz linux-e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef.zip |
bcachefs: New bpos_cmp(), bkey_cmp() replacements
This patch introduces
- bpos_eq()
- bpos_lt()
- bpos_le()
- bpos_gt()
- bpos_ge()
and equivalent replacements for bkey_cmp().
Looking at the generated assembly these could probably be improved
further, but we already see a significant code size improvement with
this patch.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/keylist.c')
-rw-r--r-- | fs/bcachefs/keylist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/keylist.c b/fs/bcachefs/keylist.c index 5e85055b0f93..29e51bde8313 100644 --- a/fs/bcachefs/keylist.c +++ b/fs/bcachefs/keylist.c @@ -36,7 +36,7 @@ void bch2_keylist_add_in_order(struct keylist *l, struct bkey_i *insert) struct bkey_i *where; for_each_keylist_key(l, where) - if (bkey_cmp(insert->k.p, where->k.p) < 0) + if (bpos_lt(insert->k.p, where->k.p)) break; memmove_u64s_up((u64 *) where + insert->k.u64s, @@ -63,6 +63,6 @@ void bch2_verify_keylist_sorted(struct keylist *l) for_each_keylist_key(l, k) BUG_ON(bkey_next(k) != l->top && - bpos_cmp(k->k.p, bkey_next(k)->k.p) >= 0); + bpos_ge(k->k.p, bkey_next(k)->k.p)); } #endif |