xref: /openbmc/linux/io_uring/cancel.h (revision d7b8b079)
17aaff708SJens Axboe // SPDX-License-Identifier: GPL-2.0
27aaff708SJens Axboe 
3ad163a7eSJens Axboe #include <linux/io_uring_types.h>
4ad163a7eSJens Axboe 
5ad163a7eSJens Axboe struct io_cancel_data {
6ad163a7eSJens Axboe 	struct io_ring_ctx *ctx;
7ad163a7eSJens Axboe 	union {
8ad163a7eSJens Axboe 		u64 data;
9ad163a7eSJens Axboe 		struct file *file;
10ad163a7eSJens Axboe 	};
11*d7b8b079SJens Axboe 	u8 opcode;
12ad163a7eSJens Axboe 	u32 flags;
13ad163a7eSJens Axboe 	int seq;
14ad163a7eSJens Axboe };
15ad163a7eSJens Axboe 
167aaff708SJens Axboe int io_async_cancel_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
177aaff708SJens Axboe int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags);
187aaff708SJens Axboe 
1988f52eaaSJens Axboe int io_try_cancel(struct io_uring_task *tctx, struct io_cancel_data *cd,
205d7943d9SPavel Begunkov 		  unsigned int issue_flags);
21e6f89be6SPavel Begunkov void init_hash_table(struct io_hash_table *table, unsigned size);
2278a861b9SJens Axboe 
2378a861b9SJens Axboe int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg);
24aa5cd116SJens Axboe bool io_cancel_req_match(struct io_kiocb *req, struct io_cancel_data *cd);
25