diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-04-15 22:08:24 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-24 18:02:49 -0600 |
commit | f5c6cf2a310d8de3bd02aa8a217f8ca63df6f236 (patch) | |
tree | 26e891dae965edd8d6c35b9d1e5b92159fe2ea7d /fs/io_uring.c | |
parent | 4e118cd9e9e609c805822ee423aa23ae406e7da0 (diff) | |
download | lwn-f5c6cf2a310d8de3bd02aa8a217f8ca63df6f236.tar.gz lwn-f5c6cf2a310d8de3bd02aa8a217f8ca63df6f236.zip |
io_uring: inline io_free_req()
Inline io_free_req() into its only user and remove an underscore prefix
from __io_free_req().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/ed114edef5c256a644f4839bb372df70d8df8e3f.1650056133.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index df29a9365c2b..e9f0c89280cd 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1189,7 +1189,6 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx, static void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd); static void __io_req_complete_post(struct io_kiocb *req, s32 res, u32 cflags); -static void io_put_req(struct io_kiocb *req); static void io_dismantle_req(struct io_kiocb *req); static void io_queue_linked_timeout(struct io_kiocb *req); static int __io_register_rsrc_update(struct io_ring_ctx *ctx, unsigned type, @@ -2328,7 +2327,7 @@ static inline void io_dismantle_req(struct io_kiocb *req) io_put_file(req->file); } -static __cold void __io_free_req(struct io_kiocb *req) +static __cold void io_free_req(struct io_kiocb *req) { struct io_ring_ctx *ctx = req->ctx; @@ -2685,12 +2684,6 @@ static void io_queue_next(struct io_kiocb *req) io_req_task_queue(nxt); } -static void io_free_req(struct io_kiocb *req) -{ - io_queue_next(req); - __io_free_req(req); -} - static void io_free_batch_list(struct io_ring_ctx *ctx, struct io_wq_work_node *node) __must_hold(&ctx->uring_lock) @@ -2779,15 +2772,17 @@ static inline struct io_kiocb *io_put_req_find_next(struct io_kiocb *req) if (req_ref_put_and_test(req)) { if (unlikely(req->flags & (REQ_F_LINK|REQ_F_HARDLINK))) nxt = io_req_find_next(req); - __io_free_req(req); + io_free_req(req); } return nxt; } static inline void io_put_req(struct io_kiocb *req) { - if (req_ref_put_and_test(req)) + if (req_ref_put_and_test(req)) { + io_queue_next(req); io_free_req(req); + } } static unsigned io_cqring_events(struct io_ring_ctx *ctx) |