bcachefs: Clean up btree write buffer write ref handling
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 2 Nov 2023 23:37:15 +0000 (19:37 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:39 +0000 (11:47 -0500)
commit183bcc89b855c412bfefa545b799006d66f689a6
tree5f639310d3f967cc5f938d56f2a0f59382f07210
parentcf5bacb6a5213cd7f59c1dbf11531ff96445027a
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 <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_trans_commit.c
fs/bcachefs/btree_write_buffer.c
fs/bcachefs/btree_write_buffer.h
fs/bcachefs/ec.c
fs/bcachefs/inode.c
fs/bcachefs/movinggc.c