aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slow-work.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-11-19 13:10:43 -0500
committerDavid Howells <dhowells@redhat.com>2009-11-19 13:10:43 -0500
commit0160950297c08f8233c89b9f9e7dd59cfb080809 (patch)
tree4910bfb7ab5b4000a1679fd165d217ff48226268 /include/linux/slow-work.h
parent4d8bb2cbccf6dccaada509aafeb01c6205c9d8c4 (diff)
SLOW_WORK: Add support for cancellation of slow work
Add support for cancellation of queued slow work and delayed slow work items. The cancellation functions will wait for items that are pending or undergoing execution to be discarded by the slow work facility. Attempting to enqueue work that is in the process of being cancelled will result in ECANCELED. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/slow-work.h')
-rw-r--r--include/linux/slow-work.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h
index 9adb2b30754f..eef20182d5b4 100644
--- a/include/linux/slow-work.h
+++ b/include/linux/slow-work.h
@@ -51,6 +51,7 @@ struct slow_work {
51#define SLOW_WORK_EXECUTING 1 /* item currently executing */ 51#define SLOW_WORK_EXECUTING 1 /* item currently executing */
52#define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ 52#define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */
53#define SLOW_WORK_VERY_SLOW 3 /* item is very slow */ 53#define SLOW_WORK_VERY_SLOW 3 /* item is very slow */
54#define SLOW_WORK_CANCELLING 4 /* item is being cancelled, don't enqueue */
54 const struct slow_work_ops *ops; /* operations table for this item */ 55 const struct slow_work_ops *ops; /* operations table for this item */
55 struct list_head link; /* link in queue */ 56 struct list_head link; /* link in queue */
56}; 57};
@@ -88,6 +89,7 @@ static inline void vslow_work_init(struct slow_work *work,
88} 89}
89 90
90extern int slow_work_enqueue(struct slow_work *work); 91extern int slow_work_enqueue(struct slow_work *work);
92extern void slow_work_cancel(struct slow_work *work);
91extern int slow_work_register_user(struct module *owner); 93extern int slow_work_register_user(struct module *owner);
92extern void slow_work_unregister_user(struct module *owner); 94extern void slow_work_unregister_user(struct module *owner);
93 95