mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	workqueue: Convert timers to use timer_setup() (part 2)
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. (The prior workqueue patch missed a few timers.) Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Link: https://lkml.kernel.org/r/20171016225825.GA99101@beast Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
		
							parent
							
								
									c310ce4dcb
								
							
						
					
					
						commit
						32a6c7233c
					
				
					 1 changed files with 6 additions and 8 deletions
				
			
		| 
						 | 
					@ -1831,9 +1831,9 @@ static void destroy_worker(struct worker *worker)
 | 
				
			||||||
	wake_up_process(worker->task);
 | 
						wake_up_process(worker->task);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void idle_worker_timeout(unsigned long __pool)
 | 
					static void idle_worker_timeout(struct timer_list *t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct worker_pool *pool = (void *)__pool;
 | 
						struct worker_pool *pool = from_timer(pool, t, idle_timer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock_irq(&pool->lock);
 | 
						spin_lock_irq(&pool->lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1879,9 +1879,9 @@ static void send_mayday(struct work_struct *work)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void pool_mayday_timeout(unsigned long __pool)
 | 
					static void pool_mayday_timeout(struct timer_list *t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct worker_pool *pool = (void *)__pool;
 | 
						struct worker_pool *pool = from_timer(pool, t, mayday_timer);
 | 
				
			||||||
	struct work_struct *work;
 | 
						struct work_struct *work;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock_irq(&pool->lock);
 | 
						spin_lock_irq(&pool->lock);
 | 
				
			||||||
| 
						 | 
					@ -3241,11 +3241,9 @@ static int init_worker_pool(struct worker_pool *pool)
 | 
				
			||||||
	INIT_LIST_HEAD(&pool->idle_list);
 | 
						INIT_LIST_HEAD(&pool->idle_list);
 | 
				
			||||||
	hash_init(pool->busy_hash);
 | 
						hash_init(pool->busy_hash);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setup_deferrable_timer(&pool->idle_timer, idle_worker_timeout,
 | 
						timer_setup(&pool->idle_timer, idle_worker_timeout, TIMER_DEFERRABLE);
 | 
				
			||||||
			       (unsigned long)pool);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setup_timer(&pool->mayday_timer, pool_mayday_timeout,
 | 
						timer_setup(&pool->mayday_timer, pool_mayday_timeout, 0);
 | 
				
			||||||
		    (unsigned long)pool);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	mutex_init(&pool->manager_arb);
 | 
						mutex_init(&pool->manager_arb);
 | 
				
			||||||
	mutex_init(&pool->attach_mutex);
 | 
						mutex_init(&pool->attach_mutex);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue