mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
io_uring/rsrc: remove node assignment helpers
There are two helpers here, one assigns and increments the node ref count, and the other is simply a wrapper around that for the buffer node handling. The buffer node assignment benefits from checking and setting REQ_F_BUF_NODE together, otherwise stalls have been observed on setting that flag later in the process. Hence re-do it so that it's set when checked, and cleared in case of (unlikely) failure. With that, the buffer node helper can go, and then drop the generic io_req_assign_rsrc_node() helper as well as there's only a single user of it left at that point. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -127,20 +127,6 @@ static inline void io_req_put_rsrc_nodes(struct io_kiocb *req)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void io_req_assign_rsrc_node(struct io_rsrc_node **dst_node,
|
||||
struct io_rsrc_node *node)
|
||||
{
|
||||
node->refs++;
|
||||
*dst_node = node;
|
||||
}
|
||||
|
||||
static inline void io_req_assign_buf_node(struct io_kiocb *req,
|
||||
struct io_rsrc_node *node)
|
||||
{
|
||||
io_req_assign_rsrc_node(&req->buf_node, node);
|
||||
req->flags |= REQ_F_BUF_NODE;
|
||||
}
|
||||
|
||||
int io_files_update(struct io_kiocb *req, unsigned int issue_flags);
|
||||
int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user