diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-14 09:08:58 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:36 +0300 |
commit | dadecd02c49c7bb14c04445fc514c394e28c1ae3 (patch) | |
tree | 13c5f6470106c8a9ee7d0cfac9e466279e96d984 /fs/bcachefs/buckets.c | |
parent | 326568f18cb57ed95a420361da9a64330e122cda (diff) | |
download | linux-dadecd02c49c7bb14c04445fc514c394e28c1ae3.tar.xz |
bcachefs: bch2_trans_run()
This adds a new helper, bch2_trans_run(), that runs a function with a
btree_transaction context but without handling transaction restarts.
We're adding checks for nested transaction restart handling: when an
inner transaction handles a transaction restart it will still have to
return it to the outer transaction, or else assertions will be popped in
the outer transaction.
But some places don't need restart handling at the outer scope, so this
helper does what they need.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 71618f5bfcd5..136e116981d7 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1931,8 +1931,7 @@ static int __bch2_trans_mark_dev_sb(struct btree_trans *trans, int bch2_trans_mark_dev_sb(struct bch_fs *c, struct bch_dev *ca) { - return bch2_trans_do(c, NULL, NULL, BTREE_INSERT_LAZY_RW, - __bch2_trans_mark_dev_sb(&trans, ca)); + return bch2_trans_run(c, __bch2_trans_mark_dev_sb(&trans, ca)); } /* Disk reservations: */ |