diff options
| author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-10-29 18:43:18 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:15 -0400 |
| commit | 904823de497fa6637db8bc7c3b017f121b72bdf3 (patch) | |
| tree | ade8271b94cd2cabe595a9e8f5ae656f3c74e693 /fs/bcachefs/alloc_background.c | |
| parent | 961b2d62821f23f9f963ee069b64eb8806f05e40 (diff) | |
bcachefs: Convert bch2_mark_key() to take a btree_trans *
This helps to unify the interface between bch2_mark_key() and
bch2_trans_mark_key() - and it also gives access to the journal
reservation and journal seq in the mark_key path.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
| -rw-r--r-- | fs/bcachefs/alloc_background.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 2551ccc99d38..3b6af70fa186 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -261,8 +261,9 @@ void bch2_alloc_to_text(struct printbuf *out, struct bch_fs *c, #undef x } -static int bch2_alloc_read_fn(struct bch_fs *c, struct bkey_s_c k) +static int bch2_alloc_read_fn(struct btree_trans *trans, struct bkey_s_c k) { + struct bch_fs *c = trans->c; struct bch_dev *ca; struct bucket *g; struct bkey_alloc_unpacked u; @@ -289,11 +290,14 @@ static int bch2_alloc_read_fn(struct bch_fs *c, struct bkey_s_c k) int bch2_alloc_read(struct bch_fs *c) { + struct btree_trans trans; int ret; + bch2_trans_init(&trans, c, 0, 0); down_read(&c->gc_lock); - ret = bch2_btree_and_journal_walk(c, BTREE_ID_alloc, bch2_alloc_read_fn); + ret = bch2_btree_and_journal_walk(&trans, BTREE_ID_alloc, bch2_alloc_read_fn); up_read(&c->gc_lock); + bch2_trans_exit(&trans); if (ret) { bch_err(c, "error reading alloc info: %i", ret); return ret; |
