summaryrefslogblamecommitdiff
path: root/io_uring/rw.h
blob: f7905070d10b563a9ae970120fa0b52d65e854ae (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                              



                                                   
                                          
                                                    


                                            





                                                                              
                                                            
                                                             
                                                   
                                      
                                                                      

                                                                             
                                                    
// SPDX-License-Identifier: GPL-2.0

#include <linux/pagemap.h>

struct io_rw_state {
	struct iov_iter			iter;
	struct iov_iter_state		iter_state;
	struct iovec			fast_iov[UIO_FASTIOV];
};

struct io_async_rw {
	union {
		size_t			bytes_done;
		struct io_cache_entry	cache;
	};
	struct io_rw_state		s;
	struct iovec			*free_iovec;
	struct wait_page_queue		wpq;
};

int io_prep_read_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_prep_write_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_prep_readv(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_prep_writev(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_prep_read(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_prep_write(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_read(struct io_kiocb *req, unsigned int issue_flags);
int io_write(struct io_kiocb *req, unsigned int issue_flags);
void io_readv_writev_cleanup(struct io_kiocb *req);
void io_rw_fail(struct io_kiocb *req);
void io_req_rw_complete(struct io_kiocb *req, struct io_tw_state *ts);
int io_read_mshot_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags);
void io_rw_cache_free(struct io_cache_entry *entry);