1 #ifndef _BCACHEFS_JOURNAL_IO_H
2 #define _BCACHEFS_JOURNAL_IO_H
5 * Only used for holding the journal entries we read in btree_journal_read()
6 * during cache_registration
8 struct journal_replay {
10 struct bch_devs_list devs;
15 static inline struct jset_entry *__jset_entry_type_next(struct jset *jset,
16 struct jset_entry *entry, unsigned type)
18 while (entry < vstruct_last(jset)) {
19 if (entry->type == type)
22 entry = vstruct_next(entry);
28 #define for_each_jset_entry_type(entry, jset, type) \
29 for (entry = (jset)->start; \
30 (entry = __jset_entry_type_next(jset, entry, type)); \
31 entry = vstruct_next(entry))
33 #define for_each_jset_key(k, _n, entry, jset) \
34 for_each_jset_entry_type(entry, jset, BCH_JSET_ENTRY_btree_keys) \
35 vstruct_for_each_safe(entry, k, _n)
37 int bch2_journal_set_seq(struct bch_fs *c, u64, u64);
38 int bch2_journal_read(struct bch_fs *, struct list_head *);
39 void bch2_journal_entries_free(struct list_head *);
40 int bch2_journal_replay(struct bch_fs *, struct list_head *);
42 int bch2_journal_entry_sectors(struct journal *);
43 void bch2_journal_write(struct closure *);
45 #endif /* _BCACHEFS_JOURNAL_IO_H */