diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-26 05:43:29 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:20 +0300 |
commit | 9ddffaf83b5ac7cf79917cfe9a1435cc07d071b6 (patch) | |
tree | 1272deac11ba66146fe35a131a127724034e4e6e /fs/bcachefs/alloc_types.h | |
parent | abe19d458e8fffbebacaad3aad64604d2819913a (diff) | |
download | linux-9ddffaf83b5ac7cf79917cfe9a1435cc07d071b6.tar.xz |
bcachefs: Put open_buckets in a hashtable
This is so that the copygc code doesn't have to refer to
bucket_mark.owned_by_allocator - assisting in getting rid of the in
memory bucket array.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/alloc_types.h')
-rw-r--r-- | fs/bcachefs/alloc_types.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/alloc_types.h b/fs/bcachefs/alloc_types.h index bd173c7c334b..409232e3d998 100644 --- a/fs/bcachefs/alloc_types.h +++ b/fs/bcachefs/alloc_types.h @@ -37,12 +37,16 @@ typedef FIFO(long) alloc_fifo; #define WRITE_POINT_HASH_NR 32 #define WRITE_POINT_MAX 32 +/* + * 0 is never a valid open_bucket_idx_t: + */ typedef u16 open_bucket_idx_t; struct open_bucket { spinlock_t lock; atomic_t pin; open_bucket_idx_t freelist; + open_bucket_idx_t hash; /* * When an open bucket has an ec_stripe attached, this is the index of |