1 #ifndef _BCACHEFS_JOURNAL_RECLAIM_H
2 #define _BCACHEFS_JOURNAL_RECLAIM_H
4 #define JOURNAL_PIN (32 * 1024)
6 static inline bool journal_pin_active(struct journal_entry_pin *pin)
8 return pin->pin_list != NULL;
11 static inline struct journal_entry_pin_list *
12 journal_seq_pin(struct journal *j, u64 seq)
14 BUG_ON(seq < j->pin.front || seq >= j->pin.back);
16 return &j->pin.data[seq & j->pin.mask];
19 u64 bch2_journal_pin_seq(struct journal *, struct journal_entry_pin *);
21 void bch2_journal_pin_add(struct journal *, u64, struct journal_entry_pin *,
22 journal_pin_flush_fn);
23 void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *);
24 void bch2_journal_pin_add_if_older(struct journal *,
25 struct journal_entry_pin *,
26 struct journal_entry_pin *,
27 journal_pin_flush_fn);
29 void bch2_journal_reclaim_fast(struct journal *);
30 void bch2_journal_reclaim_work(struct work_struct *);
32 int bch2_journal_flush_pins(struct journal *, u64);
33 int bch2_journal_flush_all_pins(struct journal *);
34 int bch2_journal_flush_device_pins(struct journal *, int);
36 #endif /* _BCACHEFS_JOURNAL_RECLAIM_H */