summaryrefslogtreecommitdiff
path: root/libbcachefs/buckets.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-02-20 15:42:51 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-02-20 15:52:55 -0500
commitdd1a882d17d6302bd3f48f87aec4018b75749de6 (patch)
treef9bf12bc5cf2e54eaa10da4a0a903464c1cf2b73 /libbcachefs/buckets.h
parent3e15e96cb9c90cca6f7fa3465697933c53f51228 (diff)
Update bcachefs sources to 9736cbbc5cc3 bcachefs: bs > ps support
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/buckets.h')
-rw-r--r--libbcachefs/buckets.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/libbcachefs/buckets.h b/libbcachefs/buckets.h
index a9acdd6c..6aeec1c0 100644
--- a/libbcachefs/buckets.h
+++ b/libbcachefs/buckets.h
@@ -39,33 +39,6 @@ static inline u64 sector_to_bucket_and_offset(const struct bch_dev *ca, sector_t
for (_b = (_buckets)->b + (_buckets)->first_bucket; \
_b < (_buckets)->b + (_buckets)->nbuckets; _b++)
-/*
- * Ugly hack alert:
- *
- * We need to cram a spinlock in a single byte, because that's what we have left
- * in struct bucket, and we care about the size of these - during fsck, we need
- * in memory state for every single bucket on every device.
- *
- * We used to do
- * while (xchg(&b->lock, 1) cpu_relax();
- * but, it turns out not all architectures support xchg on a single byte.
- *
- * So now we use bit_spin_lock(), with fun games since we can't burn a whole
- * ulong for this - we just need to make sure the lock bit always ends up in the
- * first byte.
- */
-
-#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-#define BUCKET_LOCK_BITNR 0
-#else
-#define BUCKET_LOCK_BITNR (BITS_PER_LONG - 1)
-#endif
-
-union ulong_byte_assert {
- ulong ulong;
- u8 byte;
-};
-
static inline void bucket_unlock(struct bucket *b)
{
BUILD_BUG_ON(!((union ulong_byte_assert) { .ulong = 1UL << BUCKET_LOCK_BITNR }).byte);