Lines Matching refs:ip
56 xfs_inode_t *ip, in xfs_iomap_eof_align_last_fsb() argument
64 if (!XFS_IS_REALTIME_INODE(ip)) { in xfs_iomap_eof_align_last_fsb()
78 if (align && XFS_ISIZE(ip) >= XFS_FSB_TO_B(mp, align)) in xfs_iomap_eof_align_last_fsb()
95 error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof); in xfs_iomap_eof_align_last_fsb()
106 xfs_inode_t *ip, in xfs_alert_fsblock_zero() argument
109 xfs_alert_tag(ip->i_mount, XFS_PTAG_FSBLOCK_ZERO, in xfs_alert_fsblock_zero()
113 (unsigned long long)ip->i_ino, in xfs_alert_fsblock_zero()
123 xfs_inode_t *ip, in xfs_iomap_write_direct() argument
129 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_direct()
145 error = xfs_qm_dqattach(ip, 0); in xfs_iomap_write_direct()
149 rt = XFS_IS_REALTIME_INODE(ip); in xfs_iomap_write_direct()
150 extsz = xfs_get_extsz_hint(ip); in xfs_iomap_write_direct()
154 if ((offset + count) > XFS_ISIZE(ip)) { in xfs_iomap_write_direct()
155 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_direct()
202 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_direct()
204 error = xfs_trans_reserve_quota_nblks(tp, ip, qblocks, 0, quota_flag); in xfs_iomap_write_direct()
208 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_direct()
211 if (offset < XFS_ISIZE(ip) || extsz) in xfs_iomap_write_direct()
220 error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, bmapi_flag, in xfs_iomap_write_direct()
243 if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_direct()
244 error = xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_direct()
247 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_direct()
252 xfs_trans_unreserve_quota_nblks(tp, ip, (long)qblocks, 0, quota_flag); in xfs_iomap_write_direct()
269 xfs_inode_t *ip, in xfs_iomap_eof_want_preallocate() argument
283 if (offset + count <= XFS_ISIZE(ip)) in xfs_iomap_eof_want_preallocate()
295 error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, in xfs_iomap_eof_want_preallocate()
333 struct xfs_inode *ip, in xfs_iomap_eof_prealloc_initial_size() argument
359 error = xfs_bmapi_read(ip, start_fsb, 1, imap, &imaps, XFS_BMAPI_ENTIRE); in xfs_iomap_eof_prealloc_initial_size()
373 struct xfs_inode *ip, in xfs_quota_need_throttle() argument
377 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); in xfs_quota_need_throttle()
379 if (!dq || !xfs_this_quota_on(ip->i_mount, type)) in xfs_quota_need_throttle()
395 struct xfs_inode *ip, in xfs_quota_calc_throttle() argument
402 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); in xfs_quota_calc_throttle()
435 struct xfs_inode *ip, in xfs_iomap_prealloc_size() argument
446 alloc_blocks = xfs_iomap_eof_prealloc_initial_size(mp, ip, offset, in xfs_iomap_prealloc_size()
480 if (xfs_quota_need_throttle(ip, XFS_DQ_USER, alloc_blocks)) in xfs_iomap_prealloc_size()
481 xfs_quota_calc_throttle(ip, XFS_DQ_USER, &qblocks, &qshift); in xfs_iomap_prealloc_size()
482 if (xfs_quota_need_throttle(ip, XFS_DQ_GROUP, alloc_blocks)) in xfs_iomap_prealloc_size()
483 xfs_quota_calc_throttle(ip, XFS_DQ_GROUP, &qblocks, &qshift); in xfs_iomap_prealloc_size()
484 if (xfs_quota_need_throttle(ip, XFS_DQ_PROJ, alloc_blocks)) in xfs_iomap_prealloc_size()
485 xfs_quota_calc_throttle(ip, XFS_DQ_PROJ, &qblocks, &qshift); in xfs_iomap_prealloc_size()
521 trace_xfs_iomap_prealloc_size(ip, alloc_blocks, shift, in xfs_iomap_prealloc_size()
529 xfs_inode_t *ip, in xfs_iomap_write_delay() argument
534 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_delay()
545 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_iomap_write_delay()
551 error = xfs_qm_dqattach_locked(ip, 0); in xfs_iomap_write_delay()
555 extsz = xfs_get_extsz_hint(ip); in xfs_iomap_write_delay()
558 error = xfs_iomap_eof_want_preallocate(mp, ip, offset, count, in xfs_iomap_write_delay()
567 alloc_blocks = xfs_iomap_prealloc_size(mp, ip, offset, imap, in xfs_iomap_write_delay()
578 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_delay()
593 error = xfs_bmapi_delay(ip, offset_fsb, last_fsb - offset_fsb, in xfs_iomap_write_delay()
609 trace_xfs_delalloc_enospc(ip, offset, count); in xfs_iomap_write_delay()
618 if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_delay()
619 return xfs_alert_fsblock_zero(ip, &imap[0]); in xfs_iomap_write_delay()
626 xfs_inode_set_eofblocks_tag(ip); in xfs_iomap_write_delay()
644 xfs_inode_t *ip, in xfs_iomap_write_allocate() argument
649 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_allocate()
663 error = xfs_qm_dqattach(ip, 0); in xfs_iomap_write_allocate()
696 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
697 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_allocate()
733 end_fsb = XFS_B_TO_FSB(mp, XFS_ISIZE(ip)); in xfs_iomap_write_allocate()
734 error = xfs_bmap_last_offset(NULL, ip, &last_block, in xfs_iomap_write_allocate()
752 error = xfs_bmapi_write(tp, ip, map_start_fsb, in xfs_iomap_write_allocate()
768 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
775 if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_allocate()
776 return xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_allocate()
797 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
803 xfs_inode_t *ip, in xfs_iomap_write_unwritten() argument
807 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_unwritten()
821 trace_xfs_unwritten_convert(ip, offset, count); in xfs_iomap_write_unwritten()
863 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()
864 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_unwritten()
871 error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, in xfs_iomap_write_unwritten()
886 i_size = xfs_new_eof(ip, i_size); in xfs_iomap_write_unwritten()
888 ip->i_d.di_size = i_size; in xfs_iomap_write_unwritten()
889 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_iomap_write_unwritten()
897 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()
901 if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_unwritten()
902 return xfs_alert_fsblock_zero(ip, &imap); in xfs_iomap_write_unwritten()
921 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()