summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;