io_uring: don't delay io_init_req() error check
Don't postpone io_init_req() error checks and do that right after calling it. There is no control-flow statements or dependencies with sqe/submitted accounting, so do those earlier, that makes the code flow a bit more natural. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
062d04d731
commit
692d836351
@ -6466,12 +6466,11 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
|
|||||||
submitted = -EAGAIN;
|
submitted = -EAGAIN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = io_init_req(ctx, req, sqe, &state);
|
|
||||||
io_consume_sqe(ctx);
|
io_consume_sqe(ctx);
|
||||||
/* will complete beyond this point, count as submitted */
|
/* will complete beyond this point, count as submitted */
|
||||||
submitted++;
|
submitted++;
|
||||||
|
|
||||||
|
err = io_init_req(ctx, req, sqe, &state);
|
||||||
if (unlikely(err)) {
|
if (unlikely(err)) {
|
||||||
fail_req:
|
fail_req:
|
||||||
io_put_req(req);
|
io_put_req(req);
|
||||||
|
Loading…
Reference in New Issue
Block a user