]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Allow existing stripes to be updated with new data buckets
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 30 Jun 2020 18:44:19 +0000 (14:44 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:42 +0000 (17:08 -0400)
commit0ba95acc4499c84156144316dfb08d68930cc1a9
tree903824401ad3ef0311234331d3aa4d5e7ce96f2b
parentf6b94a3baa956ff10a52a545a9ad60f35e88e683
bcachefs: Allow existing stripes to be updated with new data buckets

This solves internal fragmentation within stripes. We already have
copygc, which evacuates buckets that are partially or mostly empty, but
it's up to the ec code that manages stripes to deal with stripes that
have empty buckets in them.

This patch changes the path for creating new stripes to check if there's
existing stripes with empty buckets - and if so, update them with new
data buckets instead of creating new stripes.

TODO: improve the disk space accounting so that we can only use this
(more expensive path) when we have too much fragmentation in existing
stripes.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c
fs/bcachefs/ec.h