aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r--fs/xfs/xfs_qm.c175
1 files changed, 92 insertions, 83 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index b75c9bb6e71e..7a3e007b49f4 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -70,7 +70,7 @@ xfs_qm_dquot_walk(
70 void *data) 70 void *data)
71{ 71{
72 struct xfs_quotainfo *qi = mp->m_quotainfo; 72 struct xfs_quotainfo *qi = mp->m_quotainfo;
73 struct radix_tree_root *tree = XFS_DQUOT_TREE(qi, type); 73 struct radix_tree_root *tree = xfs_dquot_tree(qi, type);
74 uint32_t next_index; 74 uint32_t next_index;
75 int last_error = 0; 75 int last_error = 0;
76 int skipped; 76 int skipped;
@@ -189,7 +189,7 @@ xfs_qm_dqpurge(
189 xfs_dqfunlock(dqp); 189 xfs_dqfunlock(dqp);
190 xfs_dqunlock(dqp); 190 xfs_dqunlock(dqp);
191 191
192 radix_tree_delete(XFS_DQUOT_TREE(qi, dqp->q_core.d_flags), 192 radix_tree_delete(xfs_dquot_tree(qi, dqp->q_core.d_flags),
193 be32_to_cpu(dqp->q_core.d_id)); 193 be32_to_cpu(dqp->q_core.d_id));
194 qi->qi_dquots--; 194 qi->qi_dquots--;
195 195
@@ -299,8 +299,10 @@ xfs_qm_mount_quotas(
299 */ 299 */
300 if (!XFS_IS_UQUOTA_ON(mp)) 300 if (!XFS_IS_UQUOTA_ON(mp))
301 mp->m_qflags &= ~XFS_UQUOTA_CHKD; 301 mp->m_qflags &= ~XFS_UQUOTA_CHKD;
302 if (!(XFS_IS_GQUOTA_ON(mp) || XFS_IS_PQUOTA_ON(mp))) 302 if (!XFS_IS_GQUOTA_ON(mp))
303 mp->m_qflags &= ~XFS_OQUOTA_CHKD; 303 mp->m_qflags &= ~XFS_GQUOTA_CHKD;
304 if (!XFS_IS_PQUOTA_ON(mp))
305 mp->m_qflags &= ~XFS_PQUOTA_CHKD;
304 306
305 write_changes: 307 write_changes:
306 /* 308 /*
@@ -489,8 +491,7 @@ xfs_qm_need_dqattach(
489 return false; 491 return false;
490 if (!XFS_NOT_DQATTACHED(mp, ip)) 492 if (!XFS_NOT_DQATTACHED(mp, ip))
491 return false; 493 return false;
492 if (ip->i_ino == mp->m_sb.sb_uquotino || 494 if (xfs_is_quota_inode(&mp->m_sb, ip->i_ino))
493 ip->i_ino == mp->m_sb.sb_gquotino)
494 return false; 495 return false;
495 return true; 496 return true;
496} 497}
@@ -606,8 +607,7 @@ xfs_qm_dqdetach(
606 607
607 trace_xfs_dquot_dqdetach(ip); 608 trace_xfs_dquot_dqdetach(ip);
608 609
609 ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_uquotino); 610 ASSERT(!xfs_is_quota_inode(&ip->i_mount->m_sb, ip->i_ino));
610 ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_gquotino);
611 if (ip->i_udquot) { 611 if (ip->i_udquot) {
612 xfs_qm_dqrele(ip->i_udquot); 612 xfs_qm_dqrele(ip->i_udquot);
613 ip->i_udquot = NULL; 613 ip->i_udquot = NULL;
@@ -1152,7 +1152,7 @@ xfs_qm_dqusage_adjust(
1152 * rootino must have its resources accounted for, not so with the quota 1152 * rootino must have its resources accounted for, not so with the quota
1153 * inodes. 1153 * inodes.
1154 */ 1154 */
1155 if (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino) { 1155 if (xfs_is_quota_inode(&mp->m_sb, ino)) {
1156 *res = BULKSTAT_RV_NOTHING; 1156 *res = BULKSTAT_RV_NOTHING;
1157 return XFS_ERROR(EINVAL); 1157 return XFS_ERROR(EINVAL);
1158 } 1158 }
@@ -1262,19 +1262,20 @@ int
1262xfs_qm_quotacheck( 1262xfs_qm_quotacheck(
1263 xfs_mount_t *mp) 1263 xfs_mount_t *mp)
1264{ 1264{
1265 int done, count, error, error2; 1265 int done, count, error, error2;
1266 xfs_ino_t lastino; 1266 xfs_ino_t lastino;
1267 size_t structsz; 1267 size_t structsz;
1268 xfs_inode_t *uip, *gip; 1268 uint flags;
1269 uint flags; 1269 LIST_HEAD (buffer_list);
1270 LIST_HEAD (buffer_list); 1270 struct xfs_inode *uip = mp->m_quotainfo->qi_uquotaip;
1271 struct xfs_inode *gip = mp->m_quotainfo->qi_gquotaip;
1271 1272
1272 count = INT_MAX; 1273 count = INT_MAX;
1273 structsz = 1; 1274 structsz = 1;
1274 lastino = 0; 1275 lastino = 0;
1275 flags = 0; 1276 flags = 0;
1276 1277
1277 ASSERT(mp->m_quotainfo->qi_uquotaip || mp->m_quotainfo->qi_gquotaip); 1278 ASSERT(uip || gip);
1278 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); 1279 ASSERT(XFS_IS_QUOTA_RUNNING(mp));
1279 1280
1280 xfs_notice(mp, "Quotacheck needed: Please wait."); 1281 xfs_notice(mp, "Quotacheck needed: Please wait.");
@@ -1284,7 +1285,6 @@ xfs_qm_quotacheck(
1284 * their counters to zero. We need a clean slate. 1285 * their counters to zero. We need a clean slate.
1285 * We don't log our changes till later. 1286 * We don't log our changes till later.
1286 */ 1287 */
1287 uip = mp->m_quotainfo->qi_uquotaip;
1288 if (uip) { 1288 if (uip) {
1289 error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA, 1289 error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA,
1290 &buffer_list); 1290 &buffer_list);
@@ -1293,14 +1293,14 @@ xfs_qm_quotacheck(
1293 flags |= XFS_UQUOTA_CHKD; 1293 flags |= XFS_UQUOTA_CHKD;
1294 } 1294 }
1295 1295
1296 gip = mp->m_quotainfo->qi_gquotaip;
1297 if (gip) { 1296 if (gip) {
1298 error = xfs_qm_dqiterate(mp, gip, XFS_IS_GQUOTA_ON(mp) ? 1297 error = xfs_qm_dqiterate(mp, gip, XFS_IS_GQUOTA_ON(mp) ?
1299 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA, 1298 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA,
1300 &buffer_list); 1299 &buffer_list);
1301 if (error) 1300 if (error)
1302 goto error_return; 1301 goto error_return;
1303 flags |= XFS_OQUOTA_CHKD; 1302 flags |= XFS_IS_GQUOTA_ON(mp) ?
1303 XFS_GQUOTA_CHKD : XFS_PQUOTA_CHKD;
1304 } 1304 }
1305 1305
1306 do { 1306 do {
@@ -1395,15 +1395,13 @@ STATIC int
1395xfs_qm_init_quotainos( 1395xfs_qm_init_quotainos(
1396 xfs_mount_t *mp) 1396 xfs_mount_t *mp)
1397{ 1397{
1398 xfs_inode_t *uip, *gip; 1398 struct xfs_inode *uip = NULL;
1399 int error; 1399 struct xfs_inode *gip = NULL;
1400 __int64_t sbflags; 1400 int error;
1401 uint flags; 1401 __int64_t sbflags = 0;
1402 uint flags = 0;
1402 1403
1403 ASSERT(mp->m_quotainfo); 1404 ASSERT(mp->m_quotainfo);
1404 uip = gip = NULL;
1405 sbflags = 0;
1406 flags = 0;
1407 1405
1408 /* 1406 /*
1409 * Get the uquota and gquota inodes 1407 * Get the uquota and gquota inodes
@@ -1412,19 +1410,18 @@ xfs_qm_init_quotainos(
1412 if (XFS_IS_UQUOTA_ON(mp) && 1410 if (XFS_IS_UQUOTA_ON(mp) &&
1413 mp->m_sb.sb_uquotino != NULLFSINO) { 1411 mp->m_sb.sb_uquotino != NULLFSINO) {
1414 ASSERT(mp->m_sb.sb_uquotino > 0); 1412 ASSERT(mp->m_sb.sb_uquotino > 0);
1415 if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 1413 error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino,
1416 0, 0, &uip))) 1414 0, 0, &uip);
1415 if (error)
1417 return XFS_ERROR(error); 1416 return XFS_ERROR(error);
1418 } 1417 }
1419 if (XFS_IS_OQUOTA_ON(mp) && 1418 if (XFS_IS_OQUOTA_ON(mp) &&
1420 mp->m_sb.sb_gquotino != NULLFSINO) { 1419 mp->m_sb.sb_gquotino != NULLFSINO) {
1421 ASSERT(mp->m_sb.sb_gquotino > 0); 1420 ASSERT(mp->m_sb.sb_gquotino > 0);
1422 if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 1421 error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino,
1423 0, 0, &gip))) { 1422 0, 0, &gip);
1424 if (uip) 1423 if (error)
1425 IRELE(uip); 1424 goto error_rele;
1426 return XFS_ERROR(error);
1427 }
1428 } 1425 }
1429 } else { 1426 } else {
1430 flags |= XFS_QMOPT_SBVERSION; 1427 flags |= XFS_QMOPT_SBVERSION;
@@ -1439,10 +1436,11 @@ xfs_qm_init_quotainos(
1439 * temporarily switch to read-write to do this. 1436 * temporarily switch to read-write to do this.
1440 */ 1437 */
1441 if (XFS_IS_UQUOTA_ON(mp) && uip == NULL) { 1438 if (XFS_IS_UQUOTA_ON(mp) && uip == NULL) {
1442 if ((error = xfs_qm_qino_alloc(mp, &uip, 1439 error = xfs_qm_qino_alloc(mp, &uip,
1443 sbflags | XFS_SB_UQUOTINO, 1440 sbflags | XFS_SB_UQUOTINO,
1444 flags | XFS_QMOPT_UQUOTA))) 1441 flags | XFS_QMOPT_UQUOTA);
1445 return XFS_ERROR(error); 1442 if (error)
1443 goto error_rele;
1446 1444
1447 flags &= ~XFS_QMOPT_SBVERSION; 1445 flags &= ~XFS_QMOPT_SBVERSION;
1448 } 1446 }
@@ -1451,18 +1449,21 @@ xfs_qm_init_quotainos(
1451 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA); 1449 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA);
1452 error = xfs_qm_qino_alloc(mp, &gip, 1450 error = xfs_qm_qino_alloc(mp, &gip,
1453 sbflags | XFS_SB_GQUOTINO, flags); 1451 sbflags | XFS_SB_GQUOTINO, flags);
1454 if (error) { 1452 if (error)
1455 if (uip) 1453 goto error_rele;
1456 IRELE(uip);
1457
1458 return XFS_ERROR(error);
1459 }
1460 } 1454 }
1461 1455
1462 mp->m_quotainfo->qi_uquotaip = uip; 1456 mp->m_quotainfo->qi_uquotaip = uip;
1463 mp->m_quotainfo->qi_gquotaip = gip; 1457 mp->m_quotainfo->qi_gquotaip = gip;
1464 1458
1465 return 0; 1459 return 0;
1460
1461error_rele:
1462 if (uip)
1463 IRELE(uip);
1464 if (gip)
1465 IRELE(gip);
1466 return XFS_ERROR(error);
1466} 1467}
1467 1468
1468STATIC void 1469STATIC void
@@ -1473,7 +1474,7 @@ xfs_qm_dqfree_one(
1473 struct xfs_quotainfo *qi = mp->m_quotainfo; 1474 struct xfs_quotainfo *qi = mp->m_quotainfo;
1474 1475
1475 mutex_lock(&qi->qi_tree_lock); 1476 mutex_lock(&qi->qi_tree_lock);
1476 radix_tree_delete(XFS_DQUOT_TREE(qi, dqp->q_core.d_flags), 1477 radix_tree_delete(xfs_dquot_tree(qi, dqp->q_core.d_flags),
1477 be32_to_cpu(dqp->q_core.d_id)); 1478 be32_to_cpu(dqp->q_core.d_id));
1478 1479
1479 qi->qi_dquots--; 1480 qi->qi_dquots--;
@@ -1659,7 +1660,8 @@ xfs_qm_vop_dqalloc(
1659 struct xfs_dquot **O_gdqpp) 1660 struct xfs_dquot **O_gdqpp)
1660{ 1661{
1661 struct xfs_mount *mp = ip->i_mount; 1662 struct xfs_mount *mp = ip->i_mount;
1662 struct xfs_dquot *uq, *gq; 1663 struct xfs_dquot *uq = NULL;
1664 struct xfs_dquot *gq = NULL;
1663 int error; 1665 int error;
1664 uint lockflags; 1666 uint lockflags;
1665 1667
@@ -1684,7 +1686,6 @@ xfs_qm_vop_dqalloc(
1684 } 1686 }
1685 } 1687 }
1686 1688
1687 uq = gq = NULL;
1688 if ((flags & XFS_QMOPT_UQUOTA) && XFS_IS_UQUOTA_ON(mp)) { 1689 if ((flags & XFS_QMOPT_UQUOTA) && XFS_IS_UQUOTA_ON(mp)) {
1689 if (ip->i_d.di_uid != uid) { 1690 if (ip->i_d.di_uid != uid) {
1690 /* 1691 /*
@@ -1697,11 +1698,12 @@ xfs_qm_vop_dqalloc(
1697 * holding ilock. 1698 * holding ilock.
1698 */ 1699 */
1699 xfs_iunlock(ip, lockflags); 1700 xfs_iunlock(ip, lockflags);
1700 if ((error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t) uid, 1701 error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t) uid,
1701 XFS_DQ_USER, 1702 XFS_DQ_USER,
1702 XFS_QMOPT_DQALLOC | 1703 XFS_QMOPT_DQALLOC |
1703 XFS_QMOPT_DOWARN, 1704 XFS_QMOPT_DOWARN,
1704 &uq))) { 1705 &uq);
1706 if (error) {
1705 ASSERT(error != ENOENT); 1707 ASSERT(error != ENOENT);
1706 return error; 1708 return error;
1707 } 1709 }
@@ -1723,15 +1725,14 @@ xfs_qm_vop_dqalloc(
1723 if ((flags & XFS_QMOPT_GQUOTA) && XFS_IS_GQUOTA_ON(mp)) { 1725 if ((flags & XFS_QMOPT_GQUOTA) && XFS_IS_GQUOTA_ON(mp)) {
1724 if (ip->i_d.di_gid != gid) { 1726 if (ip->i_d.di_gid != gid) {
1725 xfs_iunlock(ip, lockflags); 1727 xfs_iunlock(ip, lockflags);
1726 if ((error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)gid, 1728 error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)gid,
1727 XFS_DQ_GROUP, 1729 XFS_DQ_GROUP,
1728 XFS_QMOPT_DQALLOC | 1730 XFS_QMOPT_DQALLOC |
1729 XFS_QMOPT_DOWARN, 1731 XFS_QMOPT_DOWARN,
1730 &gq))) { 1732 &gq);
1731 if (uq) 1733 if (error) {
1732 xfs_qm_dqrele(uq);
1733 ASSERT(error != ENOENT); 1734 ASSERT(error != ENOENT);
1734 return error; 1735 goto error_rele;
1735 } 1736 }
1736 xfs_dqunlock(gq); 1737 xfs_dqunlock(gq);
1737 lockflags = XFS_ILOCK_SHARED; 1738 lockflags = XFS_ILOCK_SHARED;
@@ -1743,15 +1744,14 @@ xfs_qm_vop_dqalloc(
1743 } else if ((flags & XFS_QMOPT_PQUOTA) && XFS_IS_PQUOTA_ON(mp)) { 1744 } else if ((flags & XFS_QMOPT_PQUOTA) && XFS_IS_PQUOTA_ON(mp)) {
1744 if (xfs_get_projid(ip) != prid) { 1745 if (xfs_get_projid(ip) != prid) {
1745 xfs_iunlock(ip, lockflags); 1746 xfs_iunlock(ip, lockflags);
1746 if ((error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)prid, 1747 error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)prid,
1747 XFS_DQ_PROJ, 1748 XFS_DQ_PROJ,
1748 XFS_QMOPT_DQALLOC | 1749 XFS_QMOPT_DQALLOC |
1749 XFS_QMOPT_DOWARN, 1750 XFS_QMOPT_DOWARN,
1750 &gq))) { 1751 &gq);
1751 if (uq) 1752 if (error) {
1752 xfs_qm_dqrele(uq);
1753 ASSERT(error != ENOENT); 1753 ASSERT(error != ENOENT);
1754 return (error); 1754 goto error_rele;
1755 } 1755 }
1756 xfs_dqunlock(gq); 1756 xfs_dqunlock(gq);
1757 lockflags = XFS_ILOCK_SHARED; 1757 lockflags = XFS_ILOCK_SHARED;
@@ -1774,6 +1774,11 @@ xfs_qm_vop_dqalloc(
1774 else if (gq) 1774 else if (gq)
1775 xfs_qm_dqrele(gq); 1775 xfs_qm_dqrele(gq);
1776 return 0; 1776 return 0;
1777
1778error_rele:
1779 if (uq)
1780 xfs_qm_dqrele(uq);
1781 return error;
1777} 1782}
1778 1783
1779/* 1784/*
@@ -1821,29 +1826,31 @@ xfs_qm_vop_chown(
1821 */ 1826 */
1822int 1827int
1823xfs_qm_vop_chown_reserve( 1828xfs_qm_vop_chown_reserve(
1824 xfs_trans_t *tp, 1829 struct xfs_trans *tp,
1825 xfs_inode_t *ip, 1830 struct xfs_inode *ip,
1826 xfs_dquot_t *udqp, 1831 struct xfs_dquot *udqp,
1827 xfs_dquot_t *gdqp, 1832 struct xfs_dquot *gdqp,
1828 uint flags) 1833 uint flags)
1829{ 1834{
1830 xfs_mount_t *mp = ip->i_mount; 1835 struct xfs_mount *mp = ip->i_mount;
1831 uint delblks, blkflags, prjflags = 0; 1836 uint delblks, blkflags, prjflags = 0;
1832 xfs_dquot_t *unresudq, *unresgdq, *delblksudq, *delblksgdq; 1837 struct xfs_dquot *udq_unres = NULL;
1833 int error; 1838 struct xfs_dquot *gdq_unres = NULL;
1839 struct xfs_dquot *udq_delblks = NULL;
1840 struct xfs_dquot *gdq_delblks = NULL;
1841 int error;
1834 1842
1835 1843
1836 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)); 1844 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
1837 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); 1845 ASSERT(XFS_IS_QUOTA_RUNNING(mp));
1838 1846
1839 delblks = ip->i_delayed_blks; 1847 delblks = ip->i_delayed_blks;
1840 delblksudq = delblksgdq = unresudq = unresgdq = NULL;
1841 blkflags = XFS_IS_REALTIME_INODE(ip) ? 1848 blkflags = XFS_IS_REALTIME_INODE(ip) ?
1842 XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS; 1849 XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS;
1843 1850
1844 if (XFS_IS_UQUOTA_ON(mp) && udqp && 1851 if (XFS_IS_UQUOTA_ON(mp) && udqp &&
1845 ip->i_d.di_uid != (uid_t)be32_to_cpu(udqp->q_core.d_id)) { 1852 ip->i_d.di_uid != (uid_t)be32_to_cpu(udqp->q_core.d_id)) {
1846 delblksudq = udqp; 1853 udq_delblks = udqp;
1847 /* 1854 /*
1848 * If there are delayed allocation blocks, then we have to 1855 * If there are delayed allocation blocks, then we have to
1849 * unreserve those from the old dquot, and add them to the 1856 * unreserve those from the old dquot, and add them to the
@@ -1851,7 +1858,7 @@ xfs_qm_vop_chown_reserve(
1851 */ 1858 */
1852 if (delblks) { 1859 if (delblks) {
1853 ASSERT(ip->i_udquot); 1860 ASSERT(ip->i_udquot);
1854 unresudq = ip->i_udquot; 1861 udq_unres = ip->i_udquot;
1855 } 1862 }
1856 } 1863 }
1857 if (XFS_IS_OQUOTA_ON(ip->i_mount) && gdqp) { 1864 if (XFS_IS_OQUOTA_ON(ip->i_mount) && gdqp) {
@@ -1862,18 +1869,19 @@ xfs_qm_vop_chown_reserve(
1862 if (prjflags || 1869 if (prjflags ||
1863 (XFS_IS_GQUOTA_ON(ip->i_mount) && 1870 (XFS_IS_GQUOTA_ON(ip->i_mount) &&
1864 ip->i_d.di_gid != be32_to_cpu(gdqp->q_core.d_id))) { 1871 ip->i_d.di_gid != be32_to_cpu(gdqp->q_core.d_id))) {
1865 delblksgdq = gdqp; 1872 gdq_delblks = gdqp;
1866 if (delblks) { 1873 if (delblks) {
1867 ASSERT(ip->i_gdquot); 1874 ASSERT(ip->i_gdquot);
1868 unresgdq = ip->i_gdquot; 1875 gdq_unres = ip->i_gdquot;
1869 } 1876 }
1870 } 1877 }
1871 } 1878 }
1872 1879
1873 if ((error = xfs_trans_reserve_quota_bydquots(tp, ip->i_mount, 1880 error = xfs_trans_reserve_quota_bydquots(tp, ip->i_mount,
1874 delblksudq, delblksgdq, ip->i_d.di_nblocks, 1, 1881 udq_delblks, gdq_delblks, ip->i_d.di_nblocks, 1,
1875 flags | blkflags | prjflags))) 1882 flags | blkflags | prjflags);
1876 return (error); 1883 if (error)
1884 return error;
1877 1885
1878 /* 1886 /*
1879 * Do the delayed blks reservations/unreservations now. Since, these 1887 * Do the delayed blks reservations/unreservations now. Since, these
@@ -1885,14 +1893,15 @@ xfs_qm_vop_chown_reserve(
1885 /* 1893 /*
1886 * Do the reservations first. Unreservation can't fail. 1894 * Do the reservations first. Unreservation can't fail.
1887 */ 1895 */
1888 ASSERT(delblksudq || delblksgdq); 1896 ASSERT(udq_delblks || gdq_delblks);
1889 ASSERT(unresudq || unresgdq); 1897 ASSERT(udq_unres || gdq_unres);
1890 if ((error = xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount, 1898 error = xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount,
1891 delblksudq, delblksgdq, (xfs_qcnt_t)delblks, 0, 1899 udq_delblks, gdq_delblks, (xfs_qcnt_t)delblks, 0,
1892 flags | blkflags | prjflags))) 1900 flags | blkflags | prjflags);
1893 return (error); 1901 if (error)
1902 return error;
1894 xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount, 1903 xfs_trans_reserve_quota_bydquots(NULL, ip->i_mount,
1895 unresudq, unresgdq, -((xfs_qcnt_t)delblks), 0, 1904 udq_unres, gdq_unres, -((xfs_qcnt_t)delblks), 0,
1896 blkflags); 1905 blkflags);
1897 } 1906 }
1898 1907