mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
fd9c7bc542
commit
e31001a3ab
|
@ -5219,21 +5219,16 @@ static bool io_poll_remove_waitqs(struct io_kiocb *req)
|
||||||
bool do_complete;
|
bool do_complete;
|
||||||
|
|
||||||
io_poll_remove_double(req);
|
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) {
|
if (req->opcode != IORING_OP_POLL_ADD && do_complete) {
|
||||||
do_complete = __io_poll_remove_one(req, &req->poll, true);
|
|
||||||
} else {
|
|
||||||
struct async_poll *apoll = req->apoll;
|
struct async_poll *apoll = req->apoll;
|
||||||
|
|
||||||
/* non-poll requests have submit ref still */
|
/* non-poll requests have submit ref still */
|
||||||
do_complete = __io_poll_remove_one(req, &apoll->poll, true);
|
req_ref_put(req);
|
||||||
if (do_complete) {
|
kfree(apoll->double_poll);
|
||||||
req_ref_put(req);
|
kfree(apoll);
|
||||||
kfree(apoll->double_poll);
|
|
||||||
kfree(apoll);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return do_complete;
|
return do_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue