1 #ifndef _BCACHEFS_JOURNAL_RECLAIM_H
2 #define _BCACHEFS_JOURNAL_RECLAIM_H
4 #define JOURNAL_PIN (32 * 1024)
6 unsigned bch2_journal_dev_buckets_available(struct journal *,
7 struct journal_device *);
8 void bch2_journal_space_available(struct journal *);
10 static inline bool journal_pin_active(struct journal_entry_pin *pin)
15 static inline struct journal_entry_pin_list *
16 journal_seq_pin(struct journal *j, u64 seq)
18 EBUG_ON(seq < j->pin.front || seq >= j->pin.back);
20 return &j->pin.data[seq & j->pin.mask];
23 void bch2_journal_pin_put(struct journal *, u64);
25 void bch2_journal_pin_add(struct journal *, u64, struct journal_entry_pin *,
26 journal_pin_flush_fn);
27 void bch2_journal_pin_update(struct journal *, u64, struct journal_entry_pin *,
28 journal_pin_flush_fn);
29 void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *);
30 void bch2_journal_pin_add_if_older(struct journal *,
31 struct journal_entry_pin *,
32 struct journal_entry_pin *,
33 journal_pin_flush_fn);
34 void bch2_journal_pin_flush(struct journal *, struct journal_entry_pin *);
36 void bch2_journal_reclaim_work(struct work_struct *);
38 void bch2_journal_flush_pins(struct journal *, u64);
40 static inline void bch2_journal_flush_all_pins(struct journal *j)
42 bch2_journal_flush_pins(j, U64_MAX);
45 int bch2_journal_flush_device_pins(struct journal *, int);
47 #endif /* _BCACHEFS_JOURNAL_RECLAIM_H */