2022-05-26 05:31:09 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
2022-07-07 23:16:20 +03:00
|
|
|
#include "alloc_cache.h"
|
|
|
|
|
2022-05-26 05:31:09 +03:00
|
|
|
enum {
|
|
|
|
IO_APOLL_OK,
|
|
|
|
IO_APOLL_ABORTED,
|
|
|
|
IO_APOLL_READY
|
|
|
|
};
|
|
|
|
|
|
|
|
struct io_poll {
|
|
|
|
struct file *file;
|
|
|
|
struct wait_queue_head *head;
|
|
|
|
__poll_t events;
|
|
|
|
struct wait_queue_entry wait;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct async_poll {
|
2022-07-07 23:16:20 +03:00
|
|
|
union {
|
|
|
|
struct io_poll poll;
|
|
|
|
struct io_cache_entry cache;
|
|
|
|
};
|
2022-05-26 05:31:09 +03:00
|
|
|
struct io_poll *double_poll;
|
|
|
|
};
|
|
|
|
|
|
|
|
int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
|
|
|
|
int io_poll_add(struct io_kiocb *req, unsigned int issue_flags);
|
|
|
|
|
|
|
|
int io_poll_remove_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
|
|
|
|
int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags);
|
|
|
|
|
2022-06-19 04:44:33 +03:00
|
|
|
struct io_cancel_data;
|
2022-06-16 12:22:11 +03:00
|
|
|
int io_poll_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
|
|
|
|
unsigned issue_flags);
|
2022-05-26 05:31:09 +03:00
|
|
|
int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags);
|
|
|
|
bool io_poll_remove_all(struct io_ring_ctx *ctx, struct task_struct *tsk,
|
|
|
|
bool cancel_all);
|
2022-07-07 20:18:33 +03:00
|
|
|
|
2022-07-07 23:16:20 +03:00
|
|
|
void io_apoll_cache_free(struct io_cache_entry *entry);
|