]> git.sesse.net Git - bcachefs-tools-debian/blob - c_src/libbcachefs/ec_types.h
rust: bump rpassword to v7.x
[bcachefs-tools-debian] / c_src / 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_v1    e;
9         u8                              pad[BCH_BKEY_PTRS_MAX];
10 };
11
12 struct stripe {
13         size_t                  heap_idx;
14         u16                     sectors;
15         u8                      algorithm;
16         u8                      nr_blocks;
17         u8                      nr_redundant;
18         u8                      blocks_nonempty;
19 };
20
21 struct gc_stripe {
22         u16                     sectors;
23
24         u8                      nr_blocks;
25         u8                      nr_redundant;
26
27         unsigned                alive:1; /* does a corresponding key exist in stripes btree? */
28         u16                     block_sectors[BCH_BKEY_PTRS_MAX];
29         struct bch_extent_ptr   ptrs[BCH_BKEY_PTRS_MAX];
30
31         struct bch_replicas_padded r;
32 };
33
34 struct ec_stripe_heap_entry {
35         size_t                  idx;
36         unsigned                blocks_nonempty;
37 };
38
39 typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
40
41 #endif /* _BCACHEFS_EC_TYPES_H */