diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-13 19:31:45 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-15 16:27:19 -0400 |
commit | 05408b6f8fea54bf53e68a4ef24291214970f6d0 (patch) | |
tree | 2725db5979ad1f63314967741305ab0301c1f6d3 /libbcachefs/alloc_types.h | |
parent | c32bba1325cebd27e4dd3697a4b41ff0df59614f (diff) |
Update bcachefs sources to 4837f82ee1 bcachefs: Use cached iterators for alloc btree
Diffstat (limited to 'libbcachefs/alloc_types.h')
-rw-r--r-- | libbcachefs/alloc_types.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libbcachefs/alloc_types.h b/libbcachefs/alloc_types.h index 832568dc..4f146507 100644 --- a/libbcachefs/alloc_types.h +++ b/libbcachefs/alloc_types.h @@ -46,16 +46,22 @@ enum alloc_reserve { typedef FIFO(long) alloc_fifo; -/* Enough for 16 cache devices, 2 tiers and some left over for pipelining */ -#define OPEN_BUCKETS_COUNT 256 +#define OPEN_BUCKETS_COUNT 1024 #define WRITE_POINT_HASH_NR 32 #define WRITE_POINT_MAX 32 +typedef u16 open_bucket_idx_t; + struct open_bucket { spinlock_t lock; atomic_t pin; - u8 freelist; + open_bucket_idx_t freelist; + + /* + * When an open bucket has an ec_stripe attached, this is the index of + * the block in the stripe this open_bucket corresponds to: + */ u8 ec_idx; u8 type; unsigned valid:1; @@ -68,8 +74,8 @@ struct open_bucket { #define OPEN_BUCKET_LIST_MAX 15 struct open_buckets { - u8 nr; - u8 v[OPEN_BUCKET_LIST_MAX]; + open_bucket_idx_t nr; + open_bucket_idx_t v[OPEN_BUCKET_LIST_MAX]; }; struct dev_stripe_state { |