Lines Matching refs:iocb
344 static int zonefs_file_write_dio_end_io(struct kiocb *iocb, ssize_t size, in zonefs_file_write_dio_end_io() argument
347 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_write_dio_end_io()
355 if (!is_sync_kiocb(iocb)) in zonefs_file_write_dio_end_io()
369 if (i_size_read(inode) < iocb->ki_pos + size) { in zonefs_file_write_dio_end_io()
370 zonefs_update_stats(inode, iocb->ki_pos + size); in zonefs_file_write_dio_end_io()
371 zonefs_i_size_write(inode, iocb->ki_pos + size); in zonefs_file_write_dio_end_io()
412 static ssize_t zonefs_write_checks(struct kiocb *iocb, struct iov_iter *from) in zonefs_write_checks() argument
414 struct file *file = iocb->ki_filp; in zonefs_write_checks()
426 if ((iocb->ki_flags & IOCB_NOWAIT) && !(iocb->ki_flags & IOCB_DIRECT)) in zonefs_write_checks()
429 if (iocb->ki_flags & IOCB_APPEND) { in zonefs_write_checks()
433 iocb->ki_pos = z->z_wpoffset; in zonefs_write_checks()
437 count = zonefs_write_check_limits(file, iocb->ki_pos, in zonefs_write_checks()
456 static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) in zonefs_file_dio_write() argument
458 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_dio_write()
469 if (zonefs_zone_is_seq(z) && !is_sync_kiocb(iocb) && in zonefs_file_dio_write()
470 (iocb->ki_flags & IOCB_NOWAIT)) in zonefs_file_dio_write()
473 if (iocb->ki_flags & IOCB_NOWAIT) { in zonefs_file_dio_write()
480 count = zonefs_write_checks(iocb, from); in zonefs_file_dio_write()
486 if ((iocb->ki_pos | count) & (sb->s_blocksize - 1)) { in zonefs_file_dio_write()
494 if (iocb->ki_pos != z->z_wpoffset) { in zonefs_file_dio_write()
515 ret = iomap_dio_rw(iocb, from, &zonefs_write_iomap_ops, in zonefs_file_dio_write()
541 static ssize_t zonefs_file_buffered_write(struct kiocb *iocb, in zonefs_file_buffered_write() argument
544 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_buffered_write()
554 if (iocb->ki_flags & IOCB_NOWAIT) { in zonefs_file_buffered_write()
561 ret = zonefs_write_checks(iocb, from); in zonefs_file_buffered_write()
565 ret = iomap_file_buffered_write(iocb, from, &zonefs_write_iomap_ops); in zonefs_file_buffered_write()
572 ret = generic_write_sync(iocb, ret); in zonefs_file_buffered_write()
577 static ssize_t zonefs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) in zonefs_file_write_iter() argument
579 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_write_iter()
589 if (iocb->ki_pos >= z->z_capacity) in zonefs_file_write_iter()
592 if (iocb->ki_flags & IOCB_DIRECT) { in zonefs_file_write_iter()
593 ssize_t ret = zonefs_file_dio_write(iocb, from); in zonefs_file_write_iter()
599 return zonefs_file_buffered_write(iocb, from); in zonefs_file_write_iter()
602 static int zonefs_file_read_dio_end_io(struct kiocb *iocb, ssize_t size, in zonefs_file_read_dio_end_io() argument
606 zonefs_io_error(file_inode(iocb->ki_filp), false); in zonefs_file_read_dio_end_io()
617 static ssize_t zonefs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) in zonefs_file_read_iter() argument
619 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_read_iter()
630 if (iocb->ki_pos >= z->z_capacity) in zonefs_file_read_iter()
633 if (iocb->ki_flags & IOCB_NOWAIT) { in zonefs_file_read_iter()
643 if (iocb->ki_pos >= isize) { in zonefs_file_read_iter()
648 iov_iter_truncate(to, isize - iocb->ki_pos); in zonefs_file_read_iter()
651 if (iocb->ki_flags & IOCB_DIRECT) { in zonefs_file_read_iter()
654 if ((iocb->ki_pos | count) & (sb->s_blocksize - 1)) { in zonefs_file_read_iter()
658 file_accessed(iocb->ki_filp); in zonefs_file_read_iter()
659 ret = iomap_dio_rw(iocb, to, &zonefs_read_iomap_ops, in zonefs_file_read_iter()
662 ret = generic_file_read_iter(iocb, to); in zonefs_file_read_iter()