bcachefs: Simplify hash table checks
[linux-block.git] / fs / bcachefs / journal_seq_blacklist.h
CommitLineData
1c6fdbd8
KO
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _BCACHEFS_JOURNAL_SEQ_BLACKLIST_H
3#define _BCACHEFS_JOURNAL_SEQ_BLACKLIST_H
4
9f115ce9
KO
5static inline unsigned
6blacklist_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
1dd7f9d9
KO
14bool bch2_journal_seq_is_blacklisted(struct bch_fs *, u64, bool);
15int bch2_journal_seq_blacklist_add(struct bch_fs *c, u64, u64);
16int bch2_blacklist_table_initialize(struct bch_fs *);
17
18extern const struct bch_sb_field_ops bch_sb_field_ops_journal_seq_blacklist;
19
20void bch2_blacklist_entries_gc(struct work_struct *);
1c6fdbd8
KO
21
22#endif /* _BCACHEFS_JOURNAL_SEQ_BLACKLIST_H */