浏览代码

workqueue: simplify current_is_workqueue_rescuer()

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>
Lai Jiangshan 12 年之前
父节点
当前提交
6a092dfd51
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      kernel/workqueue.c

+ 1 - 1
kernel/workqueue.c

@@ -3936,7 +3936,7 @@ bool current_is_workqueue_rescuer(void)
 {
 {
 	struct worker *worker = current_wq_worker();
 	struct worker *worker = current_wq_worker();
 
 
-	return worker && worker == worker->current_pwq->wq->rescuer;
+	return worker && worker->rescue_wq;
 }
 }
 
 
 /**
 /**