diff options
| author | Kent Overstreet <[email protected]> | 2023-11-02 23:37:15 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2024-01-01 16:47:39 +0000 |
| commit | 183bcc89b855c412bfefa545b799006d66f689a6 (patch) | |
| tree | 5f639310d3f967cc5f938d56f2a0f59382f07210 /fs/bcachefs/btree_trans_commit.c | |
| parent | bcachefs: delete useless commit_do() (diff) | |
| download | kernel-183bcc89b855c412bfefa545b799006d66f689a6.tar.gz kernel-183bcc89b855c412bfefa545b799006d66f689a6.zip | |
bcachefs: Clean up btree write buffer write ref handling
__bch2_btree_write_buffer_flush() now assumes a write ref is already
held (as called by the transaction commit path); and the wrappers
bch2_write_buffer_flush() and flush_sync() take an explicit write ref.
This means internally the write buffer code can always use
BTREE_INSERT_NOCHECK_RW, instead of in the previous code passing flags
around and hoping the NOCHECK_RW flag was always carried around
correctly.
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 | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index 578521216b6a..a2d0494b58f4 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -961,8 +961,7 @@ int bch2_trans_commit_error(struct btree_trans *trans, unsigned flags, if (wb->state.nr > wb->size * 3 / 4) { bch2_trans_begin(trans); - ret = __bch2_btree_write_buffer_flush(trans, - flags|BCH_TRANS_COMMIT_no_check_rw, true); + ret = __bch2_btree_write_buffer_flush(trans, true); if (!ret) { trace_and_count(c, trans_restart_write_buffer_flush, trans, _THIS_IP_); ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_write_buffer_flush); @@ -1077,8 +1076,7 @@ int __bch2_trans_commit(struct btree_trans *trans, unsigned flags) bch2_trans_begin(trans); bch2_trans_unlock(trans); - ret = __bch2_btree_write_buffer_flush(trans, - flags|BCH_TRANS_COMMIT_no_check_rw, true); + ret = __bch2_btree_write_buffer_flush(trans, true); if (!ret) { trace_and_count(c, trans_restart_write_buffer_flush, trans, _THIS_IP_); ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_write_buffer_flush); |
