diff options
| author | Yong Zhang <yong.zhang0@gmail.com> | 2010-12-22 04:27:53 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2010-12-22 04:27:53 -0500 |
| commit | 4f32e9b1f812fd6c00cc85a127583fefbdedaedc (patch) | |
| tree | c0e1d3e1d90758d2f4f3f8cad6beea316d68b5a0 /kernel | |
| parent | 90a8a73c06cc32b609a880d48449d7083327e11a (diff) | |
kthread_work: make lockdep happy
spinlock in kthread_worker and wait_queue_head in kthread_work both
should be lockdep sensible, so change the interface to make it
suiltable for CONFIG_LOCKDEP.
tj: comment update
Reported-by: Nicolas <nicolas.mailhot@laposte.net>
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Tested-by: Andy Walls <awalls@md.metrocast.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/kthread.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index 2dc3786349d..ca61bbdd44b 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
| @@ -265,6 +265,17 @@ int kthreadd(void *unused) | |||
| 265 | return 0; | 265 | return 0; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | void __init_kthread_worker(struct kthread_worker *worker, | ||
| 269 | const char *name, | ||
| 270 | struct lock_class_key *key) | ||
| 271 | { | ||
| 272 | spin_lock_init(&worker->lock); | ||
| 273 | lockdep_set_class_and_name(&worker->lock, key, name); | ||
| 274 | INIT_LIST_HEAD(&worker->work_list); | ||
| 275 | worker->task = NULL; | ||
| 276 | } | ||
| 277 | EXPORT_SYMBOL_GPL(__init_kthread_worker); | ||
| 278 | |||
| 268 | /** | 279 | /** |
| 269 | * kthread_worker_fn - kthread function to process kthread_worker | 280 | * kthread_worker_fn - kthread function to process kthread_worker |
| 270 | * @worker_ptr: pointer to initialized kthread_worker | 281 | * @worker_ptr: pointer to initialized kthread_worker |
