]> git.baikalelectronics.ru Git - kernel.git/commitdiff
io_uring: cleanup io_import_fixed()
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 25 Nov 2019 20:14:40 +0000 (23:14 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 22:02:56 +0000 (15:02 -0700)
Clean io_import_fixed() call site and make it return proper type.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index c846605b8361ef983c38e46939b3edc1fcc8d9d5..e44b0e01f1b5710c9641a17cf6721a7c0e599049 100644 (file)
@@ -1490,9 +1490,9 @@ static void kiocb_done(struct kiocb *kiocb, ssize_t ret, struct io_kiocb **nxt,
                io_rw_done(kiocb, ret);
 }
 
-static int io_import_fixed(struct io_ring_ctx *ctx, int rw,
-                          const struct io_uring_sqe *sqe,
-                          struct iov_iter *iter)
+static ssize_t io_import_fixed(struct io_ring_ctx *ctx, int rw,
+                              const struct io_uring_sqe *sqe,
+                              struct iov_iter *iter)
 {
        size_t len = READ_ONCE(sqe->len);
        struct io_mapped_ubuf *imu;
@@ -1581,11 +1581,9 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
         * flag.
         */
        opcode = READ_ONCE(sqe->opcode);
-       if (opcode == IORING_OP_READ_FIXED ||
-           opcode == IORING_OP_WRITE_FIXED) {
-               ssize_t ret = io_import_fixed(req->ctx, rw, sqe, iter);
+       if (opcode == IORING_OP_READ_FIXED || opcode == IORING_OP_WRITE_FIXED) {
                *iovec = NULL;
-               return ret;
+               return io_import_fixed(req->ctx, rw, sqe, iter);
        }
 
        if (!req->has_user)