diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-03 03:32:19 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 19:47:39 +0300 |
commit | d3083cf28d54991c299d5c05790e40e52cf75df0 (patch) | |
tree | 1719a4a179082c467711fba699294b0ae13b40a5 /fs/bcachefs/btree_trans_commit.c | |
parent | 183bcc89b855c412bfefa545b799006d66f689a6 (diff) | |
download | linux-d3083cf28d54991c299d5c05790e40e52cf75df0.tar.xz |
bcachefs: bch2_btree_write_buffer_flush_locked()
Minor refactoring - improved naming, and move the responsibility for
flush_lock to the caller instead of having it be shared.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
-rw-r--r-- | fs/bcachefs/btree_trans_commit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index a2d0494b58f4..336350bd9048 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -961,7 +961,8 @@ 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, true); + ret = bch2_btree_write_buffer_flush_locked(trans); + mutex_unlock(&wb->flush_lock); 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); @@ -1076,7 +1077,8 @@ 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, true); + ret = bch2_btree_write_buffer_flush_locked(trans); + mutex_unlock(&c->btree_write_buffer.flush_lock); 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); |