Lines Matching refs:iocb
229 struct kiocb *iocb, in xfs_ilock_iocb() argument
232 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_ilock_iocb()
234 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_ilock_iocb()
246 struct kiocb *iocb, in xfs_file_dio_read() argument
249 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_read()
252 trace_xfs_file_direct_read(iocb, to); in xfs_file_dio_read()
257 file_accessed(iocb->ki_filp); in xfs_file_dio_read()
259 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_dio_read()
262 ret = iomap_dio_rw(iocb, to, &xfs_read_iomap_ops, NULL, 0, 0); in xfs_file_dio_read()
270 struct kiocb *iocb, in xfs_file_dax_read() argument
273 struct xfs_inode *ip = XFS_I(iocb->ki_filp->f_mapping->host); in xfs_file_dax_read()
276 trace_xfs_file_dax_read(iocb, to); in xfs_file_dax_read()
281 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_dax_read()
284 ret = dax_iomap_rw(iocb, to, &xfs_read_iomap_ops); in xfs_file_dax_read()
287 file_accessed(iocb->ki_filp); in xfs_file_dax_read()
293 struct kiocb *iocb, in xfs_file_buffered_read() argument
296 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_buffered_read()
299 trace_xfs_file_buffered_read(iocb, to); in xfs_file_buffered_read()
301 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_buffered_read()
304 ret = generic_file_read_iter(iocb, to); in xfs_file_buffered_read()
312 struct kiocb *iocb, in xfs_file_read_iter() argument
315 struct inode *inode = file_inode(iocb->ki_filp); in xfs_file_read_iter()
325 ret = xfs_file_dax_read(iocb, to); in xfs_file_read_iter()
326 else if (iocb->ki_flags & IOCB_DIRECT) in xfs_file_read_iter()
327 ret = xfs_file_dio_read(iocb, to); in xfs_file_read_iter()
329 ret = xfs_file_buffered_read(iocb, to); in xfs_file_read_iter()
345 struct kiocb *iocb, in xfs_file_write_checks() argument
349 struct file *file = iocb->ki_filp; in xfs_file_write_checks()
358 error = generic_write_checks(iocb, from); in xfs_file_write_checks()
362 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_file_write_checks()
380 error = xfs_ilock_iocb(iocb, *iolock); in xfs_file_write_checks()
408 if (iocb->ki_pos <= i_size_read(inode)) in xfs_file_write_checks()
413 if (iocb->ki_pos > isize) { in xfs_file_write_checks()
416 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_write_checks()
439 trace_xfs_zero_eof(ip, isize, iocb->ki_pos - isize); in xfs_file_write_checks()
440 error = iomap_zero_range(inode, isize, iocb->ki_pos - isize, in xfs_file_write_checks()
453 struct kiocb *iocb, in xfs_dio_write_end_io() argument
458 struct inode *inode = file_inode(iocb->ki_filp); in xfs_dio_write_end_io()
460 loff_t offset = iocb->ki_pos; in xfs_dio_write_end_io()
548 struct kiocb *iocb, in xfs_file_dio_write_aligned() argument
554 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_dio_write_aligned()
557 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dio_write_aligned()
570 trace_xfs_file_direct_write(iocb, from); in xfs_file_dio_write_aligned()
571 ret = iomap_dio_rw(iocb, from, &xfs_direct_write_iomap_ops, in xfs_file_dio_write_aligned()
599 struct kiocb *iocb, in xfs_file_dio_write_unaligned() argument
613 if (iocb->ki_pos > isize || iocb->ki_pos + count >= isize) { in xfs_file_dio_write_unaligned()
615 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_dio_write_unaligned()
621 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_dio_write_unaligned()
630 trace_xfs_reflink_bounce_dio_write(iocb, from); in xfs_file_dio_write_unaligned()
635 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dio_write_unaligned()
648 trace_xfs_file_direct_write(iocb, from); in xfs_file_dio_write_unaligned()
649 ret = iomap_dio_rw(iocb, from, &xfs_direct_write_iomap_ops, in xfs_file_dio_write_unaligned()
657 if (ret == -EAGAIN && !(iocb->ki_flags & IOCB_NOWAIT)) { in xfs_file_dio_write_unaligned()
671 struct kiocb *iocb, in xfs_file_dio_write() argument
674 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_write()
679 if ((iocb->ki_pos | count) & target->bt_logical_sectormask) in xfs_file_dio_write()
681 if ((iocb->ki_pos | count) & ip->i_mount->m_blockmask) in xfs_file_dio_write()
682 return xfs_file_dio_write_unaligned(ip, iocb, from); in xfs_file_dio_write()
683 return xfs_file_dio_write_aligned(ip, iocb, from); in xfs_file_dio_write()
688 struct kiocb *iocb, in xfs_file_dax_write() argument
691 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_dax_write()
697 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_dax_write()
700 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dax_write()
704 pos = iocb->ki_pos; in xfs_file_dax_write()
706 trace_xfs_file_dax_write(iocb, from); in xfs_file_dax_write()
707 ret = dax_iomap_rw(iocb, from, &xfs_direct_write_iomap_ops); in xfs_file_dax_write()
708 if (ret > 0 && iocb->ki_pos > i_size_read(inode)) { in xfs_file_dax_write()
709 i_size_write(inode, iocb->ki_pos); in xfs_file_dax_write()
722 ret = generic_write_sync(iocb, ret); in xfs_file_dax_write()
729 struct kiocb *iocb, in xfs_file_buffered_write() argument
732 struct file *file = iocb->ki_filp; in xfs_file_buffered_write()
740 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_buffered_write()
747 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_buffered_write()
754 trace_xfs_file_buffered_write(iocb, from); in xfs_file_buffered_write()
755 ret = iomap_file_buffered_write(iocb, from, in xfs_file_buffered_write()
758 iocb->ki_pos += ret; in xfs_file_buffered_write()
795 ret = generic_write_sync(iocb, ret); in xfs_file_buffered_write()
802 struct kiocb *iocb, in xfs_file_write_iter() argument
805 struct file *file = iocb->ki_filp; in xfs_file_write_iter()
821 return xfs_file_dax_write(iocb, from); in xfs_file_write_iter()
823 if (iocb->ki_flags & IOCB_DIRECT) { in xfs_file_write_iter()
830 ret = xfs_file_dio_write(iocb, from); in xfs_file_write_iter()
835 return xfs_file_buffered_write(iocb, from); in xfs_file_write_iter()