From ea2728f6ad223e38906866baa09b3ec6ef811bc8 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Mon, 10 Aug 2009 12:33:05 +0100 Subject: [PATCH] --- yaml --- r: 156727 b: refs/heads/master c: 2fc391112fb6f3424435a3aa2fda887497b5f807 h: refs/heads/master i: 156725: 1d6614ce8ca2710184658feab5187a59e2ab0f25 156723: 839bea87f0cef852b6a67a959933ab4fd32a6385 156719: 23abbe1cc2582a03dee17d84becd7fc2da6dfcfe v: v3 --- [refs] | 2 +- trunk/include/linux/wait.h | 9 ++++++++- trunk/kernel/wait.c | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 9581c4abd6c9..17f920d65581 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: beda2c7ea2c15ed01eef00a997d2b0496c3a502d +refs/heads/master: 2fc391112fb6f3424435a3aa2fda887497b5f807 diff --git a/trunk/include/linux/wait.h b/trunk/include/linux/wait.h index 6788e1a4d4ca..cf3c2f5dba51 100644 --- a/trunk/include/linux/wait.h +++ b/trunk/include/linux/wait.h @@ -77,7 +77,14 @@ struct task_struct; #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ { .flags = word, .bit_nr = bit, } -extern void init_waitqueue_head(wait_queue_head_t *q); +extern void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *); + +#define init_waitqueue_head(q) \ + do { \ + static struct lock_class_key __key; \ + \ + __init_waitqueue_head((q), &__key); \ + } while (0) #ifdef CONFIG_LOCKDEP # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ diff --git a/trunk/kernel/wait.c b/trunk/kernel/wait.c index ea7c3b4275cf..c4bd3d825f35 100644 --- a/trunk/kernel/wait.c +++ b/trunk/kernel/wait.c @@ -10,13 +10,14 @@ #include #include -void init_waitqueue_head(wait_queue_head_t *q) +void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *key) { spin_lock_init(&q->lock); + lockdep_set_class(&q->lock, key); INIT_LIST_HEAD(&q->task_list); } -EXPORT_SYMBOL(init_waitqueue_head); +EXPORT_SYMBOL(__init_waitqueue_head); void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait) {