summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_reclaim.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-02-27 15:03:44 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:36 -0400
commit3f58a19763d9c4c09ec27152865bc892aa53410a (patch)
treed075979df14f551b756f8e1e055399884a382165 /fs/bcachefs/journal_reclaim.h
parent883f1a7ce05f5f723ce5b47b9d9b796b53b3692a (diff)
downloadlwn-3f58a19763d9c4c09ec27152865bc892aa53410a.tar.gz
lwn-3f58a19763d9c4c09ec27152865bc892aa53410a.zip
bcachefs: Journal pin cleanups
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.h')
-rw-r--r--fs/bcachefs/journal_reclaim.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/bcachefs/journal_reclaim.h b/fs/bcachefs/journal_reclaim.h
index 9bf982a17797..883a0a5680af 100644
--- a/fs/bcachefs/journal_reclaim.h
+++ b/fs/bcachefs/journal_reclaim.h
@@ -29,16 +29,24 @@ journal_seq_pin(struct journal *j, u64 seq)
}
void bch2_journal_pin_put(struct journal *, u64);
-
-void bch2_journal_pin_add(struct journal *, u64, struct journal_entry_pin *,
- journal_pin_flush_fn);
-void bch2_journal_pin_update(struct journal *, u64, struct journal_entry_pin *,
- journal_pin_flush_fn);
void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *);
-void bch2_journal_pin_add_if_older(struct journal *,
- struct journal_entry_pin *,
- struct journal_entry_pin *,
- journal_pin_flush_fn);
+
+void __bch2_journal_pin_add(struct journal *, u64, struct journal_entry_pin *,
+ journal_pin_flush_fn);
+
+static inline void bch2_journal_pin_add(struct journal *j, u64 seq,
+ struct journal_entry_pin *pin,
+ journal_pin_flush_fn flush_fn)
+{
+ if (unlikely(!journal_pin_active(pin)))
+ __bch2_journal_pin_add(j, seq, pin, flush_fn);
+}
+
+void bch2_journal_pin_copy(struct journal *,
+ struct journal_entry_pin *,
+ struct journal_entry_pin *,
+ journal_pin_flush_fn);
+
void bch2_journal_pin_flush(struct journal *, struct journal_entry_pin *);
void bch2_journal_do_discards(struct journal *);