mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
bcachefs: Remove some BKEY_PADDED uses
Prep work for extents with inline data Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
b904a79918
commit
f7f21ed382
@ -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))
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user