aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-03-13 19:51:36 -0400
committerTejun Heo <tj@kernel.org>2013-03-13 19:51:36 -0400
commit611c92a0203091bb022edec7e2d8b765fe148622 (patch)
tree84b1792c60c547f6d5e08b791fc62b5671a65a58 /kernel/workqueue.c
parentc5aa87bbf4b23f5e4f167489406daeb0ed275c47 (diff)
workqueue: rename @id to @pi in for_each_each_pool()
Rename @id argument of for_each_pool() to @pi so that it doesn't get reused accidentally when for_each_pool() is used in combination with other iterators. This patch is purely cosmetic. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 248a1e95b577..147fc5a784f0 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -283,7 +283,7 @@ EXPORT_SYMBOL_GPL(system_freezable_wq);
283/** 283/**
284 * for_each_pool - iterate through all worker_pools in the system 284 * for_each_pool - iterate through all worker_pools in the system
285 * @pool: iteration cursor 285 * @pool: iteration cursor
286 * @id: integer used for iteration 286 * @pi: integer used for iteration
287 * 287 *
288 * This must be called either with workqueue_lock held or sched RCU read 288 * This must be called either with workqueue_lock held or sched RCU read
289 * locked. If the pool needs to be used beyond the locking in effect, the 289 * locked. If the pool needs to be used beyond the locking in effect, the
@@ -292,8 +292,8 @@ EXPORT_SYMBOL_GPL(system_freezable_wq);
292 * The if/else clause exists only for the lockdep assertion and can be 292 * The if/else clause exists only for the lockdep assertion and can be
293 * ignored. 293 * ignored.
294 */ 294 */
295#define for_each_pool(pool, id) \ 295#define for_each_pool(pool, pi) \
296 idr_for_each_entry(&worker_pool_idr, pool, id) \ 296 idr_for_each_entry(&worker_pool_idr, pool, pi) \
297 if (({ assert_rcu_or_wq_lock(); false; })) { } \ 297 if (({ assert_rcu_or_wq_lock(); false; })) { } \
298 else 298 else
299 299
@@ -4354,7 +4354,7 @@ void freeze_workqueues_begin(void)
4354 struct worker_pool *pool; 4354 struct worker_pool *pool;
4355 struct workqueue_struct *wq; 4355 struct workqueue_struct *wq;
4356 struct pool_workqueue *pwq; 4356 struct pool_workqueue *pwq;
4357 int id; 4357 int pi;
4358 4358
4359 spin_lock_irq(&workqueue_lock); 4359 spin_lock_irq(&workqueue_lock);
4360 4360
@@ -4362,7 +4362,7 @@ void freeze_workqueues_begin(void)
4362 workqueue_freezing = true; 4362 workqueue_freezing = true;
4363 4363
4364 /* set FREEZING */ 4364 /* set FREEZING */
4365 for_each_pool(pool, id) { 4365 for_each_pool(pool, pi) {
4366 spin_lock(&pool->lock); 4366 spin_lock(&pool->lock);
4367 WARN_ON_ONCE(pool->flags & POOL_FREEZING); 4367 WARN_ON_ONCE(pool->flags & POOL_FREEZING);
4368 pool->flags |= POOL_FREEZING; 4368 pool->flags |= POOL_FREEZING;
@@ -4435,7 +4435,7 @@ void thaw_workqueues(void)
4435 struct workqueue_struct *wq; 4435 struct workqueue_struct *wq;
4436 struct pool_workqueue *pwq; 4436 struct pool_workqueue *pwq;
4437 struct worker_pool *pool; 4437 struct worker_pool *pool;
4438 int id; 4438 int pi;
4439 4439
4440 spin_lock_irq(&workqueue_lock); 4440 spin_lock_irq(&workqueue_lock);
4441 4441
@@ -4443,7 +4443,7 @@ void thaw_workqueues(void)
4443 goto out_unlock; 4443 goto out_unlock;
4444 4444
4445 /* clear FREEZING */ 4445 /* clear FREEZING */
4446 for_each_pool(pool, id) { 4446 for_each_pool(pool, pi) {
4447 spin_lock(&pool->lock); 4447 spin_lock(&pool->lock);
4448 WARN_ON_ONCE(!(pool->flags & POOL_FREEZING)); 4448 WARN_ON_ONCE(!(pool->flags & POOL_FREEZING));
4449 pool->flags &= ~POOL_FREEZING; 4449 pool->flags &= ~POOL_FREEZING;
@@ -4457,7 +4457,7 @@ void thaw_workqueues(void)
4457 } 4457 }
4458 4458
4459 /* kick workers */ 4459 /* kick workers */
4460 for_each_pool(pool, id) { 4460 for_each_pool(pool, pi) {
4461 spin_lock(&pool->lock); 4461 spin_lock(&pool->lock);
4462 wake_up_worker(pool); 4462 wake_up_worker(pool);
4463 spin_unlock(&pool->lock); 4463 spin_unlock(&pool->lock);