]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring: remove overflow param from io_post_aux_cqe
authorDylan Yudaken <dylany@meta.com>
Thu, 24 Nov 2022 09:35:58 +0000 (01:35 -0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 25 Nov 2022 13:10:04 +0000 (06:10 -0700)
The only call sites which would not allow overflow are also call sites
which would use the io_aux_cqe as they care about ordering.

So remove this parameter from io_post_aux_cqe.

Signed-off-by: Dylan Yudaken <dylany@meta.com>
Link: https://lore.kernel.org/r/20221124093559.3780686-9-dylany@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/msg_ring.c
io_uring/rsrc.c

index 03051e1fa02e818050ac519b9a0d1bd01b069c87..7ed9cbeb573f2ac14d3e8fdaa5d829af50dba58d 100644 (file)
@@ -820,9 +820,8 @@ static void __io_flush_post_cqes(struct io_ring_ctx *ctx)
        state->cqes_count = 0;
 }
 
-bool io_post_aux_cqe(struct io_ring_ctx *ctx,
-                    u64 user_data, s32 res, u32 cflags,
-                    bool allow_overflow)
+static bool __io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags,
+                             bool allow_overflow)
 {
        bool filled;
 
@@ -832,6 +831,11 @@ bool io_post_aux_cqe(struct io_ring_ctx *ctx,
        return filled;
 }
 
+bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags)
+{
+       return __io_post_aux_cqe(ctx, user_data, res, cflags, true);
+}
+
 bool io_aux_cqe(struct io_ring_ctx *ctx, bool defer, u64 user_data, s32 res, u32 cflags,
                bool allow_overflow)
 {
@@ -839,7 +843,7 @@ bool io_aux_cqe(struct io_ring_ctx *ctx, bool defer, u64 user_data, s32 res, u32
        unsigned int length;
 
        if (!defer)
-               return io_post_aux_cqe(ctx, user_data, res, cflags, allow_overflow);
+               return __io_post_aux_cqe(ctx, user_data, res, cflags, allow_overflow);
 
        length = ARRAY_SIZE(ctx->submit_state.cqes);
 
index 46694f40bf729f28445d5543928acf775898adc5..dcb8e3468f1d6001835a8eaed4c49efae671b608 100644 (file)
@@ -32,8 +32,7 @@ int __io_run_local_work(struct io_ring_ctx *ctx, bool *locked);
 int io_run_local_work(struct io_ring_ctx *ctx);
 void io_req_defer_failed(struct io_kiocb *req, s32 res);
 void io_req_complete_post(struct io_kiocb *req, unsigned issue_flags);
-bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags,
-                    bool allow_overflow);
+bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags);
 bool io_aux_cqe(struct io_ring_ctx *ctx, bool defer, u64 user_data, s32 res, u32 cflags,
                bool allow_overflow);
 void __io_commit_cqring_flush(struct io_ring_ctx *ctx);
index 90d2fc6fd80e4a04a291c91fc0e682b9974fb547..afb543aab9f6321f73ef1b68b7b1c19efcdd18e9 100644 (file)
@@ -31,7 +31,7 @@ static int io_msg_ring_data(struct io_kiocb *req)
        if (msg->src_fd || msg->dst_fd || msg->flags)
                return -EINVAL;
 
-       if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0, true))
+       if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0))
                return 0;
 
        return -EOVERFLOW;
@@ -116,7 +116,7 @@ static int io_msg_send_fd(struct io_kiocb *req, unsigned int issue_flags)
         * completes with -EOVERFLOW, then the sender must ensure that a
         * later IORING_OP_MSG_RING delivers the message.
         */
-       if (!io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0, true))
+       if (!io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0))
                ret = -EOVERFLOW;
 out_unlock:
        io_double_unlock_ctx(ctx, target_ctx, issue_flags);
index 187f1c83e7798ab3c58ace2b7a9a105bfad9e3cf..133608200769cc3b82768e3186d457d57c41c823 100644 (file)
@@ -170,10 +170,10 @@ static void __io_rsrc_put_work(struct io_rsrc_node *ref_node)
                if (prsrc->tag) {
                        if (ctx->flags & IORING_SETUP_IOPOLL) {
                                mutex_lock(&ctx->uring_lock);
-                               io_post_aux_cqe(ctx, prsrc->tag, 0, 0, true);
+                               io_post_aux_cqe(ctx, prsrc->tag, 0, 0);
                                mutex_unlock(&ctx->uring_lock);
                        } else {
-                               io_post_aux_cqe(ctx, prsrc->tag, 0, 0, true);
+                               io_post_aux_cqe(ctx, prsrc->tag, 0, 0);
                        }
                }