diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-09 13:19:00 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:37 -0500 |
commit | 3eedfe1af9beb6c65eca1080298086e6e0031428 (patch) | |
tree | c99f08b463fd51923f4bf052d369d2c08e11f78e /fs/bcachefs/btree_write_buffer.c | |
parent | df8e13ccf3c0cc2b16e931f71ef69834db71eda9 (diff) | |
download | linux-3eedfe1af9beb6c65eca1080298086e6e0031428.tar.gz linux-3eedfe1af9beb6c65eca1080298086e6e0031428.tar.bz2 linux-3eedfe1af9beb6c65eca1080298086e6e0031428.zip |
bcachefs: Journal pins must always have a flush_fn
flush_fn is how we identify journal pins in debugfs - this is a
debugging aid.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_write_buffer.c')
-rw-r--r-- | fs/bcachefs/btree_write_buffer.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/bcachefs/btree_write_buffer.c b/fs/bcachefs/btree_write_buffer.c index 4e6241db518b..9609eb18f38d 100644 --- a/fs/bcachefs/btree_write_buffer.c +++ b/fs/bcachefs/btree_write_buffer.c @@ -11,6 +11,9 @@ #include <linux/sort.h> +static int bch2_btree_write_buffer_journal_flush(struct journal *, + struct journal_entry_pin *, u64); + static int btree_write_buffered_key_cmp(const void *_l, const void *_r) { const struct btree_write_buffered_key *l = _l; @@ -150,7 +153,8 @@ int __bch2_btree_write_buffer_flush(struct btree_trans *trans, unsigned commit_f if (!locked && !mutex_trylock(&wb->flush_lock)) return 0; - bch2_journal_pin_copy(j, &pin, &wb->journal_pin, NULL); + bch2_journal_pin_copy(j, &pin, &wb->journal_pin, + bch2_btree_write_buffer_journal_flush); bch2_journal_pin_drop(j, &wb->journal_pin); s = btree_write_buffer_switch(wb); @@ -252,16 +256,8 @@ slowpath: if (!i->journal_seq) continue; - if (i->journal_seq > pin.seq) { - struct journal_entry_pin pin2; - - memset(&pin2, 0, sizeof(pin2)); - - bch2_journal_pin_add(j, i->journal_seq, &pin2, NULL); - bch2_journal_pin_drop(j, &pin); - bch2_journal_pin_copy(j, &pin, &pin2, NULL); - bch2_journal_pin_drop(j, &pin2); - } + bch2_journal_pin_update(j, i->journal_seq, &pin, + bch2_btree_write_buffer_journal_flush); ret = commit_do(trans, NULL, NULL, commit_flags| |