diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-26 05:21:46 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:20 +0300 |
commit | abe19d458e8fffbebacaad3aad64604d2819913a (patch) | |
tree | 7fe90d8c2fd6044ec794c556654c0fe0c3404c71 /fs/bcachefs/alloc_types.h | |
parent | 57af63b286a532f425e425c0684eda6fb5f7c284 (diff) | |
download | linux-abe19d458e8fffbebacaad3aad64604d2819913a.tar.xz |
bcachefs: Refactor open_bucket code
Prep work for adding a hash table of open buckets - instead of embedding
a bch_extent_ptr, we need to refer to the bucket directly so that we're
not calling sector_to_bucket() in the hash table lookup code, which has
an expensive divide.
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 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/bcachefs/alloc_types.h b/fs/bcachefs/alloc_types.h index 4a1cd8b73d16..bd173c7c334b 100644 --- a/fs/bcachefs/alloc_types.h +++ b/fs/bcachefs/alloc_types.h @@ -49,12 +49,15 @@ struct open_bucket { * the block in the stripe this open_bucket corresponds to: */ u8 ec_idx; - u8 type; + enum bch_data_type data_type:3; unsigned valid:1; unsigned on_partial_list:1; int alloc_reserve:3; + unsigned sectors_free; - struct bch_extent_ptr ptr; + u8 dev; + u8 gen; + u64 bucket; struct ec_stripe_new *ec; }; @@ -74,7 +77,7 @@ struct write_point { struct mutex lock; u64 last_used; unsigned long write_point; - enum bch_data_type type; + enum bch_data_type data_type; /* calculated based on how many pointers we're actually going to use: */ unsigned sectors_free; |