2018-11-01 19:13:19 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _BCACHEFS_EC_TYPES_H
|
|
|
|
#define _BCACHEFS_EC_TYPES_H
|
|
|
|
|
|
|
|
#include <linux/llist.h>
|
|
|
|
|
|
|
|
#define EC_STRIPE_MAX 16
|
|
|
|
|
2019-01-21 20:32:13 +00:00
|
|
|
struct bch_replicas_padded {
|
|
|
|
struct bch_replicas_entry e;
|
|
|
|
u8 pad[EC_STRIPE_MAX];
|
|
|
|
};
|
|
|
|
|
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
|
|
|
unsigned alive:1;
|
|
|
|
unsigned dirty:1;
|
2020-07-07 00:18:13 +00:00
|
|
|
unsigned on_heap:1;
|
2018-11-26 01:53:51 +00:00
|
|
|
u8 blocks_nonempty;
|
|
|
|
u16 block_sectors[EC_STRIPE_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 */
|