aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2014-04-07 08:52:12 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2014-04-07 08:52:12 -0400
commit2c5cb2770392fb9c5d8518688c8bc61986d70dc6 (patch)
treeb19210e709de6ee0d22b67ef605a569500cf1a18 /include/linux/workqueue.h
parentcd979883b9ede90643e019f33cb317933eb867b4 (diff)
parent683b6c6f82a60fabf47012581c2cfbf1b037ab95 (diff)
Merge commit '683b6c6f82a60fabf47012581c2cfbf1b037ab95' into stable/for-linus-3.15
This merge of the irq-core-for-linus branch broke the ARM build when Xen is enabled. Conflicts: drivers/xen/events/events_base.c
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h40
1 files changed, 5 insertions, 35 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 704f4f652d0a..1b22c42e9c2d 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -177,20 +177,10 @@ 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);
183extern void destroy_delayed_work_on_stack(struct delayed_work *work);
194static inline unsigned int work_static(struct work_struct *work) 184static inline unsigned int work_static(struct work_struct *work)
195{ 185{
196 return *work_data_bits(work) & WORK_STRUCT_STATIC; 186 return *work_data_bits(work) & WORK_STRUCT_STATIC;
@@ -198,6 +188,7 @@ static inline unsigned int work_static(struct work_struct *work)
198#else 188#else
199static inline void __init_work(struct work_struct *work, int onstack) { } 189static inline void __init_work(struct work_struct *work, int onstack) { }
200static inline void destroy_work_on_stack(struct work_struct *work) { } 190static inline void destroy_work_on_stack(struct work_struct *work) { }
191static inline void destroy_delayed_work_on_stack(struct delayed_work *work) { }
201static inline unsigned int work_static(struct work_struct *work) { return 0; } 192static inline unsigned int work_static(struct work_struct *work) { return 0; }
202#endif 193#endif
203 194
@@ -217,7 +208,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
217 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 208 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
218 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \ 209 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \
219 INIT_LIST_HEAD(&(_work)->entry); \ 210 INIT_LIST_HEAD(&(_work)->entry); \
220 PREPARE_WORK((_work), (_func)); \ 211 (_work)->func = (_func); \
221 } while (0) 212 } while (0)
222#else 213#else
223#define __INIT_WORK(_work, _func, _onstack) \ 214#define __INIT_WORK(_work, _func, _onstack) \
@@ -225,7 +216,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
225 __init_work((_work), _onstack); \ 216 __init_work((_work), _onstack); \
226 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 217 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
227 INIT_LIST_HEAD(&(_work)->entry); \ 218 INIT_LIST_HEAD(&(_work)->entry); \
228 PREPARE_WORK((_work), (_func)); \ 219 (_work)->func = (_func); \
229 } while (0) 220 } while (0)
230#endif 221#endif
231 222
@@ -295,17 +286,11 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
295 * Documentation/workqueue.txt. 286 * Documentation/workqueue.txt.
296 */ 287 */
297enum { 288enum {
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 */ 289 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
305 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ 290 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */
306 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ 291 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
307 WQ_HIGHPRI = 1 << 4, /* high priority */ 292 WQ_HIGHPRI = 1 << 4, /* high priority */
308 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 293 WQ_CPU_INTENSIVE = 1 << 5, /* cpu intensive workqueue */
309 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ 294 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */
310 295
311 /* 296 /*
@@ -602,21 +587,6 @@ static inline bool keventd_up(void)
602 return system_wq != NULL; 587 return system_wq != NULL;
603} 588}
604 589
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 */ 590/* used to be different but now identical to flush_work(), deprecated */
621static inline bool __deprecated flush_work_sync(struct work_struct *work) 591static inline bool __deprecated flush_work_sync(struct work_struct *work)
622{ 592{