Commit e0c5c576 authored by Jens Axboe's avatar Jens Axboe

io_uring: make io_read/write return an integer

The callers all convert to an integer, and we only return 0/-ERROR
anyway.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e65ef56d
...@@ -893,7 +893,7 @@ static int io_import_iovec(struct io_ring_ctx *ctx, int rw, ...@@ -893,7 +893,7 @@ static int io_import_iovec(struct io_ring_ctx *ctx, int rw,
opcode = READ_ONCE(sqe->opcode); opcode = READ_ONCE(sqe->opcode);
if (opcode == IORING_OP_READ_FIXED || if (opcode == IORING_OP_READ_FIXED ||
opcode == IORING_OP_WRITE_FIXED) { opcode == IORING_OP_WRITE_FIXED) {
ssize_t ret = io_import_fixed(ctx, rw, sqe, iter); int ret = io_import_fixed(ctx, rw, sqe, iter);
*iovec = NULL; *iovec = NULL;
return ret; return ret;
} }
...@@ -951,7 +951,7 @@ static void io_async_list_note(int rw, struct io_kiocb *req, size_t len) ...@@ -951,7 +951,7 @@ static void io_async_list_note(int rw, struct io_kiocb *req, size_t len)
async_list->io_end = io_end; async_list->io_end = io_end;
} }
static ssize_t io_read(struct io_kiocb *req, const struct sqe_submit *s, static int io_read(struct io_kiocb *req, const struct sqe_submit *s,
bool force_nonblock, struct io_submit_state *state) bool force_nonblock, struct io_submit_state *state)
{ {
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs; struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
...@@ -959,7 +959,7 @@ static ssize_t io_read(struct io_kiocb *req, const struct sqe_submit *s, ...@@ -959,7 +959,7 @@ static ssize_t io_read(struct io_kiocb *req, const struct sqe_submit *s,
struct iov_iter iter; struct iov_iter iter;
struct file *file; struct file *file;
size_t iov_count; size_t iov_count;
ssize_t ret; int ret;
ret = io_prep_rw(req, s, force_nonblock, state); ret = io_prep_rw(req, s, force_nonblock, state);
if (ret) if (ret)
...@@ -1004,7 +1004,7 @@ static ssize_t io_read(struct io_kiocb *req, const struct sqe_submit *s, ...@@ -1004,7 +1004,7 @@ static ssize_t io_read(struct io_kiocb *req, const struct sqe_submit *s,
return ret; return ret;
} }
static ssize_t io_write(struct io_kiocb *req, const struct sqe_submit *s, static int io_write(struct io_kiocb *req, const struct sqe_submit *s,
bool force_nonblock, struct io_submit_state *state) bool force_nonblock, struct io_submit_state *state)
{ {
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs; struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
...@@ -1012,7 +1012,7 @@ static ssize_t io_write(struct io_kiocb *req, const struct sqe_submit *s, ...@@ -1012,7 +1012,7 @@ static ssize_t io_write(struct io_kiocb *req, const struct sqe_submit *s,
struct iov_iter iter; struct iov_iter iter;
struct file *file; struct file *file;
size_t iov_count; size_t iov_count;
ssize_t ret; int ret;
ret = io_prep_rw(req, s, force_nonblock, state); ret = io_prep_rw(req, s, force_nonblock, state);
if (ret) if (ret)
...@@ -1396,8 +1396,7 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req, ...@@ -1396,8 +1396,7 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
const struct sqe_submit *s, bool force_nonblock, const struct sqe_submit *s, bool force_nonblock,
struct io_submit_state *state) struct io_submit_state *state)
{ {
ssize_t ret; int ret, opcode;
int opcode;
if (unlikely(s->index >= ctx->sq_entries)) if (unlikely(s->index >= ctx->sq_entries))
return -EINVAL; return -EINVAL;
...@@ -1623,7 +1622,7 @@ static int io_submit_sqe(struct io_ring_ctx *ctx, struct sqe_submit *s, ...@@ -1623,7 +1622,7 @@ static int io_submit_sqe(struct io_ring_ctx *ctx, struct sqe_submit *s,
struct io_submit_state *state) struct io_submit_state *state)
{ {
struct io_kiocb *req; struct io_kiocb *req;
ssize_t ret; int ret;
/* enforce forwards compatibility on users */ /* enforce forwards compatibility on users */
if (unlikely(s->sqe->flags & ~IOSQE_FIXED_FILE)) if (unlikely(s->sqe->flags & ~IOSQE_FIXED_FILE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment