Commit f7f21ed3 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Remove some BKEY_PADDED uses

Prep work for extents with inline data
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent b904a799
...@@ -418,7 +418,7 @@ bch2_sort_repack_merge(struct bch_fs *c, ...@@ -418,7 +418,7 @@ bch2_sort_repack_merge(struct bch_fs *c,
struct bkey_packed *prev = NULL, *k_packed; struct bkey_packed *prev = NULL, *k_packed;
struct bkey_s k; struct bkey_s k;
struct btree_nr_keys nr; struct btree_nr_keys nr;
BKEY_PADDED(k) tmp; struct bkey unpacked;
memset(&nr, 0, sizeof(nr)); memset(&nr, 0, sizeof(nr));
...@@ -426,11 +426,7 @@ bch2_sort_repack_merge(struct bch_fs *c, ...@@ -426,11 +426,7 @@ bch2_sort_repack_merge(struct bch_fs *c,
if (filter_whiteouts && bkey_whiteout(k_packed)) if (filter_whiteouts && bkey_whiteout(k_packed))
continue; continue;
EBUG_ON(bkeyp_val_u64s(&src->format, k_packed) > k = __bkey_disassemble(src, k_packed, &unpacked);
BKEY_EXTENT_VAL_U64s_MAX);
bch2_bkey_unpack(src, &tmp.k, k_packed);
k = bkey_i_to_s(&tmp.k);
if (filter_whiteouts && if (filter_whiteouts &&
bch2_bkey_normalize(c, k)) bch2_bkey_normalize(c, k))
......
...@@ -1217,7 +1217,6 @@ void bch2_insert_fixup_extent(struct btree_trans *trans, ...@@ -1217,7 +1217,6 @@ void bch2_insert_fixup_extent(struct btree_trans *trans,
struct bkey_i whiteout = *insert; struct bkey_i whiteout = *insert;
struct bkey_packed *_k; struct bkey_packed *_k;
struct bkey unpacked; struct bkey unpacked;
BKEY_PADDED(k) tmp;
EBUG_ON(iter->level); EBUG_ON(iter->level);
EBUG_ON(!insert->k.size); EBUG_ON(!insert->k.size);
...@@ -1291,25 +1290,23 @@ void bch2_insert_fixup_extent(struct btree_trans *trans, ...@@ -1291,25 +1290,23 @@ void bch2_insert_fixup_extent(struct btree_trans *trans,
bch2_btree_iter_set_pos_same_leaf(iter, insert->k.p); bch2_btree_iter_set_pos_same_leaf(iter, insert->k.p);
if (update_btree) { if (update_btree) {
bkey_copy(&tmp.k, insert);
if (deleting) 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) { if (update_journal) {
bkey_copy(&tmp.k, !deleting ? insert : &whiteout); struct bkey_i *k = !deleting ? insert : &whiteout;
if (deleting) 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); bch2_cut_front(insert->k.p, insert);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment