From: Jens Axboe Date: Tue, 17 Dec 2019 21:13:37 +0000 (-0700) Subject: io-wq: re-add io_wq_current_is_worker() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=525b305d61ede489ce2118b000a5dabd6d869dac;p=linux.git io-wq: re-add io_wq_current_is_worker() This reverts commit 8cdda87a4414, we now have several use csaes for this helper. Reinstate it. Signed-off-by: Jens Axboe --- diff --git a/fs/io-wq.h b/fs/io-wq.h index fb993b2bd0ef0..3f5e356de9805 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -120,6 +120,10 @@ static inline void io_wq_worker_sleeping(struct task_struct *tsk) static inline void io_wq_worker_running(struct task_struct *tsk) { } -#endif /* CONFIG_IO_WQ */ +#endif -#endif /* INTERNAL_IO_WQ_H */ +static inline bool io_wq_current_is_worker(void) +{ + return in_task() && (current->flags & PF_IO_WORKER); +} +#endif