diff options
Diffstat (limited to 'include/linux/workqueue.h')
| -rw-r--r-- | include/linux/workqueue.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 0c0771f06bfa..f7998a3bf020 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -127,12 +127,20 @@ struct execute_work { | |||
| 127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ | 127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | #define __DEFERRED_WORK_INITIALIZER(n, f) { \ | ||
| 131 | .work = __WORK_INITIALIZER((n).work, (f)), \ | ||
| 132 | .timer = TIMER_DEFERRED_INITIALIZER(NULL, 0, 0), \ | ||
| 133 | } | ||
| 134 | |||
| 130 | #define DECLARE_WORK(n, f) \ | 135 | #define DECLARE_WORK(n, f) \ |
| 131 | struct work_struct n = __WORK_INITIALIZER(n, f) | 136 | struct work_struct n = __WORK_INITIALIZER(n, f) |
| 132 | 137 | ||
| 133 | #define DECLARE_DELAYED_WORK(n, f) \ | 138 | #define DECLARE_DELAYED_WORK(n, f) \ |
| 134 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) | 139 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) |
| 135 | 140 | ||
| 141 | #define DECLARE_DEFERRED_WORK(n, f) \ | ||
| 142 | struct delayed_work n = __DEFERRED_WORK_INITIALIZER(n, f) | ||
| 143 | |||
| 136 | /* | 144 | /* |
| 137 | * initialize a work item's function pointer | 145 | * initialize a work item's function pointer |
| 138 | */ | 146 | */ |
| @@ -242,7 +250,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 242 | enum { | 250 | enum { |
| 243 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ | 251 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ |
| 244 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | 252 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ |
| 245 | WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */ | 253 | WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ |
| 246 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ | 254 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ |
| 247 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 255 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
| 248 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 256 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
| @@ -310,7 +318,7 @@ __alloc_workqueue_key(const char *name, unsigned int flags, int max_active, | |||
| 310 | /** | 318 | /** |
| 311 | * alloc_ordered_workqueue - allocate an ordered workqueue | 319 | * alloc_ordered_workqueue - allocate an ordered workqueue |
| 312 | * @name: name of the workqueue | 320 | * @name: name of the workqueue |
| 313 | * @flags: WQ_* flags (only WQ_FREEZEABLE and WQ_MEM_RECLAIM are meaningful) | 321 | * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful) |
| 314 | * | 322 | * |
| 315 | * Allocate an ordered workqueue. An ordered workqueue executes at | 323 | * Allocate an ordered workqueue. An ordered workqueue executes at |
| 316 | * most one work item at any given time in the queued order. They are | 324 | * most one work item at any given time in the queued order. They are |
| @@ -327,8 +335,8 @@ alloc_ordered_workqueue(const char *name, unsigned int flags) | |||
| 327 | 335 | ||
| 328 | #define create_workqueue(name) \ | 336 | #define create_workqueue(name) \ |
| 329 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 337 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) |
| 330 | #define create_freezeable_workqueue(name) \ | 338 | #define create_freezable_workqueue(name) \ |
| 331 | alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 339 | alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
| 332 | #define create_singlethread_workqueue(name) \ | 340 | #define create_singlethread_workqueue(name) \ |
| 333 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 341 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
| 334 | 342 | ||
| @@ -401,7 +409,7 @@ static inline bool __cancel_delayed_work(struct delayed_work *work) | |||
| 401 | } | 409 | } |
| 402 | 410 | ||
| 403 | /* Obsolete. use cancel_delayed_work_sync() */ | 411 | /* Obsolete. use cancel_delayed_work_sync() */ |
| 404 | static inline | 412 | static inline __deprecated |
| 405 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | 413 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, |
| 406 | struct delayed_work *work) | 414 | struct delayed_work *work) |
| 407 | { | 415 | { |
| @@ -409,7 +417,7 @@ void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | |||
| 409 | } | 417 | } |
| 410 | 418 | ||
| 411 | /* Obsolete. use cancel_delayed_work_sync() */ | 419 | /* Obsolete. use cancel_delayed_work_sync() */ |
| 412 | static inline | 420 | static inline __deprecated |
| 413 | void cancel_rearming_delayed_work(struct delayed_work *work) | 421 | void cancel_rearming_delayed_work(struct delayed_work *work) |
| 414 | { | 422 | { |
| 415 | cancel_delayed_work_sync(work); | 423 | cancel_delayed_work_sync(work); |
