diff options
author | Brian Foster <bfoster@redhat.com> | 2023-09-15 14:51:51 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:10:14 +0200 |
commit | 92b63f5bf0774eab2e62b86f85bb4efb915edef1 (patch) | |
tree | f71da33d93cb36ddbc464cb3dfae9e401f7b3fb8 /fs/bcachefs/journal.c | |
parent | bcachefs: snapshot: Add missing assignment in bch2_delete_dead_snapshots() (diff) | |
download | linux-92b63f5bf0774eab2e62b86f85bb4efb915edef1.tar.xz linux-92b63f5bf0774eab2e62b86f85bb4efb915edef1.zip |
bcachefs: refactor pin put helpers
We have a couple journal pin put helpers to handle cases where the
journal lock is already held or not. Refactor the helpers to lock
and reclaim from the highest level and open code the reclaim from
the one caller of the internal variant. The latter call will be
moved into the journal buf release helper in a later patch.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.c')
-rw-r--r-- | fs/bcachefs/journal.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index ad80618d1740..210a2b90bb50 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -204,7 +204,8 @@ static void __journal_entry_close(struct journal *j, unsigned closed_val) buf->data->last_seq = cpu_to_le64(buf->last_seq); BUG_ON(buf->last_seq > le64_to_cpu(buf->data->seq)); - __bch2_journal_pin_put(j, le64_to_cpu(buf->data->seq)); + if (__bch2_journal_pin_put(j, le64_to_cpu(buf->data->seq))) + bch2_journal_reclaim_fast(j); cancel_delayed_work(&j->write_work); |