1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_BTREE_GC_TYPES_H
3 #define _BCACHEFS_BTREE_GC_TYPES_H
4 
5 #include <linux/generic-radix-tree.h>
6 
7 #define GC_PHASES()		\
8 	x(not_running)		\
9 	x(start)		\
10 	x(sb)			\
11 	x(btree)
12 
13 enum gc_phase {
14 #define x(n)	GC_PHASE_##n,
15 	GC_PHASES()
16 #undef x
17 };
18 
19 struct gc_pos {
20 	enum gc_phase		phase:8;
21 	enum btree_id		btree:8;
22 	u16			level;
23 	struct bpos		pos;
24 };
25 
26 struct reflink_gc {
27 	u64		offset;
28 	u32		size;
29 	u32		refcount;
30 };
31 
32 typedef GENRADIX(struct reflink_gc) reflink_gc_table;
33 
34 #endif /* _BCACHEFS_BTREE_GC_TYPES_H */
35