From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 05/14] io_uring: inline io_free_req()
Date: Fri, 15 Apr 2022 22:08:24 +0100 [thread overview]
Message-ID: <ed114edef5c256a644f4839bb372df70d8df8e3f.1650056133.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Inline io_free_req() into its only user and remove an underscore prefix
from __io_free_req().
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 92d7c7a0d234..d872c9b5885d 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,
@@ -2332,7 +2331,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;
@@ -2676,12 +2675,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)
@@ -2770,15 +2763,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)
--
2.35.2
next prev parent reply other threads:[~2022-04-15 21:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-15 21:08 [PATCH 00/14] submission path refactoring Pavel Begunkov
2022-04-15 21:08 ` [PATCH 01/14] io_uring: clean poll tw PF_EXITING handling Pavel Begunkov
2022-04-15 21:08 ` [PATCH 02/14] io_uring: add a hepler for putting rsrc nodes Pavel Begunkov
2022-04-18 0:05 ` Jens Axboe
2022-04-18 1:22 ` Jens Axboe
2022-04-18 9:08 ` Pavel Begunkov
2022-04-15 21:08 ` [PATCH 03/14] io_uring: minor refactoring for some tw handlers Pavel Begunkov
2022-04-15 21:08 ` [PATCH 04/14] io_uring: kill io_put_req_deferred() Pavel Begunkov
2022-04-15 21:08 ` Pavel Begunkov [this message]
2022-04-15 21:08 ` [PATCH 06/14] io_uring: helper for prep+queuing linked timeouts Pavel Begunkov
2022-04-15 21:08 ` [PATCH 07/14] io_uring: inline io_queue_sqe() Pavel Begunkov
2022-04-15 21:08 ` [PATCH 08/14] io_uring: rename io_queue_async_work() Pavel Begunkov
2022-04-15 21:08 ` [PATCH 09/14] io_uring: refactor io_queue_sqe() Pavel Begunkov
2022-04-15 21:08 ` [PATCH 10/14] io_uring: introduce IO_REQ_LINK_FLAGS Pavel Begunkov
2022-04-15 21:08 ` [PATCH 11/14] io_uring: refactor lazy link fail Pavel Begunkov
2022-04-15 21:08 ` [PATCH 12/14] io_uring: refactor io_submit_sqe() Pavel Begunkov
2022-04-15 21:08 ` [PATCH 13/14] io_uring: inline io_req_complete_fail_submit() Pavel Begunkov
2022-04-15 21:08 ` [PATCH 14/14] io_uring: add data_race annotations Pavel Begunkov
2022-04-18 1:24 ` (subset) [PATCH 00/14] submission path refactoring Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed114edef5c256a644f4839bb372df70d8df8e3f.1650056133.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox