summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec_types.h
blob: feb360101ecbd02c5d999dc87be592b26106c118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _BCACHEFS_EC_TYPES_H
#define _BCACHEFS_EC_TYPES_H

#include <linux/llist.h>

#define EC_STRIPE_MAX	16

struct ec_stripe {
	size_t			heap_idx;

	u16			sectors;
	u8			algorithm;

	u8			nr_blocks;
	u8			nr_redundant;

	u8			alive;
	atomic_t		pin;
	atomic_t		blocks_nonempty;
	atomic_t		block_sectors[EC_STRIPE_MAX];
};

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 */