diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-12-17 14:13:37 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-12-17 19:57:20 -0700 |
commit | 525b305d61ede489ce2118b000a5dabd6d869dac (patch) | |
tree | 30f31d11a9818a23fb6cd5ea08467c216a5ec797 /fs/io-wq.h | |
parent | 0b416c3e1345fd696db4c422643468d844410877 (diff) | |
download | lwn-525b305d61ede489ce2118b000a5dabd6d869dac.tar.gz lwn-525b305d61ede489ce2118b000a5dabd6d869dac.zip |
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 <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index fb993b2bd0ef..3f5e356de980 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 |