diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-11-12 15:56:39 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-12 16:02:26 +0100 |
commit | 960e432dfa5927892a9b170d14de874597b84849 (patch) | |
tree | 5f349118f3b4de3fcc35836f392f8ffbec440cca /fs/io-wq.h | |
parent | io_uring: fix -ENOENT issue with linked timer with short timeout (diff) | |
download | linux-960e432dfa5927892a9b170d14de874597b84849.tar.xz linux-960e432dfa5927892a9b170d14de874597b84849.zip |
io_uring: use correct "is IO worker" helper
Since we switched to io-wq, the dependent link optimization for when to
pass back work inline has been broken. Fix this by providing a suitable
io-wq helper for io_uring to use to detect when to do this.
Fixes: 561fb04a6a22 ("io_uring: replace workqueue usage with io-wq")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index 8cb345256f35..cc50754d028c 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -62,4 +62,8 @@ static inline void io_wq_worker_running(struct task_struct *tsk) } #endif +static inline bool io_wq_current_is_worker(void) +{ + return in_task() && (current->flags & PF_IO_WORKER); +} #endif |