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()
135 error = xfs_qm_dqattach(ip, 0); in xfs_iomap_write_direct()
139 rt = XFS_IS_REALTIME_INODE(ip); in xfs_iomap_write_direct()
140 extsz = xfs_get_extsz_hint(ip); in xfs_iomap_write_direct()
144 if ((offset + count) > XFS_ISIZE(ip)) { in xfs_iomap_write_direct()
145 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_direct()
190 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_direct()
192 error = xfs_trans_reserve_quota_nblks(tp, ip, qblocks, 0, quota_flag); in xfs_iomap_write_direct()
196 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_direct()
204 error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, in xfs_iomap_write_direct()
228 if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_direct()
229 error = xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_direct()
232 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_direct()
237 xfs_trans_unreserve_quota_nblks(tp, ip, (long)qblocks, 0, quota_flag); in xfs_iomap_write_direct()
254 xfs_inode_t *ip, in xfs_iomap_eof_want_preallocate() argument
267 if (offset + count <= XFS_ISIZE(ip)) in xfs_iomap_eof_want_preallocate()
276 XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_writeio_blocks)) in xfs_iomap_eof_want_preallocate()
287 error = xfs_bmapi_read(ip, start_fsb, count_fsb, imap, &imaps, in xfs_iomap_eof_want_preallocate()
325 struct xfs_inode *ip, in xfs_iomap_eof_prealloc_initial_size() argument
341 if (XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_dalign)) in xfs_iomap_eof_prealloc_initial_size()
355 error = xfs_bmapi_read(ip, start_fsb, 1, imap, &imaps, XFS_BMAPI_ENTIRE); in xfs_iomap_eof_prealloc_initial_size()
369 struct xfs_inode *ip, in xfs_quota_need_throttle() argument
373 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); in xfs_quota_need_throttle()
375 if (!dq || !xfs_this_quota_on(ip->i_mount, type)) in xfs_quota_need_throttle()
391 struct xfs_inode *ip, in xfs_quota_calc_throttle() argument
399 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); in xfs_quota_calc_throttle()
436 struct xfs_inode *ip, in xfs_iomap_prealloc_size() argument
447 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()
483 if (xfs_quota_need_throttle(ip, XFS_DQ_GROUP, alloc_blocks)) in xfs_iomap_prealloc_size()
484 xfs_quota_calc_throttle(ip, XFS_DQ_GROUP, &qblocks, &qshift, in xfs_iomap_prealloc_size()
486 if (xfs_quota_need_throttle(ip, XFS_DQ_PROJ, alloc_blocks)) in xfs_iomap_prealloc_size()
487 xfs_quota_calc_throttle(ip, XFS_DQ_PROJ, &qblocks, &qshift, in xfs_iomap_prealloc_size()
524 trace_xfs_iomap_prealloc_size(ip, alloc_blocks, shift, in xfs_iomap_prealloc_size()
532 xfs_inode_t *ip, in xfs_iomap_write_delay() argument
537 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_delay()
548 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_iomap_write_delay()
554 error = xfs_qm_dqattach_locked(ip, 0); in xfs_iomap_write_delay()
558 extsz = xfs_get_extsz_hint(ip); in xfs_iomap_write_delay()
561 error = xfs_iomap_eof_want_preallocate(mp, ip, offset, count, in xfs_iomap_write_delay()
570 alloc_blocks = xfs_iomap_prealloc_size(mp, ip, offset, imap, in xfs_iomap_write_delay()
581 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_delay()
596 error = xfs_bmapi_delay(ip, offset_fsb, last_fsb - offset_fsb, in xfs_iomap_write_delay()
612 trace_xfs_delalloc_enospc(ip, offset, count); in xfs_iomap_write_delay()
621 if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_delay()
622 return xfs_alert_fsblock_zero(ip, &imap[0]); in xfs_iomap_write_delay()
629 xfs_inode_set_eofblocks_tag(ip); in xfs_iomap_write_delay()
647 xfs_inode_t *ip, in xfs_iomap_write_allocate() argument
651 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_allocate()
665 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(ip, &last_block, in xfs_iomap_write_allocate()
752 error = xfs_bmapi_write(tp, ip, map_start_fsb, in xfs_iomap_write_allocate()
767 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
774 if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_allocate()
775 return xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_allocate()
796 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_allocate()
802 xfs_inode_t *ip, in xfs_iomap_write_unwritten() argument
806 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_unwritten()
820 trace_xfs_unwritten_convert(ip, offset, count); in xfs_iomap_write_unwritten()
860 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()
861 xfs_trans_ijoin(tp, ip, 0); in xfs_iomap_write_unwritten()
868 error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb, in xfs_iomap_write_unwritten()
883 i_size = xfs_new_eof(ip, i_size); in xfs_iomap_write_unwritten()
885 ip->i_d.di_size = i_size; in xfs_iomap_write_unwritten()
886 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_iomap_write_unwritten()
894 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()
898 if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) in xfs_iomap_write_unwritten()
899 return xfs_alert_fsblock_zero(ip, &imap); in xfs_iomap_write_unwritten()
918 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iomap_write_unwritten()