Skip to content

Commit

Permalink
io_uring: use better types for cflags
Browse files Browse the repository at this point in the history
[ Upstream commit 8c3f9cd ]

__io_cqring_fill_event() takes cflags as long to squeeze it into u32 in
an CQE, awhile all users pass int or unsigned. Replace it with unsigned
int and store it as u32 in struct io_completion to match CQE.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
isilence authored and gregkh committed Jun 10, 2021
1 parent 876808d commit 0cd6e16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/io_uring.c
Expand Up @@ -653,7 +653,7 @@ struct io_unlink {
struct io_completion {
struct file *file;
struct list_head list;
int cflags;
u32 cflags;
};

struct io_async_connect {
Expand Down Expand Up @@ -1476,7 +1476,8 @@ static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
return ret;
}

static void __io_cqring_fill_event(struct io_kiocb *req, long res, long cflags)
static void __io_cqring_fill_event(struct io_kiocb *req, long res,
unsigned int cflags)
{
struct io_ring_ctx *ctx = req->ctx;
struct io_uring_cqe *cqe;
Expand Down

0 comments on commit 0cd6e16

Please sign in to comment.