workqueue: replace for_each_pwq_cpu() with for_each_pwq()
authorTejun Heo <tj@kernel.org>
Tue, 12 Mar 2013 18:29:58 +0000 (11:29 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 12 Mar 2013 18:29:58 +0000 (11:29 -0700)
commit49e3cf44df0663a521aa71e7667c52a9dbd0fce9
tree6abded05fad30819d5f417cd967ffe468d25b629
parent30cdf2496d8ac2ef94b9b85f1891cf069490c8c4
workqueue: replace for_each_pwq_cpu() with for_each_pwq()

Introduce for_each_pwq() which iterates all pool_workqueues of a
workqueue using the recently added workqueue->pwqs list and replace
for_each_pwq_cpu() usages with it.

This is primarily to remove the single unbound CPU assumption from pwq
iteration for the scheduled unbound pools with custom attributes
support which would introduce multiple unbound pwqs per workqueue;
however, it also simplifies iterator users.

Note that pwq->pool initialization is moved to alloc_and_link_pwqs()
as that now is the only place which is explicitly handling the two pwq
types.

This patch doesn't introduce any visible behavior changes.

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