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()
790 mp->m_sb.sb_uquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
792 mp->m_sb.sb_gquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
794 mp->m_sb.sb_pquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
804 xfs_finish_inode_setup(*ip); in xfs_qm_qino_alloc()
1039 struct xfs_inode *ip, in xfs_qm_quotacheck_dqadjust() argument
1045 struct xfs_mount *mp = ip->i_mount; in xfs_qm_quotacheck_dqadjust()
1049 error = xfs_qm_dqget(mp, ip, id, type, in xfs_qm_quotacheck_dqadjust()
1094 xfs_inode_t *ip, in xfs_qm_get_rtblks() argument
1103 ASSERT(XFS_IS_REALTIME_INODE(ip)); in xfs_qm_get_rtblks()
1104 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_qm_get_rtblks()
1106 if ((error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK))) in xfs_qm_get_rtblks()
1131 xfs_inode_t *ip; in xfs_qm_dqusage_adjust() local
1152 error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_EXCL, &ip); in xfs_qm_dqusage_adjust()
1158 ASSERT(ip->i_delayed_blks == 0); in xfs_qm_dqusage_adjust()
1160 if (XFS_IS_REALTIME_INODE(ip)) { in xfs_qm_dqusage_adjust()
1164 error = xfs_qm_get_rtblks(ip, &rtblks); in xfs_qm_dqusage_adjust()
1169 nblks = (xfs_qcnt_t)ip->i_d.di_nblocks - rtblks; in xfs_qm_dqusage_adjust()
1184 error = xfs_qm_quotacheck_dqadjust(ip, ip->i_d.di_uid, in xfs_qm_dqusage_adjust()
1191 error = xfs_qm_quotacheck_dqadjust(ip, ip->i_d.di_gid, in xfs_qm_dqusage_adjust()
1198 error = xfs_qm_quotacheck_dqadjust(ip, xfs_get_projid(ip), in xfs_qm_dqusage_adjust()
1204 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqusage_adjust()
1205 IRELE(ip); in xfs_qm_dqusage_adjust()
1210 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_qm_dqusage_adjust()
1211 IRELE(ip); in xfs_qm_dqusage_adjust()
1601 struct xfs_inode *ip, in xfs_qm_vop_dqalloc() argument
1610 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_dqalloc()
1621 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1623 if ((flags & XFS_QMOPT_INHERIT) && XFS_INHERIT_GID(ip)) in xfs_qm_vop_dqalloc()
1624 gid = ip->i_d.di_gid; in xfs_qm_vop_dqalloc()
1630 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_dqalloc()
1631 error = xfs_qm_dqattach_locked(ip, XFS_QMOPT_DQALLOC); in xfs_qm_vop_dqalloc()
1633 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1639 if (ip->i_d.di_uid != uid) { in xfs_qm_vop_dqalloc()
1649 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1664 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1670 ASSERT(ip->i_udquot); in xfs_qm_vop_dqalloc()
1671 uq = xfs_qm_dqhold(ip->i_udquot); in xfs_qm_vop_dqalloc()
1675 if (ip->i_d.di_gid != gid) { in xfs_qm_vop_dqalloc()
1676 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1688 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1690 ASSERT(ip->i_gdquot); in xfs_qm_vop_dqalloc()
1691 gq = xfs_qm_dqhold(ip->i_gdquot); in xfs_qm_vop_dqalloc()
1695 if (xfs_get_projid(ip) != prid) { in xfs_qm_vop_dqalloc()
1696 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1708 xfs_ilock(ip, lockflags); in xfs_qm_vop_dqalloc()
1710 ASSERT(ip->i_pdquot); in xfs_qm_vop_dqalloc()
1711 pq = xfs_qm_dqhold(ip->i_pdquot); in xfs_qm_vop_dqalloc()
1715 trace_xfs_dquot_dqalloc(ip); in xfs_qm_vop_dqalloc()
1717 xfs_iunlock(ip, lockflags); in xfs_qm_vop_dqalloc()
1745 xfs_inode_t *ip, in xfs_qm_vop_chown() argument
1750 uint bfield = XFS_IS_REALTIME_INODE(ip) ? in xfs_qm_vop_chown()
1754 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_vop_chown()
1755 ASSERT(XFS_IS_QUOTA_RUNNING(ip->i_mount)); in xfs_qm_vop_chown()
1762 xfs_trans_mod_dquot(tp, prevdq, bfield, -(ip->i_d.di_nblocks)); in xfs_qm_vop_chown()
1766 xfs_trans_mod_dquot(tp, newdq, bfield, ip->i_d.di_nblocks); in xfs_qm_vop_chown()
1784 struct xfs_inode *ip, in xfs_qm_vop_chown_reserve() argument
1790 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_chown_reserve()
1801 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)); in xfs_qm_vop_chown_reserve()
1804 delblks = ip->i_delayed_blks; in xfs_qm_vop_chown_reserve()
1805 blkflags = XFS_IS_REALTIME_INODE(ip) ? in xfs_qm_vop_chown_reserve()
1809 ip->i_d.di_uid != be32_to_cpu(udqp->q_core.d_id)) { in xfs_qm_vop_chown_reserve()
1817 ASSERT(ip->i_udquot); in xfs_qm_vop_chown_reserve()
1818 udq_unres = ip->i_udquot; in xfs_qm_vop_chown_reserve()
1821 if (XFS_IS_GQUOTA_ON(ip->i_mount) && gdqp && in xfs_qm_vop_chown_reserve()
1822 ip->i_d.di_gid != be32_to_cpu(gdqp->q_core.d_id)) { in xfs_qm_vop_chown_reserve()
1825 ASSERT(ip->i_gdquot); in xfs_qm_vop_chown_reserve()
1826 gdq_unres = ip->i_gdquot; in xfs_qm_vop_chown_reserve()
1830 if (XFS_IS_PQUOTA_ON(ip->i_mount) && pdqp && in xfs_qm_vop_chown_reserve()
1831 xfs_get_projid(ip) != be32_to_cpu(pdqp->q_core.d_id)) { in xfs_qm_vop_chown_reserve()
1835 ASSERT(ip->i_pdquot); in xfs_qm_vop_chown_reserve()
1836 pdq_unres = ip->i_pdquot; in xfs_qm_vop_chown_reserve()
1840 error = xfs_trans_reserve_quota_bydquots(tp, ip->i_mount, in xfs_qm_vop_chown_reserve()
1842 ip->i_d.di_nblocks, 1, in xfs_qm_vop_chown_reserve()
1859 error = xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount, in xfs_qm_vop_chown_reserve()
1865 xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount, in xfs_qm_vop_chown_reserve()
1884 struct xfs_inode *ip = i_tab[i]; in xfs_qm_vop_rename_dqattach() local
1890 if (i == 0 || ip != i_tab[i-1]) { in xfs_qm_vop_rename_dqattach()
1891 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_rename_dqattach()
1892 error = xfs_qm_dqattach(ip, 0); in xfs_qm_vop_rename_dqattach()
1904 struct xfs_inode *ip, in xfs_qm_vop_create_dqattach() argument
1914 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_qm_vop_create_dqattach()
1918 ASSERT(ip->i_udquot == NULL); in xfs_qm_vop_create_dqattach()
1919 ASSERT(ip->i_d.di_uid == be32_to_cpu(udqp->q_core.d_id)); in xfs_qm_vop_create_dqattach()
1921 ip->i_udquot = xfs_qm_dqhold(udqp); in xfs_qm_vop_create_dqattach()
1925 ASSERT(ip->i_gdquot == NULL); in xfs_qm_vop_create_dqattach()
1926 ASSERT(ip->i_d.di_gid == be32_to_cpu(gdqp->q_core.d_id)); in xfs_qm_vop_create_dqattach()
1927 ip->i_gdquot = xfs_qm_dqhold(gdqp); in xfs_qm_vop_create_dqattach()
1931 ASSERT(ip->i_pdquot == NULL); in xfs_qm_vop_create_dqattach()
1932 ASSERT(xfs_get_projid(ip) == be32_to_cpu(pdqp->q_core.d_id)); in xfs_qm_vop_create_dqattach()
1934 ip->i_pdquot = xfs_qm_dqhold(pdqp); in xfs_qm_vop_create_dqattach()