]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/ec_types.h
Update bcachefs sources to dab31ca168 bcachefs: Add some logging for btree node rewri...
[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 "bcachefs_format.h"
6
7 struct bch_replicas_padded {
8         struct bch_replicas_entry       e;
9         u8                              pad[BCH_BKEY_PTRS_MAX];
10 };
11
12 struct stripe {
13         size_t                  heap_idx;
14
15         u16                     sectors;
16         u8                      algorithm;
17
18         u8                      nr_blocks;
19         u8                      nr_redundant;
20
21         unsigned                alive:1; /* does a corresponding key exist in stripes btree? */
22         unsigned                on_heap:1;
23         u8                      blocks_nonempty;
24 };
25
26 struct gc_stripe {
27         u16                     sectors;
28
29         u8                      nr_blocks;
30         u8                      nr_redundant;
31
32         unsigned                alive:1; /* does a corresponding key exist in stripes btree? */
33         u16                     block_sectors[BCH_BKEY_PTRS_MAX];
34         struct bch_extent_ptr   ptrs[BCH_BKEY_PTRS_MAX];
35
36         struct bch_replicas_padded r;
37 };
38
39 struct ec_stripe_heap_entry {
40         size_t                  idx;
41         unsigned                blocks_nonempty;
42 };
43
44 typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
45
46 #endif /* _BCACHEFS_EC_TYPES_H */