Skip to content

Commit

Permalink
io_uring: silence io_for_each_link() warning
Browse files Browse the repository at this point in the history
Some tooling keep complaining about self assignment in
io_for_each_link(), the code is correct but still let's workaround it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/f0de77b0b0f8309554ba6fba34327b7813bcc3ff.1648209006.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Apr 24, 2022
1 parent 9d17016 commit 963c6ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -6959,9 +6959,10 @@ static int io_req_prep_async(struct io_kiocb *req)
static u32 io_get_sequence(struct io_kiocb *req)
{
u32 seq = req->ctx->cached_sq_head;
struct io_kiocb *cur;

/* need original cached_sq_head, but it was increased for each req */
io_for_each_link(req, req)
io_for_each_link(cur, req)
seq--;
return seq;
}
Expand Down

0 comments on commit 963c6ab

Please sign in to comment.