1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/pagemap.h>
4 
5 struct io_meta_state {
6 	u32			seed;
7 	struct iov_iter_state	iter_meta;
8 };
9 
10 struct io_async_rw {
11 	size_t				bytes_done;
12 	struct iovec			*free_iovec;
13 	struct_group(clear,
14 		struct iov_iter			iter;
15 		struct iov_iter_state		iter_state;
16 		struct iovec			fast_iov;
17 		int				free_iov_nr;
18 		/*
19 		 * wpq is for buffered io, while meta fields are used with
20 		 * direct io
21 		 */
22 		union {
23 			struct wait_page_queue		wpq;
24 			struct {
25 				struct uio_meta			meta;
26 				struct io_meta_state		meta_state;
27 			};
28 		};
29 	);
30 };
31 
32 int io_prep_read_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe);
33 int io_prep_write_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe);
34 int io_prep_readv(struct io_kiocb *req, const struct io_uring_sqe *sqe);
35 int io_prep_writev(struct io_kiocb *req, const struct io_uring_sqe *sqe);
36 int io_prep_read(struct io_kiocb *req, const struct io_uring_sqe *sqe);
37 int io_prep_write(struct io_kiocb *req, const struct io_uring_sqe *sqe);
38 int io_read(struct io_kiocb *req, unsigned int issue_flags);
39 int io_write(struct io_kiocb *req, unsigned int issue_flags);
40 void io_readv_writev_cleanup(struct io_kiocb *req);
41 void io_rw_fail(struct io_kiocb *req);
42 void io_req_rw_complete(struct io_kiocb *req, struct io_tw_state *ts);
43 int io_read_mshot_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
44 int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags);
45 void io_rw_cache_free(const void *entry);
46