diff options
author | Tejun Heo <tj@kernel.org> | 2010-06-29 04:07:10 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-06-29 04:07:10 -0400 |
commit | 97e37d7b9e65a6ac939f796f91081135b7a08acc (patch) | |
tree | 1125644ee13ecf0825688502aa4a7495008cc88e /include/linux/workqueue.h | |
parent | 4690c4ab56c71919893ca25252f2dd65b58188c7 (diff) |
workqueue: merge feature parameters into flags
Currently, __create_workqueue_key() takes @singlethread and
@freezeable paramters and store them separately in workqueue_struct.
Merge them into a single flags parameter and field and use
WQ_FREEZEABLE and WQ_SINGLE_THREAD.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r-- | include/linux/workqueue.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index e724dafc9e6d..d89cfc143b1a 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -184,13 +184,17 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
184 | #define work_clear_pending(work) \ | 184 | #define work_clear_pending(work) \ |
185 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) | 185 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) |
186 | 186 | ||
187 | enum { | ||
188 | WQ_FREEZEABLE = 1 << 0, /* freeze during suspend */ | ||
189 | WQ_SINGLE_THREAD = 1 << 1, /* no per-cpu worker */ | ||
190 | }; | ||
187 | 191 | ||
188 | extern struct workqueue_struct * | 192 | extern struct workqueue_struct * |
189 | __create_workqueue_key(const char *name, int singlethread, int freezeable, | 193 | __create_workqueue_key(const char *name, unsigned int flags, |
190 | struct lock_class_key *key, const char *lock_name); | 194 | struct lock_class_key *key, const char *lock_name); |
191 | 195 | ||
192 | #ifdef CONFIG_LOCKDEP | 196 | #ifdef CONFIG_LOCKDEP |
193 | #define __create_workqueue(name, singlethread, freezeable) \ | 197 | #define __create_workqueue(name, flags) \ |
194 | ({ \ | 198 | ({ \ |
195 | static struct lock_class_key __key; \ | 199 | static struct lock_class_key __key; \ |
196 | const char *__lock_name; \ | 200 | const char *__lock_name; \ |
@@ -200,19 +204,20 @@ __create_workqueue_key(const char *name, int singlethread, int freezeable, | |||
200 | else \ | 204 | else \ |
201 | __lock_name = #name; \ | 205 | __lock_name = #name; \ |
202 | \ | 206 | \ |
203 | __create_workqueue_key((name), (singlethread), \ | 207 | __create_workqueue_key((name), (flags), &__key, \ |
204 | (freezeable), &__key, \ | ||
205 | __lock_name); \ | 208 | __lock_name); \ |
206 | }) | 209 | }) |
207 | #else | 210 | #else |
208 | #define __create_workqueue(name, singlethread, freezeable) \ | 211 | #define __create_workqueue(name, flags) \ |
209 | __create_workqueue_key((name), (singlethread), (freezeable), \ | 212 | __create_workqueue_key((name), (flags), NULL, NULL) |
210 | NULL, NULL) | ||
211 | #endif | 213 | #endif |
212 | 214 | ||
213 | #define create_workqueue(name) __create_workqueue((name), 0, 0) | 215 | #define create_workqueue(name) \ |
214 | #define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1) | 216 | __create_workqueue((name), 0) |
215 | #define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0) | 217 | #define create_freezeable_workqueue(name) \ |
218 | __create_workqueue((name), WQ_FREEZEABLE | WQ_SINGLE_THREAD) | ||
219 | #define create_singlethread_workqueue(name) \ | ||
220 | __create_workqueue((name), WQ_SINGLE_THREAD) | ||
216 | 221 | ||
217 | extern void destroy_workqueue(struct workqueue_struct *wq); | 222 | extern void destroy_workqueue(struct workqueue_struct *wq); |
218 | 223 | ||