]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/ec_types.h
Update bcachefs sources to ffe09df106 bcachefs: Verify fs hasn't been modified before...
[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 bch_replicas_padded {
9         struct bch_replicas_entry       e;
10         u8                              pad[EC_STRIPE_MAX];
11 };
12
13 struct stripe {
14         size_t                  heap_idx;
15
16         u16                     sectors;
17         u8                      algorithm;
18
19         u8                      nr_blocks;
20         u8                      nr_redundant;
21
22         unsigned                alive:1;
23         unsigned                dirty:1;
24         u8                      blocks_nonempty;
25         u16                     block_sectors[EC_STRIPE_MAX];
26
27         struct bch_replicas_padded r;
28 };
29
30 struct ec_stripe_heap_entry {
31         size_t                  idx;
32         unsigned                blocks_nonempty;
33 };
34
35 typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
36
37 #endif /* _BCACHEFS_EC_TYPES_H */