diff options
| author | Kent Overstreet <[email protected]> | 2024-02-12 03:48:05 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2024-07-14 23:00:13 +0000 |
| commit | fb23d57a6dfc4e521c003dc542799f07d22d269e (patch) | |
| tree | 0a814ccf2c3c06614f1b2ed0a48950f3a57783e4 /fs/bcachefs/btree_trans_commit.c | |
| parent | bcachefs: Kill replicas_journal_res (diff) | |
| download | kernel-fb23d57a6dfc4e521c003dc542799f07d22d269e.tar.gz kernel-fb23d57a6dfc4e521c003dc542799f07d22d269e.zip | |
bcachefs: Convert gc to new accounting
Rewrite fsck/gc for the new accounting scheme.
This adds a second set of in-memory accounting counters for gc to use;
like with other parts of gc we run all trigger in TRIGGER_GC mode, then
compare what we calculated to existing in-memory accounting at the end.
Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
| -rw-r--r-- | fs/bcachefs/btree_trans_commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index 92305c12cb75..30e24725eb12 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -724,7 +724,7 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags, a->k.version = journal_pos_to_bversion(&trans->journal_res, (u64 *) entry - (u64 *) trans->journal_entries); BUG_ON(bversion_zero(a->k.version)); - ret = bch2_accounting_mem_mod(trans, accounting_i_to_s_c(a)); + ret = bch2_accounting_mem_mod_locked(trans, accounting_i_to_s_c(a), false); if (ret) goto revert_fs_usage; } @@ -812,7 +812,7 @@ revert_fs_usage: struct bkey_s_accounting a = bkey_i_to_s_accounting(entry2->start); bch2_accounting_neg(a); - bch2_accounting_mem_mod(trans, a.c); + bch2_accounting_mem_mod_locked(trans, a.c, false); bch2_accounting_neg(a); } percpu_up_read(&c->mark_lock); |
