io_uring: move apoll cache to poll.c
[linux-block.git] / io_uring / poll.c
index 76592063abe7ba27e0d8db564976f0c320844c66..052fcb6472083ae00e0ca2140416845ce789b3cf 100644 (file)
@@ -959,3 +959,15 @@ out:
        io_req_set_res(req, ret, 0);
        return IOU_OK;
 }
+
+void io_flush_apoll_cache(struct io_ring_ctx *ctx)
+{
+       struct async_poll *apoll;
+
+       while (!list_empty(&ctx->apoll_cache)) {
+               apoll = list_first_entry(&ctx->apoll_cache, struct async_poll,
+                                               poll.wait.entry);
+               list_del(&apoll->poll.wait.entry);
+               kfree(apoll);
+       }
+}