diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-06-30 16:28:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-05-06 17:14:16 -0400 |
commit | ea5715a73506eb929e43b66eb3b87c94e2b44ab4 (patch) | |
tree | a145b47f47c831f20c6ee694995a5f9b7e2e6e31 /fs/bcachefs/bkey.c | |
parent | 5f6131b81dfa624673447c41cfb69c151086b802 (diff) |
Merge with 1f431b384d bcachefs: Refactor trans_(get|update)_key
Diffstat (limited to 'fs/bcachefs/bkey.c')
-rw-r--r-- | fs/bcachefs/bkey.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/bcachefs/bkey.c b/fs/bcachefs/bkey.c index 850ba72cc5a1..0f9dfe37b0af 100644 --- a/fs/bcachefs/bkey.c +++ b/fs/bcachefs/bkey.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "bcachefs.h" #include "bkey.h" @@ -59,8 +60,8 @@ static void bch2_bkey_pack_verify(const struct bkey_packed *packed, char buf1[160], buf2[160]; char buf3[160], buf4[160]; - bch2_bkey_to_text(buf1, sizeof(buf1), unpacked); - bch2_bkey_to_text(buf2, sizeof(buf2), &tmp); + bch2_bkey_to_text(&PBUF(buf1), unpacked); + bch2_bkey_to_text(&PBUF(buf2), &tmp); bch2_to_binary(buf3, (void *) unpacked, 80); bch2_to_binary(buf4, high_word(format, packed), 80); @@ -484,7 +485,7 @@ enum bkey_pack_pos_ret bch2_bkey_pack_pos_lossy(struct bkey_packed *out, pack_state_finish(&state, out); out->u64s = f->key_u64s; out->format = KEY_FORMAT_LOCAL_BTREE; - out->type = KEY_TYPE_DELETED; + out->type = KEY_TYPE_deleted; #ifdef CONFIG_BCACHEFS_DEBUG if (exact) { @@ -1010,11 +1011,8 @@ static inline int __bkey_cmp_bits(const u64 *l, const u64 *r, nr_key_bits -= 64; } - if (l_v != r_v) - return l_v < r_v ? -1 : 1; - - if (!nr_key_bits) - return 0; + if (!nr_key_bits || l_v != r_v) + break; l = next_word(l); r = next_word(r); @@ -1022,6 +1020,8 @@ static inline int __bkey_cmp_bits(const u64 *l, const u64 *r, l_v = *l; r_v = *r; } + + return cmp_int(l_v, r_v); } #endif |