aboutsummaryrefslogtreecommitdiff
path: root/kernel/kthread.c
diff options
context:
space:
mode:
authorYong Zhang <yong.zhang0@gmail.com>2010-12-22 10:27:53 +0100
committerTejun Heo <tj@kernel.org>2010-12-22 10:27:53 +0100
commit4f32e9b1f812fd6c00cc85a127583fefbdedaedc (patch)
treec0e1d3e1d90758d2f4f3f8cad6beea316d68b5a0 /kernel/kthread.c
parent90a8a73c06cc32b609a880d48449d7083327e11a (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/kthread.c')
-rw-r--r--kernel/kthread.c11
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)
return 0;
}
+void __init_kthread_worker(struct kthread_worker *worker,
+ const char *name,
+ struct lock_class_key *key)
+{
+ spin_lock_init(&worker->lock);
+ lockdep_set_class_and_name(&worker->lock, key, name);
+ INIT_LIST_HEAD(&worker->work_list);
+ worker->task = NULL;
+}
+EXPORT_SYMBOL_GPL(__init_kthread_worker);
+
/**
* kthread_worker_fn - kthread function to process kthread_worker
* @worker_ptr: pointer to initialized kthread_worker