summaryrefslogtreecommitdiffstats
path: root/include/linux/slow-work.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slow-work.h')
-rw-r--r--include/linux/slow-work.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h
index f41485145ed1..bfd3ab4c8898 100644
--- a/include/linux/slow-work.h
+++ b/include/linux/slow-work.h
@@ -120,6 +120,25 @@ static inline void vslow_work_init(struct slow_work *work,
INIT_LIST_HEAD(&work->link);
}
+/**
+ * slow_work_is_queued - Determine if a slow work item is on the work queue
+ * work: The work item to test
+ *
+ * Determine if the specified slow-work item is on the work queue. This
+ * returns true if it is actually on the queue.
+ *
+ * If the item is executing and has been marked for requeue when execution
+ * finishes, then false will be returned.
+ *
+ * Anyone wishing to wait for completion of execution can wait on the
+ * SLOW_WORK_EXECUTING bit.
+ */
+static inline bool slow_work_is_queued(struct slow_work *work)
+{
+ unsigned long flags = work->flags;
+ return flags & SLOW_WORK_PENDING && !(flags & SLOW_WORK_EXECUTING);
+}
+
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);