bcachefs: Change bucket_lock() to use bit_spin_lock()
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 14 Sep 2023 00:33:06 +0000 (20:33 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:14 +0000 (17:10 -0400)
commit8c2d82a6fe6fa0e3503c56c08d7fc599d66e2b79
tree5d5cf0a0dae12a6066cbbf34d94ed7e5283c654c
parent439c172bc763fc1ef33246a0fb23920c1e01ffa7
bcachefs: Change bucket_lock() to use bit_spin_lock()

bucket_lock() previously open coded a spinlock, because we need to cram
a spinlock into a single byte.

But it turns out not all archs support xchg() on a single byte; since we
need struct bucket to be small, this means we have to play fun games
with casts and ifdefs for endianness.

This fixes building on 32 bit arm, and likely other architectures.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-bcachefs@vger.kernel.org
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.h