Lines Matching refs:iocb

35 static ssize_t ext2_dax_read_iter(struct kiocb *iocb, struct iov_iter *to)  in ext2_dax_read_iter()  argument
37 struct inode *inode = iocb->ki_filp->f_mapping->host; in ext2_dax_read_iter()
44 ret = dax_iomap_rw(iocb, to, &ext2_iomap_ops); in ext2_dax_read_iter()
47 file_accessed(iocb->ki_filp); in ext2_dax_read_iter()
51 static ssize_t ext2_dax_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext2_dax_write_iter() argument
53 struct file *file = iocb->ki_filp; in ext2_dax_write_iter()
58 ret = generic_write_checks(iocb, from); in ext2_dax_write_iter()
68 ret = dax_iomap_rw(iocb, from, &ext2_iomap_ops); in ext2_dax_write_iter()
69 if (ret > 0 && iocb->ki_pos > i_size_read(inode)) { in ext2_dax_write_iter()
70 i_size_write(inode, iocb->ki_pos); in ext2_dax_write_iter()
77 ret = generic_write_sync(iocb, ret); in ext2_dax_write_iter()
166 static ssize_t ext2_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext2_dio_read_iter() argument
168 struct file *file = iocb->ki_filp; in ext2_dio_read_iter()
172 trace_ext2_dio_read_begin(iocb, to, 0); in ext2_dio_read_iter()
174 ret = iomap_dio_rw(iocb, to, &ext2_iomap_ops, NULL, 0, NULL, 0); in ext2_dio_read_iter()
176 trace_ext2_dio_read_end(iocb, to, ret); in ext2_dio_read_iter()
181 static int ext2_dio_write_end_io(struct kiocb *iocb, ssize_t size, in ext2_dio_write_end_io() argument
184 loff_t pos = iocb->ki_pos; in ext2_dio_write_end_io()
185 struct inode *inode = file_inode(iocb->ki_filp); in ext2_dio_write_end_io()
204 trace_ext2_dio_write_endio(iocb, size, error); in ext2_dio_write_end_io()
212 static ssize_t ext2_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext2_dio_write_iter() argument
214 struct file *file = iocb->ki_filp; in ext2_dio_write_iter()
219 loff_t offset = iocb->ki_pos; in ext2_dio_write_iter()
223 trace_ext2_dio_write_begin(iocb, from, 0); in ext2_dio_write_iter()
225 ret = generic_write_checks(iocb, from); in ext2_dio_write_iter()
229 ret = kiocb_modified(iocb); in ext2_dio_write_iter()
234 if (iocb->ki_pos + iov_iter_count(from) > i_size_read(inode) || in ext2_dio_write_iter()
235 (!IS_ALIGNED(iocb->ki_pos | iov_iter_alignment(from), blocksize))) in ext2_dio_write_iter()
238 ret = iomap_dio_rw(iocb, from, &ext2_iomap_ops, &ext2_dio_write_ops, in ext2_dio_write_iter()
253 iocb->ki_flags &= ~IOCB_DIRECT; in ext2_dio_write_iter()
254 pos = iocb->ki_pos; in ext2_dio_write_iter()
255 status = generic_perform_write(iocb, from); in ext2_dio_write_iter()
270 generic_write_sync(iocb, ret); in ext2_dio_write_iter()
276 trace_ext2_dio_write_buff_end(iocb, from, status); in ext2_dio_write_iter()
277 trace_ext2_dio_write_end(iocb, from, ret); in ext2_dio_write_iter()
281 static ssize_t ext2_file_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext2_file_read_iter() argument
284 if (IS_DAX(iocb->ki_filp->f_mapping->host)) in ext2_file_read_iter()
285 return ext2_dax_read_iter(iocb, to); in ext2_file_read_iter()
287 if (iocb->ki_flags & IOCB_DIRECT) in ext2_file_read_iter()
288 return ext2_dio_read_iter(iocb, to); in ext2_file_read_iter()
290 return generic_file_read_iter(iocb, to); in ext2_file_read_iter()
293 static ssize_t ext2_file_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext2_file_write_iter() argument
296 if (IS_DAX(iocb->ki_filp->f_mapping->host)) in ext2_file_write_iter()
297 return ext2_dax_write_iter(iocb, from); in ext2_file_write_iter()
299 if (iocb->ki_flags & IOCB_DIRECT) in ext2_file_write_iter()
300 return ext2_dio_write_iter(iocb, from); in ext2_file_write_iter()
302 return generic_file_write_iter(iocb, from); in ext2_file_write_iter()