bcachefs: Clear k->needs_whitout earlier in commit path

The upcoming btree write buffer rework is going to use the journal
itself as the first stage of the write buffer; this is a cleanup to make
sure k->needs_whiteout is initialized before keys hit the journal.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-11-07 11:16:14 -05:00
parent 066a26460b
commit 389c92b36e

View file

@ -655,6 +655,8 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags,
*stopped_at = i;
return ret;
}
i->k->k.needs_whiteout = false;
}
if (trans->nr_wb_updates &&
@ -777,8 +779,6 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags,
}
trans_for_each_update(trans, i) {
i->k->k.needs_whiteout = false;
if (!i->cached) {
u64 seq = trans->journal_res.seq;