]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/ec_types.h
Update bcachefs sources to da7fefde29 bcachefs: shim for userspace raid library
[bcachefs-tools-debian] / libbcachefs / ec_types.h
1 #ifndef _BCACHEFS_EC_TYPES_H
2 #define _BCACHEFS_EC_TYPES_H
3
4 #include <linux/llist.h>
5
6 #define EC_STRIPE_MAX   16
7
8 struct ec_stripe {
9         size_t                  heap_idx;
10
11         u16                     sectors;
12         u8                      algorithm;
13
14         u8                      nr_blocks;
15         u8                      nr_redundant;
16
17         u8                      alive;
18         atomic_t                pin;
19         atomic_t                blocks_nonempty;
20         atomic_t                block_sectors[EC_STRIPE_MAX];
21 };
22
23 struct ec_stripe_heap_entry {
24         size_t                  idx;
25         unsigned                blocks_nonempty;
26 };
27
28 typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
29
30 #endif /* _BCACHEFS_EC_TYPES_H */