mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
io_uring: reshuffle queue_sqe completion handling
If a request completed inline the result should only be zero, it's a grave error otherwise. So, when we see REQ_F_COMPLETE_INLINE it's not even necessary to check the return code, and the flag check can be moved earlier. It's one "if" less for inline completions, and same two checks for it normally completing (ret == 0). Those are two cases we care about the most. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/ebd4e397a9c26d96c99b24447acc309741041a83.1632516769.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d475a9a622
commit
d9f9d2842c
1 changed files with 2 additions and 3 deletions
|
@ -6925,14 +6925,13 @@ static inline void __io_queue_sqe(struct io_kiocb *req)
|
|||
|
||||
ret = io_issue_sqe(req, IO_URING_F_NONBLOCK|IO_URING_F_COMPLETE_DEFER);
|
||||
|
||||
if (req->flags & REQ_F_COMPLETE_INLINE)
|
||||
return;
|
||||
/*
|
||||
* We async punt it if the file wasn't marked NOWAIT, or if the file
|
||||
* doesn't support non-blocking read/write attempts
|
||||
*/
|
||||
if (likely(!ret)) {
|
||||
if (req->flags & REQ_F_COMPLETE_INLINE)
|
||||
return;
|
||||
|
||||
linked_timeout = io_prep_linked_timeout(req);
|
||||
if (linked_timeout)
|
||||
io_queue_linked_timeout(linked_timeout);
|
||||
|
|
Loading…
Reference in a new issue