xref: /linux/fs/bcachefs/journal_seq_blacklist.h (revision 249ebf3f65f8530beb2cbfb91bff1d83ba88d23c)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_JOURNAL_SEQ_BLACKLIST_H
3 #define _BCACHEFS_JOURNAL_SEQ_BLACKLIST_H
4 
5 static inline unsigned
6 blacklist_nr_entries(struct bch_sb_field_journal_seq_blacklist *bl)
7 {
8 	return bl
9 		? ((vstruct_end(&bl->field) - (void *) &bl->start[0]) /
10 		   sizeof(struct journal_seq_blacklist_entry))
11 		: 0;
12 }
13 
14 bool bch2_journal_seq_is_blacklisted(struct bch_fs *, u64, bool);
15 int bch2_journal_seq_blacklist_add(struct bch_fs *c, u64, u64);
16 int bch2_blacklist_table_initialize(struct bch_fs *);
17 
18 extern const struct bch_sb_field_ops bch_sb_field_ops_journal_seq_blacklist;
19 
20 bool bch2_blacklist_entries_gc(struct bch_fs *);
21 
22 #endif /* _BCACHEFS_JOURNAL_SEQ_BLACKLIST_H */
23