summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-04-13 02:58:43 +0100
committerJens Axboe <axboe@kernel.dk>2021-04-13 09:37:55 -0600
commite31001a3abb81a2dba976b842b8ab65d123bca2a (patch)
treeef6b8b37fe9097d466fa305f1c4ffdad1de0d14f /fs/io_uring.c
parentfd9c7bc542dae7cca3b02c77f7863823d54ddee0 (diff)
downloadlwn-e31001a3abb81a2dba976b842b8ab65d123bca2a.tar.gz
lwn-e31001a3abb81a2dba976b842b8ab65d123bca2a.zip
io_uring: clean up io_poll_remove_waitqs()
Move some parts of io_poll_remove_waitqs() that are opcode independent. Looks better and stresses that both do __io_poll_remove_one(). Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/bbc717f82117cc335c89cbe67ec8d72608178732.1618278933.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.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 158ad55a6c14..1627d69a570c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5219,21 +5219,16 @@ static bool io_poll_remove_waitqs(struct io_kiocb *req)
bool do_complete;
io_poll_remove_double(req);
+ do_complete = __io_poll_remove_one(req, io_poll_get_single(req), true);
- if (req->opcode == IORING_OP_POLL_ADD) {
- do_complete = __io_poll_remove_one(req, &req->poll, true);
- } else {
+ if (req->opcode != IORING_OP_POLL_ADD && do_complete) {
struct async_poll *apoll = req->apoll;
/* non-poll requests have submit ref still */
- do_complete = __io_poll_remove_one(req, &apoll->poll, true);
- if (do_complete) {
- req_ref_put(req);
- kfree(apoll->double_poll);
- kfree(apoll);
- }
+ req_ref_put(req);
+ kfree(apoll->double_poll);
+ kfree(apoll);
}
-
return do_complete;
}