io_uring: remove 'issue_flags' argument for io_req_set_rsrc_node()
authorJens Axboe <axboe@kernel.dk>
Wed, 23 Oct 2024 13:14:22 +0000 (07:14 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Oct 2024 19:43:27 +0000 (13:43 -0600)
All callers already hold the ring lock and hence are passing '0',
remove the argument and the conditional locking that it controlled.

Suggested-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c
io_uring/rsrc.h
io_uring/rw.c
io_uring/uring_cmd.c

index 18507658a921d7b38c57c7a9f5abac38d84e924c..fb1f2c37f7d19c09f81bfbab5480f9518bd95e7b 100644 (file)
@@ -1261,7 +1261,7 @@ int io_send_zc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
                        return -EFAULT;
                idx = array_index_nospec(idx, ctx->nr_user_bufs);
                req->imu = READ_ONCE(ctx->user_bufs[idx]);
-               io_req_set_rsrc_node(notif, ctx, 0);
+               io_req_set_rsrc_node(notif, ctx);
        }
 
        if (req->opcode == IORING_OP_SEND_ZC) {
index 8ed58803621027a1d4d9d9b43a142823a46c3417..c50d4be4aa6dc0a267e05420c907f514ced53b42 100644 (file)
@@ -107,14 +107,10 @@ static inline void __io_req_set_rsrc_node(struct io_kiocb *req,
 }
 
 static inline void io_req_set_rsrc_node(struct io_kiocb *req,
-                                       struct io_ring_ctx *ctx,
-                                       unsigned int issue_flags)
+                                       struct io_ring_ctx *ctx)
 {
-       if (!req->rsrc_node) {
-               io_ring_submit_lock(ctx, issue_flags);
+       if (!req->rsrc_node)
                __io_req_set_rsrc_node(req, ctx);
-               io_ring_submit_unlock(ctx, issue_flags);
-       }
 }
 
 static inline u64 *io_get_tag_slot(struct io_rsrc_data *data, unsigned int idx)
index d8b9e7a712f61410b0243218e6b9853737aefc36..8080ffd6d571251bdfb05c82bd821392c5da9800 100644 (file)
@@ -343,7 +343,7 @@ static int io_prep_rw_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe
                return -EFAULT;
        index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
        imu = ctx->user_bufs[index];
-       io_req_set_rsrc_node(req, ctx, 0);
+       io_req_set_rsrc_node(req, ctx);
 
        io = req->async_data;
        ret = io_import_fixed(ddir, &io->iter, imu, rw->addr, rw->len);
index 58d0b817d6ea1ac61ececa2b740f87c55a5af5a1..6994f60d7ec727fc326b1ba8f80b92da3ae99d64 100644 (file)
@@ -220,7 +220,7 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
                 * being called. This prevents destruction of the mapped buffer
                 * we'll need at actual import time.
                 */
-               io_req_set_rsrc_node(req, ctx, 0);
+               io_req_set_rsrc_node(req, ctx);
        }
        ioucmd->cmd_op = READ_ONCE(sqe->cmd_op);