diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-11 17:13:09 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:29 -0400 |
commit | c6b2826cd14c5421bc50a768e923d078a71139c1 (patch) | |
tree | 7a914ef8a811c4330a42ee397c852ff1c7d6a04d /fs/bcachefs/bkey_methods.c | |
parent | 3d48a7f85f83a51a0eb0d0a6537be26a20691260 (diff) | |
download | linux-c6b2826cd14c5421bc50a768e923d078a71139c1.tar.gz linux-c6b2826cd14c5421bc50a768e923d078a71139c1.tar.bz2 linux-c6b2826cd14c5421bc50a768e923d078a71139c1.zip |
bcachefs: Freespace, need_discard btrees
This adds two new btrees for the upcoming allocator rewrite: an extents
btree of free buckets, and a btree for buckets awaiting discards.
We also add a new trigger for alloc keys to keep the new btrees up to
date, and a compatibility path to initialize them on existing
filesystems.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_methods.c')
-rw-r--r-- | fs/bcachefs/bkey_methods.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c index 62774e4f6dbb..9a1819147749 100644 --- a/fs/bcachefs/bkey_methods.c +++ b/fs/bcachefs/bkey_methods.c @@ -170,6 +170,12 @@ static unsigned bch2_key_types_allowed[] = { [BKEY_TYPE_lru] = (1U << KEY_TYPE_deleted)| (1U << KEY_TYPE_lru), + [BKEY_TYPE_freespace] = + (1U << KEY_TYPE_deleted)| + (1U << KEY_TYPE_set), + [BKEY_TYPE_need_discard] = + (1U << KEY_TYPE_deleted)| + (1U << KEY_TYPE_set), [BKEY_TYPE_btree] = (1U << KEY_TYPE_deleted)| (1U << KEY_TYPE_btree_ptr)| |