diff --git a/fs/bcachefs/bkey_sort.c b/fs/bcachefs/bkey_sort.c index e32fad5a91ac..2cac269b386f 100644 --- a/fs/bcachefs/bkey_sort.c +++ b/fs/bcachefs/bkey_sort.c @@ -418,7 +418,7 @@ bch2_sort_repack_merge(struct bch_fs *c, struct bkey_packed *prev = NULL, *k_packed; struct bkey_s k; struct btree_nr_keys nr; - BKEY_PADDED(k) tmp; + struct bkey unpacked; memset(&nr, 0, sizeof(nr)); @@ -426,11 +426,7 @@ bch2_sort_repack_merge(struct bch_fs *c, if (filter_whiteouts && bkey_whiteout(k_packed)) continue; - EBUG_ON(bkeyp_val_u64s(&src->format, k_packed) > - BKEY_EXTENT_VAL_U64s_MAX); - - bch2_bkey_unpack(src, &tmp.k, k_packed); - k = bkey_i_to_s(&tmp.k); + k = __bkey_disassemble(src, k_packed, &unpacked); if (filter_whiteouts && bch2_bkey_normalize(c, k)) diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index 201f4953acac..3cd0a79f8fe6 100644 --- a/fs/bcachefs/extents.c +++ b/fs/bcachefs/extents.c @@ -1217,7 +1217,6 @@ void bch2_insert_fixup_extent(struct btree_trans *trans, struct bkey_i whiteout = *insert; struct bkey_packed *_k; struct bkey unpacked; - BKEY_PADDED(k) tmp; EBUG_ON(iter->level); EBUG_ON(!insert->k.size); @@ -1291,25 +1290,23 @@ next: bch2_btree_iter_set_pos_same_leaf(iter, insert->k.p); if (update_btree) { - bkey_copy(&tmp.k, insert); - if (deleting) - tmp.k.k.type = KEY_TYPE_discard; + insert->k.type = KEY_TYPE_discard; - EBUG_ON(bkey_deleted(&tmp.k.k) || !tmp.k.k.size); + EBUG_ON(bkey_deleted(&insert->k) || !insert->k.size); - extent_bset_insert(c, iter, &tmp.k); + extent_bset_insert(c, iter, insert); } if (update_journal) { - bkey_copy(&tmp.k, !deleting ? insert : &whiteout); + struct bkey_i *k = !deleting ? insert : &whiteout; if (deleting) - tmp.k.k.type = KEY_TYPE_discard; + k->k.type = KEY_TYPE_discard; - EBUG_ON(bkey_deleted(&tmp.k.k) || !tmp.k.k.size); + EBUG_ON(bkey_deleted(&k->k) || !k->k.size); - bch2_btree_journal_key(trans, iter, &tmp.k); + bch2_btree_journal_key(trans, iter, k); } bch2_cut_front(insert->k.p, insert);