diff options
Diffstat (limited to 'include/linux/kthread.h')
| -rw-r--r-- | include/linux/kthread.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 7dcef3317..f52ec33a3 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -130,6 +130,18 @@ extern void __init_kthread_worker(struct kthread_worker *worker, init_waitqueue_head(&(work)->done); \ } while (0) +/* + * Returns true when the work could not be queued at the moment. + * It happens when it is already pending in a worker list. + */ +static inline bool queuing_blocked(struct kthread_worker *worker, + struct kthread_work *work) +{ + lockdep_assert_held(&worker->lock); + + return !list_empty(&work->node); +} + int kthread_worker_fn(void *worker_ptr); bool queue_kthread_work(struct kthread_worker *worker, |
