diff options
| author | Tejun Heo <tj@kernel.org> | 2010-09-16 04:36:00 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2010-09-19 11:51:05 -0400 |
| commit | 401a8d048eadfbe1b1c1bf53d3b614fcc894c61a (patch) | |
| tree | 7e1761149643e395a33619deb67ec99d8949a7a4 /include/linux/workqueue.h | |
| parent | 81dcaf6516d8bbd75b894862c8ae7bba04380cfe (diff) | |
workqueue: cleanup flush/cancel functions
Make the following cleanup changes.
* Relocate flush/cancel function prototypes and definitions.
* Relocate wait_on_cpu_work() and wait_on_work() before
try_to_grab_pending(). These will be used to implement
flush_work_sync().
* Make all flush/cancel functions return bool instead of int.
* Update wait_on_cpu_work() and wait_on_work() to return %true if they
actually waited.
* Add / update comments.
This patch doesn't cause any functional changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/workqueue.h')
| -rw-r--r-- | include/linux/workqueue.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 07c48925a8fc..bb9b683ea6fa 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -343,7 +343,6 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | |||
| 343 | 343 | ||
| 344 | extern void flush_workqueue(struct workqueue_struct *wq); | 344 | extern void flush_workqueue(struct workqueue_struct *wq); |
| 345 | extern void flush_scheduled_work(void); | 345 | extern void flush_scheduled_work(void); |
| 346 | extern void flush_delayed_work(struct delayed_work *work); | ||
| 347 | 346 | ||
| 348 | extern int schedule_work(struct work_struct *work); | 347 | extern int schedule_work(struct work_struct *work); |
| 349 | extern int schedule_work_on(int cpu, struct work_struct *work); | 348 | extern int schedule_work_on(int cpu, struct work_struct *work); |
| @@ -355,8 +354,11 @@ extern int keventd_up(void); | |||
| 355 | 354 | ||
| 356 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 355 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
| 357 | 356 | ||
| 358 | extern int flush_work(struct work_struct *work); | 357 | extern bool flush_work(struct work_struct *work); |
| 359 | extern int cancel_work_sync(struct work_struct *work); | 358 | extern bool cancel_work_sync(struct work_struct *work); |
| 359 | |||
| 360 | extern bool flush_delayed_work(struct delayed_work *dwork); | ||
| 361 | extern bool cancel_delayed_work_sync(struct delayed_work *dwork); | ||
| 360 | 362 | ||
| 361 | extern void workqueue_set_max_active(struct workqueue_struct *wq, | 363 | extern void workqueue_set_max_active(struct workqueue_struct *wq, |
| 362 | int max_active); | 364 | int max_active); |
| @@ -370,9 +372,9 @@ extern unsigned int work_busy(struct work_struct *work); | |||
| 370 | * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or | 372 | * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or |
| 371 | * cancel_work_sync() to wait on it. | 373 | * cancel_work_sync() to wait on it. |
| 372 | */ | 374 | */ |
| 373 | static inline int cancel_delayed_work(struct delayed_work *work) | 375 | static inline bool cancel_delayed_work(struct delayed_work *work) |
| 374 | { | 376 | { |
| 375 | int ret; | 377 | bool ret; |
| 376 | 378 | ||
| 377 | ret = del_timer_sync(&work->timer); | 379 | ret = del_timer_sync(&work->timer); |
| 378 | if (ret) | 380 | if (ret) |
| @@ -385,9 +387,9 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
| 385 | * if it returns 0 the timer function may be running and the queueing is in | 387 | * if it returns 0 the timer function may be running and the queueing is in |
| 386 | * progress. | 388 | * progress. |
| 387 | */ | 389 | */ |
| 388 | static inline int __cancel_delayed_work(struct delayed_work *work) | 390 | static inline bool __cancel_delayed_work(struct delayed_work *work) |
| 389 | { | 391 | { |
| 390 | int ret; | 392 | bool ret; |
| 391 | 393 | ||
| 392 | ret = del_timer(&work->timer); | 394 | ret = del_timer(&work->timer); |
| 393 | if (ret) | 395 | if (ret) |
| @@ -395,8 +397,6 @@ static inline int __cancel_delayed_work(struct delayed_work *work) | |||
| 395 | return ret; | 397 | return ret; |
| 396 | } | 398 | } |
| 397 | 399 | ||
| 398 | extern int cancel_delayed_work_sync(struct delayed_work *work); | ||
| 399 | |||
| 400 | /* Obsolete. use cancel_delayed_work_sync() */ | 400 | /* Obsolete. use cancel_delayed_work_sync() */ |
| 401 | static inline | 401 | static inline |
| 402 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | 402 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, |
