make queue_delayed_work() friendly to flush_fork()
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 9 May 2007 09:34:16 +0000 (02:34 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:30:52 +0000 (12:30 -0700)
commited7c0feede39d70092d048ec30f59bb1df69eec6
tree67ff89df1a5db2037da34ddf17002b4c7ff218df
parent06ba38a9a0f6ceffe70343f684c5a690e3710ef4
make queue_delayed_work() friendly to flush_fork()

Currently typeof(delayed_work->work.data) is

"struct workqueue_struct" when the timer is pending

"struct cpu_workqueue_struct" whe the work is queued

This makes impossible to use flush_fork(delayed_work->work) in addition
to cancel_delayed_work/cancel_rearming_delayed_work, not good.

Change queue_delayed_work/delayed_work_timer_fn to use cwq, not wq. This
complicates (and uglifies) these functions a little bit, but alows us to
use flush_fork(dwork) and imho makes the whole code more consistent.

Also, document the fact that cancel_rearming_delayed_work() doesn't garantee
the completion of work->func() upon return.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/workqueue.c