workqueue: drop WQ_RESCUER and test workqueue->rescuer for NULL instead
authorTejun Heo <tj@kernel.org>
Tue, 12 Mar 2013 18:30:03 +0000 (11:30 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 12 Mar 2013 18:30:03 +0000 (11:30 -0700)
commit493008a8e475771a2126e0ce95a73e35b371d277
tree0e67b51ade42bb623456aa186cec7a5722a8420c
parentac6104cdf87cc162b0a0d78280d1dcb9752e25bb
workqueue: drop WQ_RESCUER and test workqueue->rescuer for NULL instead

WQ_RESCUER is superflous.  WQ_MEM_RECLAIM indicates that the user
wants a rescuer and testing wq->rescuer for NULL can answer whether a
given workqueue has a rescuer or not.  Drop WQ_RESCUER and test
wq->rescuer directly.

This will help simplifying __alloc_workqueue_key() failure path by
allowing it to use destroy_workqueue() on a partially constructed
workqueue, which in turn will help implementing dynamic management of
pool_workqueues.

While at it, clear wq->rescuer after freeing it in
destroy_workqueue().  This is a precaution as scheduled changes will
make destruction more complex.

This patch doesn't introduce any functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
include/linux/workqueue.h
kernel/workqueue.c