From f25d8215f499418c17dfde0b3158a66e03c758dc Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 9 Jan 2022 20:48:31 -0500 Subject: bcachefs: Kill allocator threads & freelists Now that we have new persistent data structures for the allocator, this patch converts the allocator to use them. Now, foreground bucket allocation uses the freespace btree to find buckets to allocate, instead of popping buckets off the freelist. The background allocator threads are no longer needed and are deleted, as well as the allocator freelists. Now we only need background tasks for invalidating buckets containing cached data (when we are low on empty buckets), and for issuing discards. Signed-off-by: Kent Overstreet --- fs/bcachefs/alloc_foreground.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'fs/bcachefs/alloc_foreground.h') diff --git a/fs/bcachefs/alloc_foreground.h b/fs/bcachefs/alloc_foreground.h index efb6d155bd00..12583a7e7aa3 100644 --- a/fs/bcachefs/alloc_foreground.h +++ b/fs/bcachefs/alloc_foreground.h @@ -14,6 +14,8 @@ struct bch_devs_List; extern const char * const bch2_alloc_reserves[]; +void bch2_reset_alloc_cursors(struct bch_fs *); + struct dev_alloc_list { unsigned nr; u8 devs[BCH_SB_MEMBERS_MAX]; @@ -136,6 +138,15 @@ int bch2_bucket_alloc_set(struct bch_fs *, struct open_buckets *, unsigned, unsigned *, bool *, enum alloc_reserve, unsigned, struct closure *); +int bch2_alloc_sectors_start_trans(struct btree_trans *, + unsigned, unsigned, + struct write_point_specifier, + struct bch_devs_list *, + unsigned, unsigned, + enum alloc_reserve, + unsigned, + struct closure *, + struct write_point **); int bch2_alloc_sectors_start(struct bch_fs *, unsigned, unsigned, struct write_point_specifier, -- cgit v1.2.3