2018-11-01 19:13:19 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _BCACHEFS_EC_TYPES_H
|
|
|
|
#define _BCACHEFS_EC_TYPES_H
|
|
|
|
|
2022-11-25 21:15:14 +00:00
|
|
|
#include "bcachefs_format.h"
|
2018-11-01 19:13:19 +00:00
|
|
|
|
2019-01-21 20:32:13 +00:00
|
|
|
struct bch_replicas_padded {
|
2023-11-09 18:52:35 +00:00
|
|
|
struct bch_replicas_entry_v1 e;
|
2020-12-16 19:23:27 +00:00
|
|
|
u8 pad[BCH_BKEY_PTRS_MAX];
|
2019-01-21 20:32:13 +00:00
|
|
|
};
|
|
|
|
|
2018-11-24 22:09:44 +00:00
|
|
|
struct stripe {
|
2018-11-01 19:13:19 +00:00
|
|
|
size_t heap_idx;
|
|
|
|
u16 sectors;
|
|
|
|
u8 algorithm;
|
|
|
|
u8 nr_blocks;
|
|
|
|
u8 nr_redundant;
|
2018-11-26 01:53:51 +00:00
|
|
|
u8 blocks_nonempty;
|
2021-12-05 04:07:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gc_stripe {
|
|
|
|
u16 sectors;
|
|
|
|
|
|
|
|
u8 nr_blocks;
|
|
|
|
u8 nr_redundant;
|
|
|
|
|
|
|
|
unsigned alive:1; /* does a corresponding key exist in stripes btree? */
|
2020-12-16 19:23:27 +00:00
|
|
|
u16 block_sectors[BCH_BKEY_PTRS_MAX];
|
2021-03-12 21:55:28 +00:00
|
|
|
struct bch_extent_ptr ptrs[BCH_BKEY_PTRS_MAX];
|
2019-01-21 20:32:13 +00:00
|
|
|
|
|
|
|
struct bch_replicas_padded r;
|
2018-11-01 19:13:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ec_stripe_heap_entry {
|
|
|
|
size_t idx;
|
|
|
|
unsigned blocks_nonempty;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef HEAP(struct ec_stripe_heap_entry) ec_stripes_heap;
|
|
|
|
|
|
|
|
#endif /* _BCACHEFS_EC_TYPES_H */
|