]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/ec_types.h
Update bcachefs sources to b91a514413 bcachefs: Don't try to delete stripes when RO
[bcachefs-tools-debian] / libbcachefs / ec_types.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_EC_TYPES_H
3 #define _BCACHEFS_EC_TYPES_H
4
5 #include <linux/llist.h>
6
7 #define EC_STRIPE_MAX   16
8
9 struct bch_replicas_padded {
10         struct bch_replicas_entry       e;
11         u8                              pad[EC_STRIPE_MAX];
12 };
13
14 struct stripe {
15         size_t                  heap_idx;
16
17         u16                     sectors;
18         u8                      algorithm;
19
20         u8                      nr_blocks;
21         u8                      nr_redundant;
22
23         unsigned                alive:1;
24         unsigned                dirty:1;
25         u8                      blocks_nonempty;
26         u16                     block_sectors[EC_STRIPE_MAX];
27
28         struct bch_replicas_padded r;
29 };
30
31 struct ec_stripe_heap_entry {
32         size_t                  idx;
33         unsigned                blocks_nonempty;
34 };
35
36 typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
37
38 #endif /* _BCACHEFS_EC_TYPES_H */