2019-07-10 23:12:15 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2018-11-23 11:04:34 +03:00
|
|
|
#ifndef _BCACHEFS_EC_TYPES_H
|
|
|
|
#define _BCACHEFS_EC_TYPES_H
|
|
|
|
|
2022-11-27 01:09:59 +03:00
|
|
|
#include "bcachefs_format.h"
|
2018-11-23 11:04:34 +03:00
|
|
|
|
2019-01-14 04:36:38 +03:00
|
|
|
struct bch_replicas_padded {
|
2023-11-21 03:33:52 +03:00
|
|
|
struct bch_replicas_entry_v1 e;
|
2020-12-20 02:05:09 +03:00
|
|
|
u8 pad[BCH_BKEY_PTRS_MAX];
|
2019-01-14 04:36:38 +03:00
|
|
|
};
|
|
|
|
|
2018-11-30 20:38:54 +03:00
|
|
|
struct stripe {
|
2018-11-23 11:04:34 +03:00
|
|
|
size_t heap_idx;
|
|
|
|
u16 sectors;
|
|
|
|
u8 algorithm;
|
|
|
|
u8 nr_blocks;
|
|
|
|
u8 nr_redundant;
|
2019-01-23 23:49:44 +03:00
|
|
|
u8 blocks_nonempty;
|
2024-09-08 04:01:09 +03:00
|
|
|
u8 disk_label;
|
2021-12-10 21:32:35 +03: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-20 02:05:09 +03:00
|
|
|
u16 block_sectors[BCH_BKEY_PTRS_MAX];
|
2021-03-13 00:56:43 +03:00
|
|
|
struct bch_extent_ptr ptrs[BCH_BKEY_PTRS_MAX];
|
2019-01-14 04:36:38 +03:00
|
|
|
|
|
|
|
struct bch_replicas_padded r;
|
2018-11-23 11:04:34 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ec_stripe_heap_entry {
|
|
|
|
size_t idx;
|
|
|
|
unsigned blocks_nonempty;
|
|
|
|
};
|
|
|
|
|
2024-08-08 18:42:15 +03:00
|
|
|
typedef DEFINE_MIN_HEAP(struct ec_stripe_heap_entry, ec_stripes_heap) ec_stripes_heap;
|
2018-11-23 11:04:34 +03:00
|
|
|
|
|
|
|
#endif /* _BCACHEFS_EC_TYPES_H */
|