summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-24 03:12:22 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:47 -0400
commite88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef (patch)
tree3b8608b0ae6e06d405bf6ef63e098416c68830db /fs/bcachefs/btree_io.h
parente15382125948523cd5c887c5fe4fa4303e9a9dc1 (diff)
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/btree_io.h')
-rw-r--r--fs/bcachefs/btree_io.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_io.h b/fs/bcachefs/btree_io.h
index 4b1810ad7d91..a720dd74139b 100644
--- a/fs/bcachefs/btree_io.h
+++ b/fs/bcachefs/btree_io.h
@@ -201,7 +201,7 @@ static inline void compat_btree_node(unsigned level, enum btree_id btree_id,
{
if (version < bcachefs_metadata_version_inode_btree_change &&
btree_node_type_is_extents(btree_id) &&
- bpos_cmp(bn->min_key, POS_MIN) &&
+ !bpos_eq(bn->min_key, POS_MIN) &&
write)
bn->min_key = bpos_nosnap_predecessor(bn->min_key);
@@ -218,7 +218,7 @@ static inline void compat_btree_node(unsigned level, enum btree_id btree_id,
if (version < bcachefs_metadata_version_inode_btree_change &&
btree_node_type_is_extents(btree_id) &&
- bpos_cmp(bn->min_key, POS_MIN) &&
+ !bpos_eq(bn->min_key, POS_MIN) &&
!write)
bn->min_key = bpos_nosnap_successor(bn->min_key);
}