Lines Matching refs:ip

261 	xfs_inode_t	*ip,  in xfs_qm_dqattach_one()  argument
270 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_dqattach_one()
290 error = xfs_qm_dqget(ip->i_mount, ip, id, type, in xfs_qm_dqattach_one()
308 struct xfs_inode *ip) in xfs_qm_need_dqattach() argument
310 struct xfs_mount *mp = ip->i_mount; in xfs_qm_need_dqattach()
316 if (!XFS_NOT_DQATTACHED(mp, ip)) in xfs_qm_need_dqattach()
318 if (xfs_is_quota_inode(&mp->m_sb, ip->i_ino)) in xfs_qm_need_dqattach()
332 xfs_inode_t *ip, in xfs_qm_dqattach_locked() argument
335 xfs_mount_t *mp = ip->i_mount; in xfs_qm_dqattach_locked()
338 if (!xfs_qm_need_dqattach(ip)) in xfs_qm_dqattach_locked()
341 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_dqattach_locked()
343 if (XFS_IS_UQUOTA_ON(mp) && !ip->i_udquot) { in xfs_qm_dqattach_locked()
344 error = xfs_qm_dqattach_one(ip, ip->i_d.di_uid, XFS_DQ_USER, in xfs_qm_dqattach_locked()
346 &ip->i_udquot); in xfs_qm_dqattach_locked()
349 ASSERT(ip->i_udquot); in xfs_qm_dqattach_locked()
352 if (XFS_IS_GQUOTA_ON(mp) && !ip->i_gdquot) { in xfs_qm_dqattach_locked()
353 error = xfs_qm_dqattach_one(ip, ip->i_d.di_gid, XFS_DQ_GROUP, in xfs_qm_dqattach_locked()
355 &ip->i_gdquot); in xfs_qm_dqattach_locked()
358 ASSERT(ip->i_gdquot); in xfs_qm_dqattach_locked()
361 if (XFS_IS_PQUOTA_ON(mp) && !ip->i_pdquot) { in xfs_qm_dqattach_locked()
362 error = xfs_qm_dqattach_one(ip, xfs_get_projid(ip), XFS_DQ_PROJ, in xfs_qm_dqattach_locked()
364 &ip->i_pdquot); in xfs_qm_dqattach_locked()
367 ASSERT(ip->i_pdquot); in xfs_qm_dqattach_locked()
375 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_dqattach_locked()
381 struct xfs_inode *ip, in xfs_qm_dqattach() argument
386 if (!xfs_qm_need_dqattach(ip)) in xfs_qm_dqattach()
389 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqattach()
390 error = xfs_qm_dqattach_locked(ip, flags); in xfs_qm_dqattach()
391 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqattach()
403 xfs_inode_t *ip) in xfs_qm_dqdetach() argument
405 if (!(ip->i_udquot || ip->i_gdquot || ip->i_pdquot)) in xfs_qm_dqdetach()
408 trace_xfs_dquot_dqdetach(ip); in xfs_qm_dqdetach()
410 ASSERT(!xfs_is_quota_inode(&ip->i_mount->m_sb, ip->i_ino)); in xfs_qm_dqdetach()
411 if (ip->i_udquot) { in xfs_qm_dqdetach()
412 xfs_qm_dqrele(ip->i_udquot); in xfs_qm_dqdetach()
413 ip->i_udquot = NULL; in xfs_qm_dqdetach()
415 if (ip->i_gdquot) { in xfs_qm_dqdetach()
416 xfs_qm_dqrele(ip->i_gdquot); in xfs_qm_dqdetach()
417 ip->i_gdquot = NULL; in xfs_qm_dqdetach()
419 if (ip->i_pdquot) { in xfs_qm_dqdetach()
420 xfs_qm_dqrele(ip->i_pdquot); in xfs_qm_dqdetach()
421 ip->i_pdquot = NULL; in xfs_qm_dqdetach()
716 xfs_inode_t **ip, in xfs_qm_qino_alloc() argument
724 *ip = NULL; in xfs_qm_qino_alloc()
746 error = xfs_iget(mp, NULL, ino, 0, 0, ip); in xfs_qm_qino_alloc()
764 error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, 0, 1, ip, in xfs_qm_qino_alloc()
791 mp->m_sb.sb_uquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
793 mp->m_sb.sb_gquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
795 mp->m_sb.sb_pquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
805 xfs_finish_inode_setup(*ip); in xfs_qm_qino_alloc()
1040 struct xfs_inode *ip, in xfs_qm_quotacheck_dqadjust() argument
1046 struct xfs_mount *mp = ip->i_mount; in xfs_qm_quotacheck_dqadjust()
1050 error = xfs_qm_dqget(mp, ip, id, type, in xfs_qm_quotacheck_dqadjust()
1095 xfs_inode_t *ip, in xfs_qm_get_rtblks() argument
1104 ASSERT(XFS_IS_REALTIME_INODE(ip)); in xfs_qm_get_rtblks()
1105 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_qm_get_rtblks()
1107 if ((error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK))) in xfs_qm_get_rtblks()
1132 xfs_inode_t *ip; in xfs_qm_dqusage_adjust() local
1153 error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_EXCL, &ip); in xfs_qm_dqusage_adjust()
1159 ASSERT(ip->i_delayed_blks == 0); in xfs_qm_dqusage_adjust()
1161 if (XFS_IS_REALTIME_INODE(ip)) { in xfs_qm_dqusage_adjust()
1165 error = xfs_qm_get_rtblks(ip, &rtblks); in xfs_qm_dqusage_adjust()
1170 nblks = (xfs_qcnt_t)ip->i_d.di_nblocks - rtblks; in xfs_qm_dqusage_adjust()
1185 error = xfs_qm_quotacheck_dqadjust(ip, ip->i_d.di_uid, in xfs_qm_dqusage_adjust()
1192 error = xfs_qm_quotacheck_dqadjust(ip, ip->i_d.di_gid, in xfs_qm_dqusage_adjust()
1199 error = xfs_qm_quotacheck_dqadjust(ip, xfs_get_projid(ip), in xfs_qm_dqusage_adjust()
1205 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqusage_adjust()
1206 IRELE(ip); in xfs_qm_dqusage_adjust()
1211 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqusage_adjust()
1212 IRELE(ip); in xfs_qm_dqusage_adjust()
1602 struct xfs_inode *ip, in xfs_qm_vop_dqalloc() argument
1611 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_dqalloc()
1622 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1624 if ((flags & XFS_QMOPT_INHERIT) && XFS_INHERIT_GID(ip)) in xfs_qm_vop_dqalloc()
1625 gid = ip->i_d.di_gid; in xfs_qm_vop_dqalloc()
1631 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_dqalloc()
1632 error = xfs_qm_dqattach_locked(ip, XFS_QMOPT_DQALLOC); in xfs_qm_vop_dqalloc()
1634 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1640 if (ip->i_d.di_uid != uid) { in xfs_qm_vop_dqalloc()
1650 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1665 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1671 ASSERT(ip->i_udquot); in xfs_qm_vop_dqalloc()
1672 uq = xfs_qm_dqhold(ip->i_udquot); in xfs_qm_vop_dqalloc()
1676 if (ip->i_d.di_gid != gid) { in xfs_qm_vop_dqalloc()
1677 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1689 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1691 ASSERT(ip->i_gdquot); in xfs_qm_vop_dqalloc()
1692 gq = xfs_qm_dqhold(ip->i_gdquot); in xfs_qm_vop_dqalloc()
1696 if (xfs_get_projid(ip) != prid) { in xfs_qm_vop_dqalloc()
1697 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1709 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1711 ASSERT(ip->i_pdquot); in xfs_qm_vop_dqalloc()
1712 pq = xfs_qm_dqhold(ip->i_pdquot); in xfs_qm_vop_dqalloc()
1716 trace_xfs_dquot_dqalloc(ip); in xfs_qm_vop_dqalloc()
1718 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1746 xfs_inode_t *ip, in xfs_qm_vop_chown() argument
1751 uint bfield = XFS_IS_REALTIME_INODE(ip) ? in xfs_qm_vop_chown()
1755 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_vop_chown()
1756 ASSERT(XFS_IS_QUOTA_RUNNING(ip->i_mount)); in xfs_qm_vop_chown()
1763 xfs_trans_mod_dquot(tp, prevdq, bfield, -(ip->i_d.di_nblocks)); in xfs_qm_vop_chown()
1767 xfs_trans_mod_dquot(tp, newdq, bfield, ip->i_d.di_nblocks); in xfs_qm_vop_chown()
1785 struct xfs_inode *ip, in xfs_qm_vop_chown_reserve() argument
1791 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_chown_reserve()
1802 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)); in xfs_qm_vop_chown_reserve()
1805 delblks = ip->i_delayed_blks; in xfs_qm_vop_chown_reserve()
1806 blkflags = XFS_IS_REALTIME_INODE(ip) ? in xfs_qm_vop_chown_reserve()
1810 ip->i_d.di_uid != be32_to_cpu(udqp->q_core.d_id)) { in xfs_qm_vop_chown_reserve()
1818 ASSERT(ip->i_udquot); in xfs_qm_vop_chown_reserve()
1819 udq_unres = ip->i_udquot; in xfs_qm_vop_chown_reserve()
1822 if (XFS_IS_GQUOTA_ON(ip->i_mount) && gdqp && in xfs_qm_vop_chown_reserve()
1823 ip->i_d.di_gid != be32_to_cpu(gdqp->q_core.d_id)) { in xfs_qm_vop_chown_reserve()
1826 ASSERT(ip->i_gdquot); in xfs_qm_vop_chown_reserve()
1827 gdq_unres = ip->i_gdquot; in xfs_qm_vop_chown_reserve()
1831 if (XFS_IS_PQUOTA_ON(ip->i_mount) && pdqp && in xfs_qm_vop_chown_reserve()
1832 xfs_get_projid(ip) != be32_to_cpu(pdqp->q_core.d_id)) { in xfs_qm_vop_chown_reserve()
1836 ASSERT(ip->i_pdquot); in xfs_qm_vop_chown_reserve()
1837 pdq_unres = ip->i_pdquot; in xfs_qm_vop_chown_reserve()
1841 error = xfs_trans_reserve_quota_bydquots(tp, ip->i_mount, in xfs_qm_vop_chown_reserve()
1843 ip->i_d.di_nblocks, 1, in xfs_qm_vop_chown_reserve()
1860 error = xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount, in xfs_qm_vop_chown_reserve()
1866 xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount, in xfs_qm_vop_chown_reserve()
1885 struct xfs_inode *ip = i_tab[i]; in xfs_qm_vop_rename_dqattach() local
1891 if (i == 0 || ip != i_tab[i-1]) { in xfs_qm_vop_rename_dqattach()
1892 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_rename_dqattach()
1893 error = xfs_qm_dqattach(ip, 0); in xfs_qm_vop_rename_dqattach()
1905 struct xfs_inode *ip, in xfs_qm_vop_create_dqattach() argument
1915 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_vop_create_dqattach()
1919 ASSERT(ip->i_udquot == NULL); in xfs_qm_vop_create_dqattach()
1920 ASSERT(ip->i_d.di_uid == be32_to_cpu(udqp->q_core.d_id)); in xfs_qm_vop_create_dqattach()
1922 ip->i_udquot = xfs_qm_dqhold(udqp); in xfs_qm_vop_create_dqattach()
1926 ASSERT(ip->i_gdquot == NULL); in xfs_qm_vop_create_dqattach()
1927 ASSERT(ip->i_d.di_gid == be32_to_cpu(gdqp->q_core.d_id)); in xfs_qm_vop_create_dqattach()
1928 ip->i_gdquot = xfs_qm_dqhold(gdqp); in xfs_qm_vop_create_dqattach()
1932 ASSERT(ip->i_pdquot == NULL); in xfs_qm_vop_create_dqattach()
1933 ASSERT(xfs_get_projid(ip) == be32_to_cpu(pdqp->q_core.d_id)); in xfs_qm_vop_create_dqattach()
1935 ip->i_pdquot = xfs_qm_dqhold(pdqp); in xfs_qm_vop_create_dqattach()