aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h38
1 files changed, 3 insertions, 35 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 704f4f652d0a..532994651684 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -177,17 +177,6 @@ struct execute_work {
177#define DECLARE_DEFERRABLE_WORK(n, f) \ 177#define DECLARE_DEFERRABLE_WORK(n, f) \
178 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE) 178 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE)
179 179
180/*
181 * initialize a work item's function pointer
182 */
183#define PREPARE_WORK(_work, _func) \
184 do { \
185 (_work)->func = (_func); \
186 } while (0)
187
188#define PREPARE_DELAYED_WORK(_work, _func) \
189 PREPARE_WORK(&(_work)->work, (_func))
190
191#ifdef CONFIG_DEBUG_OBJECTS_WORK 180#ifdef CONFIG_DEBUG_OBJECTS_WORK
192extern void __init_work(struct work_struct *work, int onstack); 181extern void __init_work(struct work_struct *work, int onstack);
193extern void destroy_work_on_stack(struct work_struct *work); 182extern void destroy_work_on_stack(struct work_struct *work);
@@ -217,7 +206,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
217 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 206 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
218 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \ 207 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \
219 INIT_LIST_HEAD(&(_work)->entry); \ 208 INIT_LIST_HEAD(&(_work)->entry); \
220 PREPARE_WORK((_work), (_func)); \ 209 (_work)->func = (_func); \
221 } while (0) 210 } while (0)
222#else 211#else
223#define __INIT_WORK(_work, _func, _onstack) \ 212#define __INIT_WORK(_work, _func, _onstack) \
@@ -225,7 +214,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
225 __init_work((_work), _onstack); \ 214 __init_work((_work), _onstack); \
226 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 215 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
227 INIT_LIST_HEAD(&(_work)->entry); \ 216 INIT_LIST_HEAD(&(_work)->entry); \
228 PREPARE_WORK((_work), (_func)); \ 217 (_work)->func = (_func); \
229 } while (0) 218 } while (0)
230#endif 219#endif
231 220
@@ -295,17 +284,11 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
295 * Documentation/workqueue.txt. 284 * Documentation/workqueue.txt.
296 */ 285 */
297enum { 286enum {
298 /*
299 * All wqs are now non-reentrant making the following flag
300 * meaningless. Will be removed.
301 */
302 WQ_NON_REENTRANT = 1 << 0, /* DEPRECATED */
303
304 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ 287 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
305 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ 288 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */
306 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ 289 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
307 WQ_HIGHPRI = 1 << 4, /* high priority */ 290 WQ_HIGHPRI = 1 << 4, /* high priority */
308 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 291 WQ_CPU_INTENSIVE = 1 << 5, /* cpu intensive workqueue */
309 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ 292 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */
310 293
311 /* 294 /*
@@ -602,21 +585,6 @@ static inline bool keventd_up(void)
602 return system_wq != NULL; 585 return system_wq != NULL;
603} 586}
604 587
605/*
606 * Like above, but uses del_timer() instead of del_timer_sync(). This means,
607 * if it returns 0 the timer function may be running and the queueing is in
608 * progress.
609 */
610static inline bool __deprecated __cancel_delayed_work(struct delayed_work *work)
611{
612 bool ret;
613
614 ret = del_timer(&work->timer);
615 if (ret)
616 work_clear_pending(&work->work);
617 return ret;
618}
619
620/* used to be different but now identical to flush_work(), deprecated */ 588/* used to be different but now identical to flush_work(), deprecated */
621static inline bool __deprecated flush_work_sync(struct work_struct *work) 589static inline bool __deprecated flush_work_sync(struct work_struct *work)
622{ 590{