]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/ec_types.h
Merge pull request #38 from jnsaff/patch-1
[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         unsigned                on_heap:1;
26         u8                      blocks_nonempty;
27         u16                     block_sectors[EC_STRIPE_MAX];
28
29         struct bch_replicas_padded r;
30 };
31
32 struct ec_stripe_heap_entry {
33         size_t                  idx;
34         unsigned                blocks_nonempty;
35 };
36
37 typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
38
39 #endif /* _BCACHEFS_EC_TYPES_H */