xref: /openbmc/linux/io_uring/rw.h (revision c92fcfc2)
1f3b44f92SJens Axboe // SPDX-License-Identifier: GPL-2.0
2f3b44f92SJens Axboe 
3f3b44f92SJens Axboe #include <linux/pagemap.h>
4f3b44f92SJens Axboe 
5f3b44f92SJens Axboe struct io_rw_state {
6f3b44f92SJens Axboe 	struct iov_iter			iter;
7f3b44f92SJens Axboe 	struct iov_iter_state		iter_state;
8f3b44f92SJens Axboe 	struct iovec			fast_iov[UIO_FASTIOV];
9f3b44f92SJens Axboe };
10f3b44f92SJens Axboe 
11f3b44f92SJens Axboe struct io_async_rw {
12f3b44f92SJens Axboe 	struct io_rw_state		s;
13f3b44f92SJens Axboe 	const struct iovec		*free_iovec;
14f3b44f92SJens Axboe 	size_t				bytes_done;
15f3b44f92SJens Axboe 	struct wait_page_queue		wpq;
16f3b44f92SJens Axboe };
17f3b44f92SJens Axboe 
18f3b44f92SJens Axboe int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe);
19f3b44f92SJens Axboe int io_read(struct io_kiocb *req, unsigned int issue_flags);
20f3b44f92SJens Axboe int io_readv_prep_async(struct io_kiocb *req);
21f3b44f92SJens Axboe int io_write(struct io_kiocb *req, unsigned int issue_flags);
22f3b44f92SJens Axboe int io_writev_prep_async(struct io_kiocb *req);
23f3b44f92SJens Axboe void io_readv_writev_cleanup(struct io_kiocb *req);
2447b4c686SPavel Begunkov void io_rw_fail(struct io_kiocb *req);
25*c92fcfc2SJens Axboe void io_req_rw_complete(struct io_kiocb *req, struct io_tw_state *ts);
26