io_uring: make io_sqpoll_wait_sq return void
authorQuanfa Fu <quanfafu@gmail.com>
Sun, 15 Jan 2023 07:15:19 +0000 (15:15 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 29 Jan 2023 22:17:40 +0000 (15:17 -0700)
Change the return type to void since it always return 0, and no need
to do the checking in syscall io_uring_enter.

Signed-off-by: Quanfa Fu <quanfafu@gmail.com>
Link: https://lore.kernel.org/r/20230115071519.554282-1-quanfafu@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/sqpoll.c
io_uring/sqpoll.h

index 6533617462037feaa685550a4dbbf0f84c332807..8fddc010ffe29de6bd5920dcdf29185300906375 100644 (file)
@@ -3412,11 +3412,9 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
                }
                if (flags & IORING_ENTER_SQ_WAKEUP)
                        wake_up(&ctx->sq_data->wait);
-               if (flags & IORING_ENTER_SQ_WAIT) {
-                       ret = io_sqpoll_wait_sq(ctx);
-                       if (ret)
-                               goto out;
-               }
+               if (flags & IORING_ENTER_SQ_WAIT)
+                       io_sqpoll_wait_sq(ctx);
+
                ret = to_submit;
        } else if (to_submit) {
                ret = io_uring_add_tctx_node(ctx);
index 559652380672c08878264b9f9b17dc7ac831e12b..0119d3f1a55698a9958d26d9baadb68e3028141a 100644 (file)
@@ -312,7 +312,7 @@ static int io_sq_thread(void *data)
        do_exit(0);
 }
 
-int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
+void io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
 {
        DEFINE_WAIT(wait);
 
@@ -327,7 +327,6 @@ int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
        } while (!signal_pending(current));
 
        finish_wait(&ctx->sqo_sq_wait, &wait);
-       return 0;
 }
 
 __cold int io_sq_offload_create(struct io_ring_ctx *ctx,
index 0c3fbcd1f583f66fd69e1ba37dc9c42882eef6db..e1b8d508d22d155957f2754f21d2a57a252adcbc 100644 (file)
@@ -26,4 +26,4 @@ void io_sq_thread_stop(struct io_sq_data *sqd);
 void io_sq_thread_park(struct io_sq_data *sqd);
 void io_sq_thread_unpark(struct io_sq_data *sqd);
 void io_put_sq_data(struct io_sq_data *sqd);
-int io_sqpoll_wait_sq(struct io_ring_ctx *ctx);
+void io_sqpoll_wait_sq(struct io_ring_ctx *ctx);