Lines Matching refs:iocb
52 static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext4_dio_read_iter() argument
55 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dio_read_iter()
57 if (iocb->ki_flags & IOCB_NOWAIT) { in ext4_dio_read_iter()
73 iocb->ki_flags &= ~IOCB_DIRECT; in ext4_dio_read_iter()
74 return generic_file_read_iter(iocb, to); in ext4_dio_read_iter()
77 ret = iomap_dio_rw(iocb, to, &ext4_iomap_ops, NULL, 0, 0); in ext4_dio_read_iter()
80 file_accessed(iocb->ki_filp); in ext4_dio_read_iter()
85 static ssize_t ext4_dax_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext4_dax_read_iter() argument
87 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dax_read_iter()
90 if (iocb->ki_flags & IOCB_NOWAIT) { in ext4_dax_read_iter()
103 return generic_file_read_iter(iocb, to); in ext4_dax_read_iter()
105 ret = dax_iomap_rw(iocb, to, &ext4_iomap_ops); in ext4_dax_read_iter()
108 file_accessed(iocb->ki_filp); in ext4_dax_read_iter()
113 static ssize_t ext4_file_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext4_file_read_iter() argument
115 struct inode *inode = file_inode(iocb->ki_filp); in ext4_file_read_iter()
125 return ext4_dax_read_iter(iocb, to); in ext4_file_read_iter()
127 if (iocb->ki_flags & IOCB_DIRECT) in ext4_file_read_iter()
128 return ext4_dio_read_iter(iocb, to); in ext4_file_read_iter()
130 return generic_file_read_iter(iocb, to); in ext4_file_read_iter()
211 static ssize_t ext4_generic_write_checks(struct kiocb *iocb, in ext4_generic_write_checks() argument
214 struct inode *inode = file_inode(iocb->ki_filp); in ext4_generic_write_checks()
220 ret = generic_write_checks(iocb, from); in ext4_generic_write_checks()
231 if (iocb->ki_pos >= sbi->s_bitmap_maxbytes) in ext4_generic_write_checks()
233 iov_iter_truncate(from, sbi->s_bitmap_maxbytes - iocb->ki_pos); in ext4_generic_write_checks()
239 static ssize_t ext4_write_checks(struct kiocb *iocb, struct iov_iter *from) in ext4_write_checks() argument
243 count = ext4_generic_write_checks(iocb, from); in ext4_write_checks()
247 ret = file_modified(iocb->ki_filp); in ext4_write_checks()
253 static ssize_t ext4_buffered_write_iter(struct kiocb *iocb, in ext4_buffered_write_iter() argument
257 struct inode *inode = file_inode(iocb->ki_filp); in ext4_buffered_write_iter()
259 if (iocb->ki_flags & IOCB_NOWAIT) in ext4_buffered_write_iter()
264 ret = ext4_write_checks(iocb, from); in ext4_buffered_write_iter()
269 ret = generic_perform_write(iocb->ki_filp, from, iocb->ki_pos); in ext4_buffered_write_iter()
276 iocb->ki_pos += ret; in ext4_buffered_write_iter()
277 ret = generic_write_sync(iocb, ret); in ext4_buffered_write_iter()
371 static int ext4_dio_write_end_io(struct kiocb *iocb, ssize_t size, in ext4_dio_write_end_io() argument
374 loff_t pos = iocb->ki_pos; in ext4_dio_write_end_io()
375 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dio_write_end_io()
422 static ssize_t ext4_dio_write_checks(struct kiocb *iocb, struct iov_iter *from, in ext4_dio_write_checks() argument
425 struct file *file = iocb->ki_filp; in ext4_dio_write_checks()
432 ret = ext4_generic_write_checks(iocb, from); in ext4_dio_write_checks()
436 offset = iocb->ki_pos; in ext4_dio_write_checks()
448 if (iocb->ki_flags & IOCB_NOWAIT) { in ext4_dio_write_checks()
471 static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext4_dio_write_iter() argument
475 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dio_write_iter()
476 loff_t offset = iocb->ki_pos; in ext4_dio_write_iter()
498 if (iocb->ki_flags & IOCB_NOWAIT) { in ext4_dio_write_iter()
519 return ext4_buffered_write_iter(iocb, from); in ext4_dio_write_iter()
522 ret = ext4_dio_write_checks(iocb, from, &ilock_shared, &extend); in ext4_dio_write_iter()
527 if ((iocb->ki_flags & IOCB_NOWAIT) && (unaligned_io || extend)) { in ext4_dio_write_iter()
532 offset = iocb->ki_pos; in ext4_dio_write_iter()
568 ret = iomap_dio_rw(iocb, from, iomap_ops, &ext4_dio_write_ops, in ext4_dio_write_iter()
587 offset = iocb->ki_pos; in ext4_dio_write_iter()
588 err = ext4_buffered_write_iter(iocb, from); in ext4_dio_write_iter()
601 err = filemap_write_and_wait_range(iocb->ki_filp->f_mapping, in ext4_dio_write_iter()
604 invalidate_mapping_pages(iocb->ki_filp->f_mapping, in ext4_dio_write_iter()
614 ext4_dax_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext4_dax_write_iter() argument
621 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dax_write_iter()
623 if (iocb->ki_flags & IOCB_NOWAIT) { in ext4_dax_write_iter()
630 ret = ext4_write_checks(iocb, from); in ext4_dax_write_iter()
634 offset = iocb->ki_pos; in ext4_dax_write_iter()
654 ret = dax_iomap_rw(iocb, from, &ext4_iomap_ops); in ext4_dax_write_iter()
661 ret = generic_write_sync(iocb, ret); in ext4_dax_write_iter()
667 ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext4_file_write_iter() argument
669 struct inode *inode = file_inode(iocb->ki_filp); in ext4_file_write_iter()
676 return ext4_dax_write_iter(iocb, from); in ext4_file_write_iter()
678 if (iocb->ki_flags & IOCB_DIRECT) in ext4_file_write_iter()
679 return ext4_dio_write_iter(iocb, from); in ext4_file_write_iter()
681 return ext4_buffered_write_iter(iocb, from); in ext4_file_write_iter()