diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-21 19:20:09 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:45 -0400 |
commit | e5baf3dad91a6561ab81e2514217876d58648c1a (patch) | |
tree | e4d5a5b47b824ecc50e3b15b149cc716c061c10d /fs/bcachefs/bkey_sort.c | |
parent | 77671e8fffdd09f37de2ed0cdcdc92069f3597e8 (diff) |
bcachefs: bch2_bkey_cmp_packed_inlined()
This adds an inlined version of bch2_bkey_cmp_packed(), and uses it in
bch2_sort_keys(), where it's part of the inner loop.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_sort.c')
-rw-r--r-- | fs/bcachefs/bkey_sort.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/bkey_sort.c b/fs/bcachefs/bkey_sort.c index b1385a77da11..be0d4bc1afd3 100644 --- a/fs/bcachefs/bkey_sort.c +++ b/fs/bcachefs/bkey_sort.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcachefs.h" #include "bkey_buf.h" +#include "bkey_cmp.h" #include "bkey_sort.h" #include "bset.h" #include "extents.h" @@ -155,7 +156,7 @@ static inline int sort_keys_cmp(struct btree *b, struct bkey_packed *l, struct bkey_packed *r) { - return bch2_bkey_cmp_packed(b, l, r) ?: + return bch2_bkey_cmp_packed_inlined(b, l, r) ?: (int) bkey_deleted(r) - (int) bkey_deleted(l) ?: (int) l->needs_whiteout - (int) r->needs_whiteout; } @@ -177,7 +178,7 @@ unsigned bch2_sort_keys(struct bkey_packed *dst, continue; while ((next = sort_iter_peek(iter)) && - !bch2_bkey_cmp_packed(iter->b, in, next)) { + !bch2_bkey_cmp_packed_inlined(iter->b, in, next)) { BUG_ON(in->needs_whiteout && next->needs_whiteout); needs_whiteout |= in->needs_whiteout; |