mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
io_uring: remove 'issue_flags' argument for io_req_set_rsrc_node()
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>
This commit is contained in:
parent
003f82b58c
commit
1caa00d6b6
4 changed files with 5 additions and 9 deletions
|
@ -1261,7 +1261,7 @@ int io_send_zc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
idx = array_index_nospec(idx, ctx->nr_user_bufs);
|
idx = array_index_nospec(idx, ctx->nr_user_bufs);
|
||||||
req->imu = READ_ONCE(ctx->user_bufs[idx]);
|
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) {
|
if (req->opcode == IORING_OP_SEND_ZC) {
|
||||||
|
|
|
@ -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,
|
static inline void io_req_set_rsrc_node(struct io_kiocb *req,
|
||||||
struct io_ring_ctx *ctx,
|
struct io_ring_ctx *ctx)
|
||||||
unsigned int issue_flags)
|
|
||||||
{
|
{
|
||||||
if (!req->rsrc_node) {
|
if (!req->rsrc_node)
|
||||||
io_ring_submit_lock(ctx, issue_flags);
|
|
||||||
__io_req_set_rsrc_node(req, ctx);
|
__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)
|
static inline u64 *io_get_tag_slot(struct io_rsrc_data *data, unsigned int idx)
|
||||||
|
|
|
@ -343,7 +343,7 @@ static int io_prep_rw_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
|
index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
|
||||||
imu = ctx->user_bufs[index];
|
imu = ctx->user_bufs[index];
|
||||||
io_req_set_rsrc_node(req, ctx, 0);
|
io_req_set_rsrc_node(req, ctx);
|
||||||
|
|
||||||
io = req->async_data;
|
io = req->async_data;
|
||||||
ret = io_import_fixed(ddir, &io->iter, imu, rw->addr, rw->len);
|
ret = io_import_fixed(ddir, &io->iter, imu, rw->addr, rw->len);
|
||||||
|
|
|
@ -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
|
* being called. This prevents destruction of the mapped buffer
|
||||||
* we'll need at actual import time.
|
* 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);
|
ioucmd->cmd_op = READ_ONCE(sqe->cmd_op);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue