]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/journal_reclaim.h
Update bcachefs sources to ed4aea2ad4 bcachefs: fix gcc warning
[bcachefs-tools-debian] / libbcachefs / journal_reclaim.h
1 #ifndef _BCACHEFS_JOURNAL_RECLAIM_H
2 #define _BCACHEFS_JOURNAL_RECLAIM_H
3
4 #define JOURNAL_PIN     (32 * 1024)
5
6 static inline bool journal_pin_active(struct journal_entry_pin *pin)
7 {
8         return pin->pin_list != NULL;
9 }
10
11 static inline struct journal_entry_pin_list *
12 journal_seq_pin(struct journal *j, u64 seq)
13 {
14         BUG_ON(seq < j->pin.front || seq >= j->pin.back);
15
16         return &j->pin.data[seq & j->pin.mask];
17 }
18
19 u64 bch2_journal_pin_seq(struct journal *, struct journal_entry_pin *);
20
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);
28
29 void bch2_journal_reclaim_fast(struct journal *);
30 void bch2_journal_reclaim_work(struct work_struct *);
31
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);
35
36 #endif /* _BCACHEFS_JOURNAL_RECLAIM_H */