[PATCH V2 11/15] workqueue: split work_flags to delayed_flags and color_flags in __queue_work()

From: Lai Jiangshan
Date: Mon Feb 18 2013 - 11:15:55 EST


Allow we use delayed_flags only in different path in later patches.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
kernel/workqueue.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7ac6824..cdd5523 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1226,7 +1226,7 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq,
{
struct cpu_workqueue_struct *cwq;
struct list_head *worklist;
- unsigned int work_flags;
+ unsigned int color_flags, delayed_flags = 0;
unsigned int req_cpu = cpu;

/*
@@ -1284,18 +1284,18 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq,
}

cwq->nr_in_flight[cwq->work_color]++;
- work_flags = work_color_to_flags(cwq->work_color);

if (likely(cwq->nr_active < cwq->max_active)) {
trace_workqueue_activate_work(work);
cwq->nr_active++;
worklist = &cwq->pool->worklist;
} else {
- work_flags |= WORK_STRUCT_DELAYED;
+ delayed_flags = WORK_STRUCT_DELAYED;
worklist = &cwq->delayed_works;
}

- insert_work(cwq, work, worklist, work_flags);
+ color_flags = work_color_to_flags(cwq->work_color);
+ insert_work(cwq, work, worklist, color_flags | delayed_flags);

spin_unlock(&cwq->pool->lock);
}
--
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/