aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 18:08:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 18:08:51 -0400
commit9d919e8d5b04e987b0378cfd73df6cdd2b19e9db (patch)
tree7b82adaf62c7b8523715937b714419e68628bfc2 /include/linux/workqueue.h
parentcf6fafcf0588093fadf0c8cd69bebe3b5df136c7 (diff)
parent59ff3eb6d6f75c6c1c3ea8b46ac2cc64eb216547 (diff)
Merge branch 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue changes from Tejun Heo: "PREPARE_[DELAYED_]WORK() were used to change the work function of work items without fully reinitializing it; however, this makes workqueue consider the work item as a different one from before and allows the work item to start executing before the previous instance is finished which can lead to extremely subtle issues which are painful to debug. The interface has never been popular. This pull request contains patches to remove existing usages and kill the interface. As one of the changes was routed during the last devel cycle and another depended on a pending change in nvme, for-3.15 contains a couple merge commits. In addition, interfaces which were deprecated quite a while ago - __cancel_delayed_work() and WQ_NON_REENTRANT - are removed too" * 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: remove deprecated WQ_NON_REENTRANT workqueue: Spelling s/instensive/intensive/ workqueue: remove PREPARE_[DELAYED_]WORK() staging/fwserial: don't use PREPARE_WORK afs: don't use PREPARE_WORK nvme: don't use PREPARE_WORK usb: don't use PREPARE_DELAYED_WORK floppy: don't use PREPARE_[DELAYED_]WORK ps3-vuart: don't use PREPARE_WORK wireless/rt2x00: don't use PREPARE_WORK in rt2800usb.c workqueue: Remove deprecated __cancel_delayed_work()
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{