Lines Matching refs:ip
48 xfs_inode_t *ip, in xfs_iomap_eof_align_last_fsb() argument
55 if (!XFS_IS_REALTIME_INODE(ip)) { in xfs_iomap_eof_align_last_fsb()
69 if (align && XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, align)) in xfs_iomap_eof_align_last_fsb()
86 error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof); in xfs_iomap_eof_align_last_fsb()
97 xfs_inode_t *ip, in xfs_alert_fsblock_zero() argument
100 xfs_alert_tag(ip->i_mount, XFS_PTAG_FSBLOCK_ZERO, in xfs_alert_fsblock_zero()
104 (unsigned long long)ip->i_ino, in xfs_alert_fsblock_zero()
114 xfs_inode_t *ip, in xfs_iomap_write_direct() argument
120 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_direct()
137 rt = XFS_IS_REALTIME_INODE(ip); in xfs_iomap_write_direct()
138 extsz = xfs_get_extsz_hint(ip); in xfs_iomap_write_direct()
141 ASSERT(xfs_isilocked(ip, lockmode)); in xfs_iomap_write_direct()
145 if ((offset + count) > XFS_ISIZE(ip)) { in xfs_iomap_write_direct()
153 ASSERT(XFS_IFORK_PTR(ip, XFS_DATA_FORK)->if_flags & in xfs_iomap_write_direct()
155 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_direct()
190 xfs_iunlock(ip, lockmode); in xfs_iomap_write_direct()
191 error = xfs_qm_dqattach(ip, 0); in xfs_iomap_write_direct()
212 if (IS_DAX(VFS_I(ip))) { in xfs_iomap_write_direct()
227 xfs_ilock(ip, lockmode); in xfs_iomap_write_direct()
229 error = xfs_trans_reserve_quota_nblks(tp, ip, qblocks, 0, quota_flag); in xfs_iomap_write_direct()
233 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_direct()
241 error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, in xfs_iomap_write_direct()
266 if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_direct()
267 error = xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_direct()
270 xfs_iunlock(ip, lockmode); in xfs_iomap_write_direct()
275 xfs_trans_unreserve_quota_nblks(tp, ip, (long)qblocks, 0, quota_flag); in xfs_iomap_write_direct()
292 xfs_inode_t *ip, in xfs_iomap_eof_want_preallocate() argument
305 if (offset + count <= XFS_ISIZE(ip)) in xfs_iomap_eof_want_preallocate()
314 XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_writeio_blocks)) in xfs_iomap_eof_want_preallocate()
325 error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, in xfs_iomap_eof_want_preallocate()
363 struct xfs_inode *ip, in xfs_iomap_eof_prealloc_initial_size() argument
379 if (XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_dalign)) in xfs_iomap_eof_prealloc_initial_size()
393 error = xfs_bmapi_read(ip, start_fsb, 1, imap, &imaps, XFS_BMAPI_ENTIRE); in xfs_iomap_eof_prealloc_initial_size()
407 struct xfs_inode *ip, in xfs_quota_need_throttle() argument
411 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); in xfs_quota_need_throttle()
413 if (!dq || !xfs_this_quota_on(ip->i_mount, type)) in xfs_quota_need_throttle()
429 struct xfs_inode *ip, in xfs_quota_calc_throttle() argument
437 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); in xfs_quota_calc_throttle()
474 struct xfs_inode *ip, in xfs_iomap_prealloc_size() argument
485 alloc_blocks = xfs_iomap_eof_prealloc_initial_size(mp, ip, offset, in xfs_iomap_prealloc_size()
518 if (xfs_quota_need_throttle(ip, XFS_DQ_USER, alloc_blocks)) in xfs_iomap_prealloc_size()
519 xfs_quota_calc_throttle(ip, XFS_DQ_USER, &qblocks, &qshift, in xfs_iomap_prealloc_size()
521 if (xfs_quota_need_throttle(ip, XFS_DQ_GROUP, alloc_blocks)) in xfs_iomap_prealloc_size()
522 xfs_quota_calc_throttle(ip, XFS_DQ_GROUP, &qblocks, &qshift, in xfs_iomap_prealloc_size()
524 if (xfs_quota_need_throttle(ip, XFS_DQ_PROJ, alloc_blocks)) in xfs_iomap_prealloc_size()
525 xfs_quota_calc_throttle(ip, XFS_DQ_PROJ, &qblocks, &qshift, in xfs_iomap_prealloc_size()
562 trace_xfs_iomap_prealloc_size(ip, alloc_blocks, shift, in xfs_iomap_prealloc_size()
570 xfs_inode_t *ip, in xfs_iomap_write_delay() argument
575 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_delay()
586 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_iomap_write_delay()
592 error = xfs_qm_dqattach_locked(ip, 0); in xfs_iomap_write_delay()
596 extsz = xfs_get_extsz_hint(ip); in xfs_iomap_write_delay()
599 error = xfs_iomap_eof_want_preallocate(mp, ip, offset, count, in xfs_iomap_write_delay()
608 alloc_blocks = xfs_iomap_prealloc_size(mp, ip, offset, imap, in xfs_iomap_write_delay()
619 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_delay()
634 error = xfs_bmapi_delay(ip, offset_fsb, last_fsb - offset_fsb, in xfs_iomap_write_delay()
650 trace_xfs_delalloc_enospc(ip, offset, count); in xfs_iomap_write_delay()
659 if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_delay()
660 return xfs_alert_fsblock_zero(ip, &imap[0]); in xfs_iomap_write_delay()
667 xfs_inode_set_eofblocks_tag(ip); in xfs_iomap_write_delay()
685 xfs_inode_t *ip, in xfs_iomap_write_allocate() argument
689 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_allocate()
703 error = xfs_qm_dqattach(ip, 0); in xfs_iomap_write_allocate()
734 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
735 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_allocate()
771 end_fsb = XFS_B_TO_FSB(mp, XFS_ISIZE(ip)); in xfs_iomap_write_allocate()
772 error = xfs_bmap_last_offset(ip, &last_block, in xfs_iomap_write_allocate()
790 error = xfs_bmapi_write(tp, ip, map_start_fsb, in xfs_iomap_write_allocate()
805 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
812 if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_allocate()
813 return xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_allocate()
834 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
840 xfs_inode_t *ip, in xfs_iomap_write_unwritten() argument
844 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_unwritten()
858 trace_xfs_unwritten_convert(ip, offset, count); in xfs_iomap_write_unwritten()
898 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()
899 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_unwritten()
906 error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, in xfs_iomap_write_unwritten()
921 i_size = xfs_new_eof(ip, i_size); in xfs_iomap_write_unwritten()
923 ip->i_d.di_size = i_size; in xfs_iomap_write_unwritten()
924 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_iomap_write_unwritten()
932 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()
936 if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_unwritten()
937 return xfs_alert_fsblock_zero(ip, &imap); in xfs_iomap_write_unwritten()
956 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()