Lines Matching refs:iocb
202 struct kiocb *iocb, in xfs_ilock_iocb() argument
205 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_ilock_iocb()
207 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_ilock_iocb()
219 struct kiocb *iocb, in xfs_ilock_iocb_for_write() argument
223 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_ilock_iocb_for_write()
225 ret = xfs_ilock_iocb(iocb, *lock_mode); in xfs_ilock_iocb_for_write()
236 return xfs_ilock_iocb(iocb, *lock_mode); in xfs_ilock_iocb_for_write()
256 struct kiocb *iocb, in xfs_file_dio_read() argument
259 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_read()
262 trace_xfs_file_direct_read(iocb, to); in xfs_file_dio_read()
267 file_accessed(iocb->ki_filp); in xfs_file_dio_read()
269 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_dio_read()
272 ret = iomap_dio_rw(iocb, to, &xfs_read_iomap_ops, NULL, 0, NULL, 0); in xfs_file_dio_read()
280 struct kiocb *iocb, in xfs_file_dax_read() argument
283 struct xfs_inode *ip = XFS_I(iocb->ki_filp->f_mapping->host); in xfs_file_dax_read()
286 trace_xfs_file_dax_read(iocb, to); in xfs_file_dax_read()
291 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_dax_read()
294 ret = dax_iomap_rw(iocb, to, &xfs_read_iomap_ops); in xfs_file_dax_read()
297 file_accessed(iocb->ki_filp); in xfs_file_dax_read()
303 struct kiocb *iocb, in xfs_file_buffered_read() argument
306 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_buffered_read()
309 trace_xfs_file_buffered_read(iocb, to); in xfs_file_buffered_read()
311 ret = xfs_ilock_iocb(iocb, XFS_IOLOCK_SHARED); in xfs_file_buffered_read()
314 ret = generic_file_read_iter(iocb, to); in xfs_file_buffered_read()
322 struct kiocb *iocb, in xfs_file_read_iter() argument
325 struct inode *inode = file_inode(iocb->ki_filp); in xfs_file_read_iter()
335 ret = xfs_file_dax_read(iocb, to); in xfs_file_read_iter()
336 else if (iocb->ki_flags & IOCB_DIRECT) in xfs_file_read_iter()
337 ret = xfs_file_dio_read(iocb, to); in xfs_file_read_iter()
339 ret = xfs_file_buffered_read(iocb, to); in xfs_file_read_iter()
383 struct kiocb *iocb, in xfs_file_write_checks() argument
387 struct file *file = iocb->ki_filp; in xfs_file_write_checks()
396 error = generic_write_checks(iocb, from); in xfs_file_write_checks()
400 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_file_write_checks()
418 error = xfs_ilock_iocb(iocb, *iolock); in xfs_file_write_checks()
446 if (iocb->ki_pos <= i_size_read(inode)) in xfs_file_write_checks()
451 if (iocb->ki_pos > isize) { in xfs_file_write_checks()
454 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_write_checks()
477 trace_xfs_zero_eof(ip, isize, iocb->ki_pos - isize); in xfs_file_write_checks()
478 error = xfs_zero_range(ip, isize, iocb->ki_pos - isize, NULL); in xfs_file_write_checks()
485 return kiocb_modified(iocb); in xfs_file_write_checks()
490 struct kiocb *iocb, in xfs_dio_write_end_io() argument
495 struct inode *inode = file_inode(iocb->ki_filp); in xfs_dio_write_end_io()
497 loff_t offset = iocb->ki_pos; in xfs_dio_write_end_io()
585 struct kiocb *iocb, in xfs_file_dio_write_aligned() argument
591 ret = xfs_ilock_iocb_for_write(iocb, &iolock); in xfs_file_dio_write_aligned()
594 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dio_write_aligned()
607 trace_xfs_file_direct_write(iocb, from); in xfs_file_dio_write_aligned()
608 ret = iomap_dio_rw(iocb, from, &xfs_direct_write_iomap_ops, in xfs_file_dio_write_aligned()
636 struct kiocb *iocb, in xfs_file_dio_write_unaligned() argument
650 if (iocb->ki_pos > isize || iocb->ki_pos + count >= isize) { in xfs_file_dio_write_unaligned()
651 if (iocb->ki_flags & IOCB_NOWAIT) in xfs_file_dio_write_unaligned()
658 ret = xfs_ilock_iocb_for_write(iocb, &iolock); in xfs_file_dio_write_unaligned()
667 trace_xfs_reflink_bounce_dio_write(iocb, from); in xfs_file_dio_write_unaligned()
672 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dio_write_unaligned()
685 trace_xfs_file_direct_write(iocb, from); in xfs_file_dio_write_unaligned()
686 ret = iomap_dio_rw(iocb, from, &xfs_direct_write_iomap_ops, in xfs_file_dio_write_unaligned()
694 if (ret == -EAGAIN && !(iocb->ki_flags & IOCB_NOWAIT)) { in xfs_file_dio_write_unaligned()
708 struct kiocb *iocb, in xfs_file_dio_write() argument
711 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_write()
716 if ((iocb->ki_pos | count) & target->bt_logical_sectormask) in xfs_file_dio_write()
718 if ((iocb->ki_pos | count) & ip->i_mount->m_blockmask) in xfs_file_dio_write()
719 return xfs_file_dio_write_unaligned(ip, iocb, from); in xfs_file_dio_write()
720 return xfs_file_dio_write_aligned(ip, iocb, from); in xfs_file_dio_write()
725 struct kiocb *iocb, in xfs_file_dax_write() argument
728 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_dax_write()
734 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_dax_write()
737 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_dax_write()
741 pos = iocb->ki_pos; in xfs_file_dax_write()
743 trace_xfs_file_dax_write(iocb, from); in xfs_file_dax_write()
744 ret = dax_iomap_rw(iocb, from, &xfs_dax_write_iomap_ops); in xfs_file_dax_write()
745 if (ret > 0 && iocb->ki_pos > i_size_read(inode)) { in xfs_file_dax_write()
746 i_size_write(inode, iocb->ki_pos); in xfs_file_dax_write()
759 ret = generic_write_sync(iocb, ret); in xfs_file_dax_write()
766 struct kiocb *iocb, in xfs_file_buffered_write() argument
769 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_buffered_write()
777 ret = xfs_ilock_iocb(iocb, iolock); in xfs_file_buffered_write()
781 ret = xfs_file_write_checks(iocb, from, &iolock); in xfs_file_buffered_write()
785 trace_xfs_file_buffered_write(iocb, from); in xfs_file_buffered_write()
786 ret = iomap_file_buffered_write(iocb, from, in xfs_file_buffered_write()
823 ret = generic_write_sync(iocb, ret); in xfs_file_buffered_write()
830 struct kiocb *iocb, in xfs_file_write_iter() argument
833 struct inode *inode = iocb->ki_filp->f_mapping->host; in xfs_file_write_iter()
847 return xfs_file_dax_write(iocb, from); in xfs_file_write_iter()
849 if (iocb->ki_flags & IOCB_DIRECT) { in xfs_file_write_iter()
856 ret = xfs_file_dio_write(iocb, from); in xfs_file_write_iter()
861 return xfs_file_buffered_write(iocb, from); in xfs_file_write_iter()