diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-24 03:12:22 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:47 -0400 |
commit | e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef (patch) | |
tree | 3b8608b0ae6e06d405bf6ef63e098416c68830db /fs/bcachefs/dirent.c | |
parent | e15382125948523cd5c887c5fe4fa4303e9a9dc1 (diff) | |
download | linux-e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef.tar.gz linux-e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef.tar.bz2 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/dirent.c')
-rw-r--r-- | fs/bcachefs/dirent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 288f46b55876..c2126f39369b 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -350,8 +350,8 @@ int bch2_dirent_rename(struct btree_trans *trans, bkey_init(&new_src->k); new_src->k.p = src_iter.pos; - if (bkey_cmp(dst_pos, src_iter.pos) <= 0 && - bkey_cmp(src_iter.pos, dst_iter.pos) < 0) { + if (bkey_le(dst_pos, src_iter.pos) && + bkey_lt(src_iter.pos, dst_iter.pos)) { /* * We have a hash collision for the new dst key, * and new_src - the key we're deleting - is between |