workqueue: simplify current_is_workqueue_rescuer()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 19 Mar 2013 19:28:03 +0000 (03:28 +0800)
committerTejun Heo <tj@kernel.org>
Wed, 20 Mar 2013 17:40:25 +0000 (10:40 -0700)
We can test worker->recue_wq instead of reaching into
current_pwq->wq->rescuer and then comparing it to self.

tj: Commit message.

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

index 40f4017285a0a3dad5abeb14537dad1cd98d5d45..d2ac6cbfe8abb6a6a20668d29fddf9f38102b22f 100644 (file)
@@ -3936,7 +3936,7 @@ bool current_is_workqueue_rescuer(void)
 {
        struct worker *worker = current_wq_worker();
 
-       return worker && worker == worker->current_pwq->wq->rescuer;
+       return worker && worker->rescue_wq;
 }
 
 /**