Lines Matching refs:iocb

189 	struct kiocb		*iocb,  in xfs_ilock_iocb()  argument
192 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_ilock_iocb()
194 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_ilock_iocb()
206 struct kiocb *iocb, in xfs_ilock_iocb_for_write() argument
210 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_ilock_iocb_for_write()
212 ret = xfs_ilock_iocb(iocb, *lock_mode); in xfs_ilock_iocb_for_write()
224 return xfs_ilock_iocb(iocb, *lock_mode); in xfs_ilock_iocb_for_write()
232 struct kiocb *iocb, in xfs_file_dio_read() argument
235 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_read()
238 trace_xfs_file_direct_read(iocb, to); in xfs_file_dio_read()
243 file_accessed(iocb->ki_filp); in xfs_file_dio_read()
245 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_dio_read()
248 ret = iomap_dio_rw(iocb, to, &xfs_read_iomap_ops, NULL, 0, NULL, 0); in xfs_file_dio_read()
256 struct kiocb *iocb, in xfs_file_dax_read() argument
259 struct xfs_inode *ip = XFS_I(iocb->ki_filp->f_mapping->host); in xfs_file_dax_read()
262 trace_xfs_file_dax_read(iocb, to); in xfs_file_dax_read()
267 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_dax_read()
270 ret = dax_iomap_rw(iocb, to, &xfs_read_iomap_ops); in xfs_file_dax_read()
273 file_accessed(iocb->ki_filp); in xfs_file_dax_read()
279 struct kiocb *iocb, in xfs_file_buffered_read() argument
282 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_buffered_read()
285 trace_xfs_file_buffered_read(iocb, to); in xfs_file_buffered_read()
287 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_buffered_read()
290 ret = generic_file_read_iter(iocb, to); in xfs_file_buffered_read()
298 struct kiocb *iocb, in xfs_file_read_iter() argument
301 struct inode *inode = file_inode(iocb->ki_filp); in xfs_file_read_iter()
311 ret = xfs_file_dax_read(iocb, to); in xfs_file_read_iter()
312 else if (iocb->ki_flags & IOCB_DIRECT) in xfs_file_read_iter()
313 ret = xfs_file_dio_read(iocb, to); in xfs_file_read_iter()
315 ret = xfs_file_buffered_read(iocb, to); in xfs_file_read_iter()
359 struct kiocb *iocb, in xfs_file_write_zero_eof() argument
365 struct xfs_inode *ip = XFS_I(iocb->ki_filp->f_mapping->host); in xfs_file_write_zero_eof()
380 if (iocb->ki_pos <= isize) { in xfs_file_write_zero_eof()
386 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_write_zero_eof()
414 trace_xfs_zero_eof(ip, isize, iocb->ki_pos - isize); in xfs_file_write_zero_eof()
417 error = xfs_zero_range(ip, isize, iocb->ki_pos - isize, NULL); in xfs_file_write_zero_eof()
432 struct kiocb *iocb, in xfs_file_write_checks() argument
436 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_write_checks()
442 error = generic_write_checks(iocb, from); in xfs_file_write_checks()
446 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_file_write_checks()
464 error = xfs_ilock_iocb(iocb, *iolock); in xfs_file_write_checks()
482 if (iocb->ki_pos > i_size_read(inode)) { in xfs_file_write_checks()
483 error = xfs_file_write_zero_eof(iocb, from, iolock, count, in xfs_file_write_checks()
491 return kiocb_modified(iocb); in xfs_file_write_checks()
496 struct kiocb *iocb, in xfs_dio_write_end_io() argument
501 struct inode *inode = file_inode(iocb->ki_filp); in xfs_dio_write_end_io()
503 loff_t offset = iocb->ki_pos; in xfs_dio_write_end_io()
591 struct kiocb *iocb, in xfs_file_dio_write_aligned() argument
597 ret = xfs_ilock_iocb_for_write(iocb, &iolock); in xfs_file_dio_write_aligned()
600 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dio_write_aligned()
613 trace_xfs_file_direct_write(iocb, from); in xfs_file_dio_write_aligned()
614 ret = iomap_dio_rw(iocb, from, &xfs_direct_write_iomap_ops, in xfs_file_dio_write_aligned()
642 struct kiocb *iocb, in xfs_file_dio_write_unaligned() argument
656 if (iocb->ki_pos > isize || iocb->ki_pos + count >= isize) { in xfs_file_dio_write_unaligned()
657 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_dio_write_unaligned()
664 ret = xfs_ilock_iocb_for_write(iocb, &iolock); in xfs_file_dio_write_unaligned()
673 trace_xfs_reflink_bounce_dio_write(iocb, from); in xfs_file_dio_write_unaligned()
678 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dio_write_unaligned()
691 trace_xfs_file_direct_write(iocb, from); in xfs_file_dio_write_unaligned()
692 ret = iomap_dio_rw(iocb, from, &xfs_direct_write_iomap_ops, in xfs_file_dio_write_unaligned()
700 if (ret == -EAGAIN && !(iocb->ki_flags & IOCB_NOWAIT)) { in xfs_file_dio_write_unaligned()
714 struct kiocb *iocb, in xfs_file_dio_write() argument
717 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_write()
722 if ((iocb->ki_pos | count) & target->bt_logical_sectormask) in xfs_file_dio_write()
724 if ((iocb->ki_pos | count) & ip->i_mount->m_blockmask) in xfs_file_dio_write()
725 return xfs_file_dio_write_unaligned(ip, iocb, from); in xfs_file_dio_write()
726 return xfs_file_dio_write_aligned(ip, iocb, from); in xfs_file_dio_write()
731 struct kiocb *iocb, in xfs_file_dax_write() argument
734 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_dax_write()
740 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_dax_write()
743 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dax_write()
747 pos = iocb->ki_pos; in xfs_file_dax_write()
749 trace_xfs_file_dax_write(iocb, from); in xfs_file_dax_write()
750 ret = dax_iomap_rw(iocb, from, &xfs_dax_write_iomap_ops); in xfs_file_dax_write()
751 if (ret > 0 && iocb->ki_pos > i_size_read(inode)) { in xfs_file_dax_write()
752 i_size_write(inode, iocb->ki_pos); in xfs_file_dax_write()
765 ret = generic_write_sync(iocb, ret); in xfs_file_dax_write()
772 struct kiocb *iocb, in xfs_file_buffered_write() argument
775 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_buffered_write()
783 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_buffered_write()
787 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_buffered_write()
791 trace_xfs_file_buffered_write(iocb, from); in xfs_file_buffered_write()
792 ret = iomap_file_buffered_write(iocb, from, in xfs_file_buffered_write()
829 ret = generic_write_sync(iocb, ret); in xfs_file_buffered_write()
836 struct kiocb *iocb, in xfs_file_write_iter() argument
839 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_write_iter()
853 return xfs_file_dax_write(iocb, from); in xfs_file_write_iter()
855 if (iocb->ki_flags & IOCB_DIRECT) { in xfs_file_write_iter()
862 ret = xfs_file_dio_write(iocb, from); in xfs_file_write_iter()
867 return xfs_file_buffered_write(iocb, from); in xfs_file_write_iter()