six locks: Simplify wait lists
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 25 Aug 2022 14:49:52 +0000 (10:49 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:40 +0000 (17:09 -0400)
commitebc6f76a667f5fc599a5f76515f6881dfb82af2f
tree24bb2c72eda0ee8bca9ea831eefda0a2a6ed01e9
parent098ef98d5bff461c66c3798fbebca7b1c06fdf79
six locks: Simplify wait lists

This switches to a single list of waiters, instead of separate lists for
read and intent, and switches write locks to also use the wait lists
instead of being handled differently.

Also, removal from the wait list is now done by the process waiting on
the lock, not the process doing the wakeup. This is needed for the new
deadlock cycle detector - we need tasks to stay on the waitlist until
they've successfully acquired the lock.

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