summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-01-17 03:18:18 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2016-10-07 12:35:16 -0800
commit9f2fbda2ca256d26df0a5a4a7258a8b00d7fdba1 (patch)
tree093bd25cf89b6855df73d2c32bad76e0cc3d68da
parent5dd51f84fe815cb30620322d758650a6fb973eab (diff)
bcache: fix six locks on 32 bit big endian
-rw-r--r--drivers/md/bcache/six.c2
-rw-r--r--drivers/md/bcache/six.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/bcache/six.c b/drivers/md/bcache/six.c
index a3b051efa71e..e4fec057804a 100644
--- a/drivers/md/bcache/six.c
+++ b/drivers/md/bcache/six.c
@@ -90,7 +90,7 @@ struct six_lock_waiter {
};
/* This is probably up there with the more evil things I've done */
-#define waitlist_bitnr(id) ilog2(__SIX_VAL(waiters, 1 << (id)))
+#define waitlist_bitnr(id) ilog2((((union six_lock_state) { .waiters = 1 << (id) }).l))
void __six_lock_type(struct six_lock *lock, enum six_lock_type type)
{
diff --git a/drivers/md/bcache/six.h b/drivers/md/bcache/six.h
index c98be80b9972..0feeb612993b 100644
--- a/drivers/md/bcache/six.h
+++ b/drivers/md/bcache/six.h
@@ -33,6 +33,11 @@ union six_lock_state {
};
struct {
+ /* for waitlist_bitnr() */
+ unsigned long l;
+ };
+
+ struct {
unsigned read_lock:26;
unsigned intent_lock:3;
unsigned waiters:3;