bcachefs: Improved nocow locking
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 15 Dec 2022 01:52:11 +0000 (20:52 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:52 +0000 (17:09 -0400)
commit350175bf9b0fe5da12a2fd8bfd453a49f038ceb4
tree6118c2363f0ee7570b8d9ac6440b13217b8c322e
parentf3a37e76cade1469871c4309584ebbc358becf40
bcachefs: Improved nocow locking

This improves the nocow lock table so that hash table entries have
multiple locks, and locks specify which bucket they're for - i.e. we can
now resolve hash collisions.

This is important because the allocator has to skip buckets that are
locked in the nocow lock table, and previously hash collisions would
cause it to spuriously skip unlocked buckets.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.h
fs/bcachefs/alloc_foreground.c
fs/bcachefs/bcachefs.h
fs/bcachefs/data_update.c
fs/bcachefs/io.c
fs/bcachefs/nocow_locking.c
fs/bcachefs/nocow_locking.h
fs/bcachefs/nocow_locking_types.h [new file with mode: 0644]
fs/bcachefs/super.c
fs/bcachefs/sysfs.c