diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-07-25 04:47:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:40 -0400 |
commit | a67da70dc0955580665f5444f318b92e69a3c272 (patch) | |
tree | 204164627e0fb6495516b24cca005845f492f600 /kernel/workqueue.c | |
parent | 69b895fd13d73aebf62b75502eb6513d43057ba3 (diff) |
workqueues: lockdep annotations for flush_work()
Add lockdep annotations to flush_work() and update the comment.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Jarek Poplawski <jarkao2@o2.pl>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 828e58230cbc..4fcb75b98443 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -427,6 +427,8 @@ EXPORT_SYMBOL_GPL(flush_workqueue); | |||
427 | * flush_work - block until a work_struct's callback has terminated | 427 | * flush_work - block until a work_struct's callback has terminated |
428 | * @work: the work which is to be flushed | 428 | * @work: the work which is to be flushed |
429 | * | 429 | * |
430 | * Returns false if @work has already terminated. | ||
431 | * | ||
430 | * It is expected that, prior to calling flush_work(), the caller has | 432 | * It is expected that, prior to calling flush_work(), the caller has |
431 | * arranged for the work to not be requeued, otherwise it doesn't make | 433 | * arranged for the work to not be requeued, otherwise it doesn't make |
432 | * sense to use this function. | 434 | * sense to use this function. |
@@ -442,6 +444,9 @@ int flush_work(struct work_struct *work) | |||
442 | if (!cwq) | 444 | if (!cwq) |
443 | return 0; | 445 | return 0; |
444 | 446 | ||
447 | lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_); | ||
448 | lock_release(&cwq->wq->lockdep_map, 1, _THIS_IP_); | ||
449 | |||
445 | prev = NULL; | 450 | prev = NULL; |
446 | spin_lock_irq(&cwq->lock); | 451 | spin_lock_irq(&cwq->lock); |
447 | if (!list_empty(&work->entry)) { | 452 | if (!list_empty(&work->entry)) { |