mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-03 00:55:43 -05:00
bcachefs: Drop empty accounting updates
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -111,6 +111,16 @@ int bch2_disk_accounting_mod(struct btree_trans *trans,
|
||||
if (bpos_eq(a->k.p, pos)) {
|
||||
BUG_ON(nr != bch2_accounting_counters(&a->k));
|
||||
acc_u64s(a->v.d, d, nr);
|
||||
|
||||
if (bch2_accounting_key_is_zero(accounting_i_to_s_c(a))) {
|
||||
unsigned offset = (u64 *) a -
|
||||
(u64 *) btree_trans_subbuf_base(trans, &trans->accounting);
|
||||
|
||||
trans->accounting.u64s -= a->k.u64s;
|
||||
memmove_u64s_down(a,
|
||||
bkey_next(&a->k_i),
|
||||
trans->accounting.u64s - offset);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user