linux/fs/bcachefs
Kent Overstreet ef337c54c6 bcachefs: Allocation code refactoring
bch2_alloc_sectors_start() was a nightmare to work with - it's got some
tricky stuff to do, since it wants to use the buckets the writepoint
already has, unless they're not in the target it wants to write to,
unless it can't allocate from any other devices in which case it will
use those buckets if it has to - et cetera.

This restructures the code to start with a new empty list of open
buckets we're going to use for the new allocation, pulling buckets from
the write point's list as we decide that we really are going to use
them - making the code somewhat more functional and drastically easier
to understand.

Also fixes a bug where we could end up waiting on c->freelist_wait
(because allocating from one device failed) but return success from
bch2_bucket_alloc(), because allocating from a different device
succeeded.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:10 -04:00
..
acl.c bcachefs: fix bch2_acl_chmod() 2023-10-22 17:08:09 -04:00
acl.h
alloc_background.c bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
alloc_background.h bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
alloc_foreground.c bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
alloc_foreground.h bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
alloc_types.h bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
bcachefs_format.h bcachefs: BCH_SB_RESERVE_BYTES 2023-10-22 17:08:08 -04:00
bcachefs_ioctl.h
bcachefs.h bcachefs: mempoolify btree_trans 2023-10-22 17:08:09 -04:00
bkey_methods.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
bkey_methods.h bcachefs: fix bch2_val_to_text() 2023-10-22 17:08:08 -04:00
bkey.c
bkey.h
bset.c bcachefs: Comparison function cleanups 2023-10-22 17:08:09 -04:00
bset.h bcachefs: Comparison function cleanups 2023-10-22 17:08:09 -04:00
btree_cache.c bcachefs: trace transaction restarts 2023-10-22 17:08:07 -04:00
btree_cache.h
btree_gc.c bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
btree_gc.h
btree_io.c bcachefs: Comparison function cleanups 2023-10-22 17:08:09 -04:00
btree_io.h bcachefs: lift ordering restriction on 0 size extents 2023-10-22 17:08:09 -04:00
btree_iter.c bcachefs: Fix a btree iter bug when iter pos == POS_MAX 2023-10-22 17:08:09 -04:00
btree_iter.h bcachefs: Pass around bset_tree less 2023-10-22 17:08:09 -04:00
btree_locking.h bcachefs: make struct btree_iter a bit smaller 2023-10-22 17:08:09 -04:00
btree_types.h bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
btree_update_interior.c bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
btree_update_interior.h bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
btree_update_leaf.c bcachefs: Pass around bset_tree less 2023-10-22 17:08:09 -04:00
btree_update.h bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
buckets_types.h bcachefs: Change how replicated data is accounted 2023-10-22 17:08:08 -04:00
buckets.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
buckets.h bcachefs: Account for internal fragmentation better 2023-10-22 17:08:08 -04:00
chardev.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
chardev.h
checksum.c
checksum.h
clock_types.h
clock.c
clock.h
compress.c
compress.h
debug.c
debug.h
dirent.c bcachefs: Dirent repair code 2023-10-22 17:08:09 -04:00
dirent.h bcachefs: Dirent repair code 2023-10-22 17:08:09 -04:00
disk_groups.c
disk_groups.h
error.c
error.h
extents_types.h
extents.c bcachefs: Pass around bset_tree less 2023-10-22 17:08:09 -04:00
extents.h bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
eytzinger.h
fifo.h bcachefs: Fix a use after free in the journal code 2023-10-22 17:08:07 -04:00
fs-io.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
fs-io.h
fs-ioctl.c bcachefs: Fix mtime/ctime updates 2023-10-22 17:08:07 -04:00
fs-ioctl.h bcachefs: Fix mtime/ctime updates 2023-10-22 17:08:07 -04:00
fs.c bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
fs.h bcachefs: Fix mtime/ctime updates 2023-10-22 17:08:07 -04:00
fsck.c bcachefs: make fsck spew less 2023-10-22 17:08:09 -04:00
fsck.h
inode.c bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
inode.h bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
io_types.h bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
io.c bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
io.h bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
journal_io.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
journal_io.h
journal_reclaim.c bcachefs: Fix a use after free in the journal code 2023-10-22 17:08:07 -04:00
journal_reclaim.h bcachefs: Fix a use after free in the journal code 2023-10-22 17:08:07 -04:00
journal_seq_blacklist.c
journal_seq_blacklist.h
journal_types.h bcachefs: Assorted journal refactoring 2023-10-22 17:08:08 -04:00
journal.c bcachefs: Allocation code refactoring 2023-10-22 17:08:10 -04:00
journal.h
Kconfig
keylist_types.h
keylist.c
keylist.h
Makefile bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
migrate.c bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
migrate.h
move_types.h
move.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
move.h
movinggc.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
movinggc.h
opts.c
opts.h bcachefs: BCH_SB_RESERVE_BYTES 2023-10-22 17:08:08 -04:00
quota_types.h
quota.c bcachefs: kill extent_insert_hook 2023-10-22 17:08:09 -04:00
quota.h bcachefs: fix bch2_val_to_text() 2023-10-22 17:08:08 -04:00
rebalance_types.h
rebalance.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
rebalance.h
recovery.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
recovery.h
replicas.c
replicas.h
siphash.c
siphash.h
six.c
six.h
str_hash.h bcachefs: bch2_trans_update() now takes struct btree_insert_entry 2023-10-22 17:08:07 -04:00
super_types.h
super-io.c
super-io.h
super.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
super.h
sysfs.c bcachefs: Split out alloc_background.c 2023-10-22 17:08:10 -04:00
sysfs.h
tests.c bcachefs: Comparison function cleanups 2023-10-22 17:08:09 -04:00
tests.h
trace.c
trace.h bcachefs: kill bucket mark sector count saturation 2023-10-22 17:08:08 -04:00
util.c bcachefs: Fix suspend when moving data faster than ratelimit 2023-10-22 17:08:10 -04:00
util.h bcachefs: Fix suspend when moving data faster than ratelimit 2023-10-22 17:08:10 -04:00
vstructs.h
xattr.c bcachefs: fix bch2_val_to_text() 2023-10-22 17:08:08 -04:00
xattr.h bcachefs: fix bch2_val_to_text() 2023-10-22 17:08:08 -04:00