Lines Matching refs:ip

249 	struct xfs_inode	*ip,  in xfs_qm_dqattach_one()  argument
257 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_dqattach_one()
277 error = xfs_qm_dqget_inode(ip, type, doalloc, &dqp); in xfs_qm_dqattach_one()
294 struct xfs_inode *ip) in xfs_qm_need_dqattach() argument
296 struct xfs_mount *mp = ip->i_mount; in xfs_qm_need_dqattach()
300 if (!XFS_NOT_DQATTACHED(mp, ip)) in xfs_qm_need_dqattach()
302 if (xfs_is_quota_inode(&mp->m_sb, ip->i_ino)) in xfs_qm_need_dqattach()
316 xfs_inode_t *ip, in xfs_qm_dqattach_locked() argument
319 xfs_mount_t *mp = ip->i_mount; in xfs_qm_dqattach_locked()
322 if (!xfs_qm_need_dqattach(ip)) in xfs_qm_dqattach_locked()
325 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_dqattach_locked()
327 if (XFS_IS_UQUOTA_ON(mp) && !ip->i_udquot) { in xfs_qm_dqattach_locked()
328 error = xfs_qm_dqattach_one(ip, XFS_DQTYPE_USER, in xfs_qm_dqattach_locked()
329 doalloc, &ip->i_udquot); in xfs_qm_dqattach_locked()
332 ASSERT(ip->i_udquot); in xfs_qm_dqattach_locked()
335 if (XFS_IS_GQUOTA_ON(mp) && !ip->i_gdquot) { in xfs_qm_dqattach_locked()
336 error = xfs_qm_dqattach_one(ip, XFS_DQTYPE_GROUP, in xfs_qm_dqattach_locked()
337 doalloc, &ip->i_gdquot); in xfs_qm_dqattach_locked()
340 ASSERT(ip->i_gdquot); in xfs_qm_dqattach_locked()
343 if (XFS_IS_PQUOTA_ON(mp) && !ip->i_pdquot) { in xfs_qm_dqattach_locked()
344 error = xfs_qm_dqattach_one(ip, XFS_DQTYPE_PROJ, in xfs_qm_dqattach_locked()
345 doalloc, &ip->i_pdquot); in xfs_qm_dqattach_locked()
348 ASSERT(ip->i_pdquot); in xfs_qm_dqattach_locked()
356 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_dqattach_locked()
362 struct xfs_inode *ip) in xfs_qm_dqattach() argument
366 if (!xfs_qm_need_dqattach(ip)) in xfs_qm_dqattach()
369 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqattach()
370 error = xfs_qm_dqattach_locked(ip, false); in xfs_qm_dqattach()
371 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqattach()
383 xfs_inode_t *ip) in xfs_qm_dqdetach() argument
385 if (!(ip->i_udquot || ip->i_gdquot || ip->i_pdquot)) in xfs_qm_dqdetach()
388 trace_xfs_dquot_dqdetach(ip); in xfs_qm_dqdetach()
390 ASSERT(!xfs_is_quota_inode(&ip->i_mount->m_sb, ip->i_ino)); in xfs_qm_dqdetach()
391 if (ip->i_udquot) { in xfs_qm_dqdetach()
392 xfs_qm_dqrele(ip->i_udquot); in xfs_qm_dqdetach()
393 ip->i_udquot = NULL; in xfs_qm_dqdetach()
395 if (ip->i_gdquot) { in xfs_qm_dqdetach()
396 xfs_qm_dqrele(ip->i_gdquot); in xfs_qm_dqdetach()
397 ip->i_gdquot = NULL; in xfs_qm_dqdetach()
399 if (ip->i_pdquot) { in xfs_qm_dqdetach()
400 xfs_qm_dqrele(ip->i_pdquot); in xfs_qm_dqdetach()
401 ip->i_pdquot = NULL; in xfs_qm_dqdetach()
1074 struct xfs_inode *ip, in xfs_qm_quotacheck_dqadjust() argument
1079 struct xfs_mount *mp = ip->i_mount; in xfs_qm_quotacheck_dqadjust()
1084 id = xfs_qm_id_for_quotatype(ip, type); in xfs_qm_quotacheck_dqadjust()
1139 struct xfs_inode *ip; in xfs_qm_dqusage_adjust() local
1157 error = xfs_iget(mp, tp, ino, XFS_IGET_DONTCACHE, 0, &ip); in xfs_qm_dqusage_adjust()
1168 if (xfs_inode_unlinked_incomplete(ip)) { in xfs_qm_dqusage_adjust()
1169 error = xfs_inode_reload_unlinked(ip); in xfs_qm_dqusage_adjust()
1176 ASSERT(ip->i_delayed_blks == 0); in xfs_qm_dqusage_adjust()
1178 if (XFS_IS_REALTIME_INODE(ip)) { in xfs_qm_dqusage_adjust()
1179 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_qm_dqusage_adjust()
1181 error = xfs_iread_extents(tp, ip, XFS_DATA_FORK); in xfs_qm_dqusage_adjust()
1188 nblks = (xfs_qcnt_t)ip->i_nblocks - rtblks; in xfs_qm_dqusage_adjust()
1189 xfs_iflags_clear(ip, XFS_IQUOTAUNCHECKED); in xfs_qm_dqusage_adjust()
1204 error = xfs_qm_quotacheck_dqadjust(ip, XFS_DQTYPE_USER, nblks, in xfs_qm_dqusage_adjust()
1211 error = xfs_qm_quotacheck_dqadjust(ip, XFS_DQTYPE_GROUP, nblks, in xfs_qm_dqusage_adjust()
1218 error = xfs_qm_quotacheck_dqadjust(ip, XFS_DQTYPE_PROJ, nblks, in xfs_qm_dqusage_adjust()
1225 xfs_irele(ip); in xfs_qm_dqusage_adjust()
1663 struct xfs_inode *ip, in xfs_qm_vop_dqalloc() argument
1672 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_dqalloc()
1673 struct inode *inode = VFS_I(ip); in xfs_qm_vop_dqalloc()
1685 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1687 if ((flags & XFS_QMOPT_INHERIT) && XFS_INHERIT_GID(ip)) in xfs_qm_vop_dqalloc()
1694 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_dqalloc()
1695 error = xfs_qm_dqattach_locked(ip, true); in xfs_qm_vop_dqalloc()
1697 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1714 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1726 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1732 ASSERT(ip->i_udquot); in xfs_qm_vop_dqalloc()
1733 uq = xfs_qm_dqhold(ip->i_udquot); in xfs_qm_vop_dqalloc()
1739 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1748 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1750 ASSERT(ip->i_gdquot); in xfs_qm_vop_dqalloc()
1751 gq = xfs_qm_dqhold(ip->i_gdquot); in xfs_qm_vop_dqalloc()
1756 if (ip->i_projid != prid) { in xfs_qm_vop_dqalloc()
1757 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1766 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1768 ASSERT(ip->i_pdquot); in xfs_qm_vop_dqalloc()
1769 pq = xfs_qm_dqhold(ip->i_pdquot); in xfs_qm_vop_dqalloc()
1772 trace_xfs_dquot_dqalloc(ip); in xfs_qm_vop_dqalloc()
1774 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1802 struct xfs_inode *ip, in xfs_qm_vop_chown() argument
1807 uint bfield = XFS_IS_REALTIME_INODE(ip) ? in xfs_qm_vop_chown()
1811 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_vop_chown()
1812 ASSERT(XFS_IS_QUOTA_ON(ip->i_mount)); in xfs_qm_vop_chown()
1819 xfs_trans_mod_dquot(tp, prevdq, bfield, -(ip->i_nblocks)); in xfs_qm_vop_chown()
1823 xfs_trans_mod_dquot(tp, newdq, bfield, ip->i_nblocks); in xfs_qm_vop_chown()
1834 -ip->i_delayed_blks); in xfs_qm_vop_chown()
1845 ASSERT(prevdq->q_blk.reserved >= ip->i_delayed_blks); in xfs_qm_vop_chown()
1846 prevdq->q_blk.reserved -= ip->i_delayed_blks; in xfs_qm_vop_chown()
1869 struct xfs_inode *ip = i_tab[i]; in xfs_qm_vop_rename_dqattach() local
1875 if (i == 0 || ip != i_tab[i-1]) { in xfs_qm_vop_rename_dqattach()
1876 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_rename_dqattach()
1877 error = xfs_qm_dqattach(ip); in xfs_qm_vop_rename_dqattach()
1889 struct xfs_inode *ip, in xfs_qm_vop_create_dqattach() argument
1899 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_vop_create_dqattach()
1902 ASSERT(ip->i_udquot == NULL); in xfs_qm_vop_create_dqattach()
1903 ASSERT(i_uid_read(VFS_I(ip)) == udqp->q_id); in xfs_qm_vop_create_dqattach()
1905 ip->i_udquot = xfs_qm_dqhold(udqp); in xfs_qm_vop_create_dqattach()
1909 ASSERT(ip->i_gdquot == NULL); in xfs_qm_vop_create_dqattach()
1910 ASSERT(i_gid_read(VFS_I(ip)) == gdqp->q_id); in xfs_qm_vop_create_dqattach()
1912 ip->i_gdquot = xfs_qm_dqhold(gdqp); in xfs_qm_vop_create_dqattach()
1916 ASSERT(ip->i_pdquot == NULL); in xfs_qm_vop_create_dqattach()
1917 ASSERT(ip->i_projid == pdqp->q_id); in xfs_qm_vop_create_dqattach()
1919 ip->i_pdquot = xfs_qm_dqhold(pdqp); in xfs_qm_vop_create_dqattach()
1927 struct xfs_inode *ip, in xfs_inode_near_dquot_enforcement() argument
1934 dqp = xfs_inode_dquot(ip, type); in xfs_inode_near_dquot_enforcement()