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 union bch_replicas_padded {
8 	u8				bytes[struct_size_t(struct bch_replicas_entry_v1,
9 							    devs, BCH_BKEY_PTRS_MAX)];
10 	struct bch_replicas_entry_v1	e;
11 };
12 
13 struct stripe {
14 	size_t			heap_idx;
15 	u16			sectors;
16 	u8			algorithm;
17 	u8			nr_blocks;
18 	u8			nr_redundant;
19 	u8			blocks_nonempty;
20 	u8			disk_label;
21 };
22 
23 struct gc_stripe {
24 	u8			lock;
25 	unsigned		alive:1; /* does a corresponding key exist in stripes btree? */
26 	u16			sectors;
27 	u8			nr_blocks;
28 	u8			nr_redundant;
29 	u16			block_sectors[BCH_BKEY_PTRS_MAX];
30 	struct bch_extent_ptr	ptrs[BCH_BKEY_PTRS_MAX];
31 
32 	union bch_replicas_padded r;
33 };
34 
35 #endif /* _BCACHEFS_EC_TYPES_H */
36