diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-09 21:22:12 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:50 +0300 |
commit | 30ca6ece88f2d11647c3854faf0dce528c32d5cf (patch) | |
tree | 56d1d0fcec9b2416e0d7e59505bfdffd847f15fd /fs/bcachefs/btree_update.h | |
parent | 60b5538877a2d34396280615484b995911e09b69 (diff) | |
download | linux-30ca6ece88f2d11647c3854faf0dce528c32d5cf.tar.xz |
bcachefs: Kill trans->flags
Recursive transaction commits are occasionally necessary - in
particular, for the upcoming btree write buffer's flush path.
This avoids bugs due to trans->flags being accidentally mutated
mid-commit, which can cause c->writes refcount leaks.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_update.h')
-rw-r--r-- | fs/bcachefs/btree_update.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_update.h b/fs/bcachefs/btree_update.h index 9a3c859ea572..673c3a78aae2 100644 --- a/fs/bcachefs/btree_update.h +++ b/fs/bcachefs/btree_update.h @@ -80,7 +80,7 @@ int __must_check bch2_trans_update(struct btree_trans *, struct btree_iter *, void bch2_trans_commit_hook(struct btree_trans *, struct btree_trans_commit_hook *); -int __bch2_trans_commit(struct btree_trans *); +int __bch2_trans_commit(struct btree_trans *, unsigned); int bch2_trans_log_msg(struct btree_trans *, const char *, ...); int bch2_fs_log_msg(struct bch_fs *, const char *, ...); @@ -101,9 +101,8 @@ static inline int bch2_trans_commit(struct btree_trans *trans, { trans->disk_res = disk_res; trans->journal_seq = journal_seq; - trans->flags = flags; - return __bch2_trans_commit(trans); + return __bch2_trans_commit(trans, flags); } #define commit_do(_trans, _disk_res, _journal_seq, _flags, _do) \ |