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>
This commit is contained in:
committed by
David Howells
parent
4d8bb2cbcc
commit
0160950297
@@ -51,6 +51,7 @@ struct slow_work {
|
||||
#define SLOW_WORK_EXECUTING 1 /* item currently executing */
|
||||
#define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */
|
||||
#define SLOW_WORK_VERY_SLOW 3 /* item is very slow */
|
||||
#define SLOW_WORK_CANCELLING 4 /* item is being cancelled, don't enqueue */
|
||||
const struct slow_work_ops *ops; /* operations table for this item */
|
||||
struct list_head link; /* link in queue */
|
||||
};
|
||||
@@ -88,6 +89,7 @@ static inline void vslow_work_init(struct slow_work *work,
|
||||
}
|
||||
|
||||
extern int slow_work_enqueue(struct slow_work *work);
|
||||
extern void slow_work_cancel(struct slow_work *work);
|
||||
extern int slow_work_register_user(struct module *owner);
|
||||
extern void slow_work_unregister_user(struct module *owner);
|
||||
|
||||
|
Reference in New Issue
Block a user