summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJackie Liu <liuyun01@kylinos.cn>2019-11-09 11:00:08 +0800
committerJens Axboe <axboe@kernel.dk>2019-11-10 20:29:49 -0700
commitc69f8dbe2426cbf6150407b7e86ce85bb463c1dc (patch)
tree83ded8132621d8c8eefd0089e5d88532a41e7020 /fs/io_uring.c
parentec9c02ad4c3808d6d9ed28ad1d0485d6e2a33ac5 (diff)
downloadlwn-c69f8dbe2426cbf6150407b7e86ce85bb463c1dc.tar.gz
lwn-c69f8dbe2426cbf6150407b7e86ce85bb463c1dc.zip
io_uring: separate the io_free_req and io_free_req_find_next interface
Similar to the distinction between io_put_req and io_put_req_find_next, io_free_req has been modified similarly, with no functional changes. Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 1597838d5073..2b4257a965db 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -883,7 +883,7 @@ static void io_fail_links(struct io_kiocb *req)
io_cqring_ev_posted(ctx);
}
-static void io_free_req(struct io_kiocb *req, struct io_kiocb **nxt)
+static void io_free_req_find_next(struct io_kiocb *req, struct io_kiocb **nxt)
{
if (likely(!(req->flags & REQ_F_LINK))) {
__io_free_req(req);
@@ -917,6 +917,11 @@ static void io_free_req(struct io_kiocb *req, struct io_kiocb **nxt)
__io_free_req(req);
}
+static void io_free_req(struct io_kiocb *req)
+{
+ io_free_req_find_next(req, NULL);
+}
+
/*
* Drop reference to request, return next in chain (if there is one) if this
* was the last reference to this request.
@@ -926,7 +931,7 @@ static void io_put_req_find_next(struct io_kiocb *req, struct io_kiocb **nxtptr)
struct io_kiocb *nxt = NULL;
if (refcount_dec_and_test(&req->refs))
- io_free_req(req, &nxt);
+ io_free_req_find_next(req, &nxt);
if (nxt) {
if (nxtptr)
@@ -939,7 +944,7 @@ static void io_put_req_find_next(struct io_kiocb *req, struct io_kiocb **nxtptr)
static void io_put_req(struct io_kiocb *req)
{
if (refcount_dec_and_test(&req->refs))
- io_free_req(req, NULL);
+ io_free_req(req);
}
static void io_double_put_req(struct io_kiocb *req)
@@ -1006,7 +1011,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
if (to_free == ARRAY_SIZE(reqs))
io_free_req_many(ctx, reqs, &to_free);
} else {
- io_free_req(req, NULL);
+ io_free_req(req);
}
}
}