diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-11 02:31:12 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:44 -0500 |
commit | 6474b706108bac9e531a71ddeb8150f8fa17163c (patch) | |
tree | a588b981ba8fe155d77377f83f7c4d811e617e76 /fs/bcachefs/btree_iter.c | |
parent | 398c98347d464f7675216c5ea974a82bcdb2bef9 (diff) | |
download | linux-stable-6474b706108bac9e531a71ddeb8150f8fa17163c.tar.gz linux-stable-6474b706108bac9e531a71ddeb8150f8fa17163c.tar.bz2 linux-stable-6474b706108bac9e531a71ddeb8150f8fa17163c.zip |
bcachefs: Clean up btree_trans
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_iter.c')
-rw-r--r-- | fs/bcachefs/btree_iter.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index cfe81db883cc..ced13bbc52f7 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1493,7 +1493,7 @@ static void bch2_trans_update_max_paths(struct btree_trans *trans) printbuf_exit(&buf); - trans->nr_max_paths = nr; + trans->nr_paths_max = nr; } noinline __cold @@ -1526,13 +1526,11 @@ static inline btree_path_idx_t btree_path_alloc(struct btree_trans *trans, if (unlikely(idx == BTREE_ITER_MAX)) btree_path_overflow(trans); - BUG_ON(idx > BTREE_ITER_MAX); - /* * Do this before marking the new path as allocated, since it won't be * initialized yet: */ - if (unlikely(idx > trans->nr_max_paths)) + if (unlikely(idx > trans->nr_paths_max)) bch2_trans_update_max_paths(trans); __set_bit(idx, trans->paths_allocated); @@ -2918,6 +2916,10 @@ struct btree_trans *__bch2_trans_get(struct bch_fs *c, unsigned fn_idx) atomic_inc_not_zero(&c->journal_keys.ref); closure_init_stack(&trans->ref); + trans->paths_allocated = trans->_paths_allocated; + trans->sorted = trans->_sorted; + trans->paths = trans->_paths; + trans->paths_allocated[0] = 1; s = btree_trans_stats(trans); @@ -2935,7 +2937,7 @@ struct btree_trans *__bch2_trans_get(struct bch_fs *c, unsigned fn_idx) } if (s) { - trans->nr_max_paths = s->nr_max_paths; + trans->nr_paths_max = s->nr_max_paths; trans->journal_entries_size = s->journal_entries_size; } |