mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 23:21:31 +00:00
bcachefs: Optimize __bkey_unpack_key_format_checked()
Delete some code when CONFIG_BCACHEFS_DEBUG=n Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
3e8b4b3afe
commit
b0c5b15cc8
@ -212,20 +212,19 @@ __bkey_unpack_key_format_checked(const struct btree *b,
|
||||
struct bkey *dst,
|
||||
const struct bkey_packed *src)
|
||||
{
|
||||
#ifdef HAVE_BCACHEFS_COMPILED_UNPACK
|
||||
{
|
||||
if (IS_ENABLED(HAVE_BCACHEFS_COMPILED_UNPACK)) {
|
||||
compiled_unpack_fn unpack_fn = b->aux_data;
|
||||
unpack_fn(dst, src);
|
||||
|
||||
if (bch2_expensive_debug_checks) {
|
||||
if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG) &&
|
||||
bch2_expensive_debug_checks) {
|
||||
struct bkey dst2 = __bch2_bkey_unpack_key(&b->format, src);
|
||||
|
||||
BUG_ON(memcmp(dst, &dst2, sizeof(*dst)));
|
||||
}
|
||||
} else {
|
||||
*dst = __bch2_bkey_unpack_key(&b->format, src);
|
||||
}
|
||||
#else
|
||||
*dst = __bch2_bkey_unpack_key(&b->format, src);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline struct bkey
|
||||
|
Loading…
Reference in New Issue
Block a user