aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/quota/xfs_qm.c114
-rw-r--r--fs/xfs/xfs_dir_leaf.c96
-rw-r--r--fs/xfs/xfs_fsops.c4
-rw-r--r--fs/xfs/xfs_log.c52
-rw-r--r--fs/xfs/xfs_mount.c66
-rw-r--r--fs/xfs/xfs_trans_item.c22
-rw-r--r--fs/xfs/xfs_vnodeops.c59
7 files changed, 206 insertions, 207 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 7dcdd0640c32..8d5886020107 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -497,7 +497,7 @@ xfs_qm_dqflush_all(
497 int error; 497 int error;
498 498
499 if (mp->m_quotainfo == NULL) 499 if (mp->m_quotainfo == NULL)
500 return (0); 500 return 0;
501 niters = 0; 501 niters = 0;
502again: 502again:
503 xfs_qm_mplist_lock(mp); 503 xfs_qm_mplist_lock(mp);
@@ -528,7 +528,7 @@ again:
528 error = xfs_qm_dqflush(dqp, flags); 528 error = xfs_qm_dqflush(dqp, flags);
529 xfs_dqunlock(dqp); 529 xfs_dqunlock(dqp);
530 if (error) 530 if (error)
531 return (error); 531 return error;
532 532
533 xfs_qm_mplist_lock(mp); 533 xfs_qm_mplist_lock(mp);
534 if (recl != XFS_QI_MPLRECLAIMS(mp)) { 534 if (recl != XFS_QI_MPLRECLAIMS(mp)) {
@@ -540,7 +540,7 @@ again:
540 540
541 xfs_qm_mplist_unlock(mp); 541 xfs_qm_mplist_unlock(mp);
542 /* return ! busy */ 542 /* return ! busy */
543 return (0); 543 return 0;
544} 544}
545/* 545/*
546 * Release the group dquot pointers the user dquots may be 546 * Release the group dquot pointers the user dquots may be
@@ -599,7 +599,7 @@ xfs_qm_dqpurge_int(
599 int nmisses; 599 int nmisses;
600 600
601 if (mp->m_quotainfo == NULL) 601 if (mp->m_quotainfo == NULL)
602 return (0); 602 return 0;
603 603
604 dqtype = (flags & XFS_QMOPT_UQUOTA) ? XFS_DQ_USER : 0; 604 dqtype = (flags & XFS_QMOPT_UQUOTA) ? XFS_DQ_USER : 0;
605 dqtype |= (flags & XFS_QMOPT_PQUOTA) ? XFS_DQ_PROJ : 0; 605 dqtype |= (flags & XFS_QMOPT_PQUOTA) ? XFS_DQ_PROJ : 0;
@@ -796,7 +796,7 @@ xfs_qm_dqattach_one(
796 ASSERT(XFS_DQ_IS_LOCKED(dqp)); 796 ASSERT(XFS_DQ_IS_LOCKED(dqp));
797 } 797 }
798#endif 798#endif
799 return (error); 799 return error;
800} 800}
801 801
802 802
@@ -897,7 +897,7 @@ xfs_qm_dqattach(
897 (! XFS_NOT_DQATTACHED(mp, ip)) || 897 (! XFS_NOT_DQATTACHED(mp, ip)) ||
898 (ip->i_ino == mp->m_sb.sb_uquotino) || 898 (ip->i_ino == mp->m_sb.sb_uquotino) ||
899 (ip->i_ino == mp->m_sb.sb_gquotino)) 899 (ip->i_ino == mp->m_sb.sb_gquotino))
900 return (0); 900 return 0;
901 901
902 ASSERT((flags & XFS_QMOPT_ILOCKED) == 0 || 902 ASSERT((flags & XFS_QMOPT_ILOCKED) == 0 ||
903 XFS_ISLOCKED_INODE_EXCL(ip)); 903 XFS_ISLOCKED_INODE_EXCL(ip));
@@ -984,7 +984,7 @@ xfs_qm_dqattach(
984 else 984 else
985 ASSERT(XFS_ISLOCKED_INODE_EXCL(ip)); 985 ASSERT(XFS_ISLOCKED_INODE_EXCL(ip));
986#endif 986#endif
987 return (error); 987 return error;
988} 988}
989 989
990/* 990/*
@@ -1049,7 +1049,7 @@ xfs_qm_sync(
1049 */ 1049 */
1050 if (! XFS_IS_QUOTA_ON(mp)) { 1050 if (! XFS_IS_QUOTA_ON(mp)) {
1051 xfs_qm_mplist_unlock(mp); 1051 xfs_qm_mplist_unlock(mp);
1052 return (0); 1052 return 0;
1053 } 1053 }
1054 FOREACH_DQUOT_IN_MP(dqp, mp) { 1054 FOREACH_DQUOT_IN_MP(dqp, mp) {
1055 /* 1055 /*
@@ -1109,9 +1109,9 @@ xfs_qm_sync(
1109 error = xfs_qm_dqflush(dqp, flush_flags); 1109 error = xfs_qm_dqflush(dqp, flush_flags);
1110 xfs_dqunlock(dqp); 1110 xfs_dqunlock(dqp);
1111 if (error && XFS_FORCED_SHUTDOWN(mp)) 1111 if (error && XFS_FORCED_SHUTDOWN(mp))
1112 return(0); /* Need to prevent umount failure */ 1112 return 0; /* Need to prevent umount failure */
1113 else if (error) 1113 else if (error)
1114 return (error); 1114 return error;
1115 1115
1116 xfs_qm_mplist_lock(mp); 1116 xfs_qm_mplist_lock(mp);
1117 if (recl != XFS_QI_MPLRECLAIMS(mp)) { 1117 if (recl != XFS_QI_MPLRECLAIMS(mp)) {
@@ -1124,7 +1124,7 @@ xfs_qm_sync(
1124 } 1124 }
1125 1125
1126 xfs_qm_mplist_unlock(mp); 1126 xfs_qm_mplist_unlock(mp);
1127 return (0); 1127 return 0;
1128} 1128}
1129 1129
1130 1130
@@ -1146,7 +1146,7 @@ xfs_qm_init_quotainfo(
1146 * Tell XQM that we exist as soon as possible. 1146 * Tell XQM that we exist as soon as possible.
1147 */ 1147 */
1148 if ((error = xfs_qm_hold_quotafs_ref(mp))) { 1148 if ((error = xfs_qm_hold_quotafs_ref(mp))) {
1149 return (error); 1149 return error;
1150 } 1150 }
1151 1151
1152 qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP); 1152 qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP);
@@ -1158,7 +1158,7 @@ xfs_qm_init_quotainfo(
1158 if ((error = xfs_qm_init_quotainos(mp))) { 1158 if ((error = xfs_qm_init_quotainos(mp))) {
1159 kmem_free(qinf, sizeof(xfs_quotainfo_t)); 1159 kmem_free(qinf, sizeof(xfs_quotainfo_t));
1160 mp->m_quotainfo = NULL; 1160 mp->m_quotainfo = NULL;
1161 return (error); 1161 return error;
1162 } 1162 }
1163 1163
1164 spinlock_init(&qinf->qi_pinlock, "xfs_qinf_pin"); 1164 spinlock_init(&qinf->qi_pinlock, "xfs_qinf_pin");
@@ -1232,7 +1232,7 @@ xfs_qm_init_quotainfo(
1232 qinf->qi_rtbwarnlimit = XFS_QM_RTBWARNLIMIT; 1232 qinf->qi_rtbwarnlimit = XFS_QM_RTBWARNLIMIT;
1233 } 1233 }
1234 1234
1235 return (0); 1235 return 0;
1236} 1236}
1237 1237
1238 1238
@@ -1332,7 +1332,7 @@ xfs_qm_dqget_noattach(
1332 */ 1332 */
1333 ASSERT(error != ESRCH); 1333 ASSERT(error != ESRCH);
1334 ASSERT(error != ENOENT); 1334 ASSERT(error != ENOENT);
1335 return (error); 1335 return error;
1336 } 1336 }
1337 ASSERT(udqp); 1337 ASSERT(udqp);
1338 } 1338 }
@@ -1355,7 +1355,7 @@ xfs_qm_dqget_noattach(
1355 xfs_qm_dqrele(udqp); 1355 xfs_qm_dqrele(udqp);
1356 ASSERT(error != ESRCH); 1356 ASSERT(error != ESRCH);
1357 ASSERT(error != ENOENT); 1357 ASSERT(error != ENOENT);
1358 return (error); 1358 return error;
1359 } 1359 }
1360 ASSERT(gdqp); 1360 ASSERT(gdqp);
1361 1361
@@ -1376,7 +1376,7 @@ xfs_qm_dqget_noattach(
1376 if (udqp) ASSERT(XFS_DQ_IS_LOCKED(udqp)); 1376 if (udqp) ASSERT(XFS_DQ_IS_LOCKED(udqp));
1377 if (gdqp) ASSERT(XFS_DQ_IS_LOCKED(gdqp)); 1377 if (gdqp) ASSERT(XFS_DQ_IS_LOCKED(gdqp));
1378#endif 1378#endif
1379 return (0); 1379 return 0;
1380} 1380}
1381 1381
1382/* 1382/*
@@ -1404,7 +1404,7 @@ xfs_qm_qino_alloc(
1404 XFS_TRANS_PERM_LOG_RES, 1404 XFS_TRANS_PERM_LOG_RES,
1405 XFS_CREATE_LOG_COUNT))) { 1405 XFS_CREATE_LOG_COUNT))) {
1406 xfs_trans_cancel(tp, 0); 1406 xfs_trans_cancel(tp, 0);
1407 return (error); 1407 return error;
1408 } 1408 }
1409 memset(&zerocr, 0, sizeof(zerocr)); 1409 memset(&zerocr, 0, sizeof(zerocr));
1410 memset(&zeroino, 0, sizeof(zeroino)); 1410 memset(&zeroino, 0, sizeof(zeroino));
@@ -1413,7 +1413,7 @@ xfs_qm_qino_alloc(
1413 &zerocr, 0, 1, ip, &committed))) { 1413 &zerocr, 0, 1, ip, &committed))) {
1414 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | 1414 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
1415 XFS_TRANS_ABORT); 1415 XFS_TRANS_ABORT);
1416 return (error); 1416 return error;
1417 } 1417 }
1418 1418
1419 /* 1419 /*
@@ -1461,9 +1461,9 @@ xfs_qm_qino_alloc(
1461 if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, 1461 if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES,
1462 NULL))) { 1462 NULL))) {
1463 xfs_fs_cmn_err(CE_ALERT, mp, "XFS qino_alloc failed!"); 1463 xfs_fs_cmn_err(CE_ALERT, mp, "XFS qino_alloc failed!");
1464 return (error); 1464 return error;
1465 } 1465 }
1466 return (0); 1466 return 0;
1467} 1467}
1468 1468
1469 1469
@@ -1508,7 +1508,7 @@ xfs_qm_reset_dqcounts(
1508 ddq = (xfs_disk_dquot_t *) ((xfs_dqblk_t *)ddq + 1); 1508 ddq = (xfs_disk_dquot_t *) ((xfs_dqblk_t *)ddq + 1);
1509 } 1509 }
1510 1510
1511 return (0); 1511 return 0;
1512} 1512}
1513 1513
1514STATIC int 1514STATIC int
@@ -1557,7 +1557,7 @@ xfs_qm_dqiter_bufs(
1557 bno++; 1557 bno++;
1558 firstid += XFS_QM_DQPERBLK(mp); 1558 firstid += XFS_QM_DQPERBLK(mp);
1559 } 1559 }
1560 return (error); 1560 return error;
1561} 1561}
1562 1562
1563/* 1563/*
@@ -1586,7 +1586,7 @@ xfs_qm_dqiterate(
1586 * happens only at mount time which is single threaded. 1586 * happens only at mount time which is single threaded.
1587 */ 1587 */
1588 if (qip->i_d.di_nblocks == 0) 1588 if (qip->i_d.di_nblocks == 0)
1589 return (0); 1589 return 0;
1590 1590
1591 map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP); 1591 map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP);
1592 1592
@@ -1655,7 +1655,7 @@ xfs_qm_dqiterate(
1655 1655
1656 kmem_free(map, XFS_DQITER_MAP_SIZE * sizeof(*map)); 1656 kmem_free(map, XFS_DQITER_MAP_SIZE * sizeof(*map));
1657 1657
1658 return (error); 1658 return error;
1659} 1659}
1660 1660
1661/* 1661/*
@@ -1715,7 +1715,7 @@ xfs_qm_get_rtblks(
1715 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); 1715 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
1716 if (!(ifp->if_flags & XFS_IFEXTENTS)) { 1716 if (!(ifp->if_flags & XFS_IFEXTENTS)) {
1717 if ((error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK))) 1717 if ((error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK)))
1718 return (error); 1718 return error;
1719 } 1719 }
1720 rtblks = 0; 1720 rtblks = 0;
1721 nextents = ifp->if_bytes / sizeof(xfs_bmbt_rec_t); 1721 nextents = ifp->if_bytes / sizeof(xfs_bmbt_rec_t);
@@ -1723,7 +1723,7 @@ xfs_qm_get_rtblks(
1723 for (ep = base; ep < &base[nextents]; ep++) 1723 for (ep = base; ep < &base[nextents]; ep++)
1724 rtblks += xfs_bmbt_get_blockcount(ep); 1724 rtblks += xfs_bmbt_get_blockcount(ep);
1725 *O_rtblks = (xfs_qcnt_t)rtblks; 1725 *O_rtblks = (xfs_qcnt_t)rtblks;
1726 return (0); 1726 return 0;
1727} 1727}
1728 1728
1729/* 1729/*
@@ -1767,7 +1767,7 @@ xfs_qm_dqusage_adjust(
1767 */ 1767 */
1768 if ((error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_EXCL, &ip, bno))) { 1768 if ((error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_EXCL, &ip, bno))) {
1769 *res = BULKSTAT_RV_NOTHING; 1769 *res = BULKSTAT_RV_NOTHING;
1770 return (error); 1770 return error;
1771 } 1771 }
1772 1772
1773 if (ip->i_d.di_mode == 0) { 1773 if (ip->i_d.di_mode == 0) {
@@ -1785,7 +1785,7 @@ xfs_qm_dqusage_adjust(
1785 if ((error = xfs_qm_dqget_noattach(ip, &udqp, &gdqp))) { 1785 if ((error = xfs_qm_dqget_noattach(ip, &udqp, &gdqp))) {
1786 xfs_iput(ip, XFS_ILOCK_EXCL); 1786 xfs_iput(ip, XFS_ILOCK_EXCL);
1787 *res = BULKSTAT_RV_GIVEUP; 1787 *res = BULKSTAT_RV_GIVEUP;
1788 return (error); 1788 return error;
1789 } 1789 }
1790 1790
1791 rtblks = 0; 1791 rtblks = 0;
@@ -1802,7 +1802,7 @@ xfs_qm_dqusage_adjust(
1802 if (gdqp) 1802 if (gdqp)
1803 xfs_qm_dqput(gdqp); 1803 xfs_qm_dqput(gdqp);
1804 *res = BULKSTAT_RV_GIVEUP; 1804 *res = BULKSTAT_RV_GIVEUP;
1805 return (error); 1805 return error;
1806 } 1806 }
1807 nblks = (xfs_qcnt_t)ip->i_d.di_nblocks - rtblks; 1807 nblks = (xfs_qcnt_t)ip->i_d.di_nblocks - rtblks;
1808 } 1808 }
@@ -1847,7 +1847,7 @@ xfs_qm_dqusage_adjust(
1847 * Goto next inode. 1847 * Goto next inode.
1848 */ 1848 */
1849 *res = BULKSTAT_RV_DIDONE; 1849 *res = BULKSTAT_RV_DIDONE;
1850 return (0); 1850 return 0;
1851} 1851}
1852 1852
1853/* 1853/*
@@ -2041,7 +2041,7 @@ xfs_qm_init_quotainos(
2041 XFS_QI_UQIP(mp) = uip; 2041 XFS_QI_UQIP(mp) = uip;
2042 XFS_QI_GQIP(mp) = gip; 2042 XFS_QI_GQIP(mp) = gip;
2043 2043
2044 return (0); 2044 return 0;
2045} 2045}
2046 2046
2047 2047
@@ -2062,7 +2062,7 @@ xfs_qm_shake_freelist(
2062 int nflushes; 2062 int nflushes;
2063 2063
2064 if (howmany <= 0) 2064 if (howmany <= 0)
2065 return (0); 2065 return 0;
2066 2066
2067 nreclaimed = 0; 2067 nreclaimed = 0;
2068 restarts = 0; 2068 restarts = 0;
@@ -2088,7 +2088,7 @@ xfs_qm_shake_freelist(
2088 xfs_dqunlock(dqp); 2088 xfs_dqunlock(dqp);
2089 xfs_qm_freelist_unlock(xfs_Gqm); 2089 xfs_qm_freelist_unlock(xfs_Gqm);
2090 if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS) 2090 if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
2091 return (nreclaimed); 2091 return nreclaimed;
2092 XQM_STATS_INC(xqmstats.xs_qm_dqwants); 2092 XQM_STATS_INC(xqmstats.xs_qm_dqwants);
2093 goto tryagain; 2093 goto tryagain;
2094 } 2094 }
@@ -2163,7 +2163,7 @@ xfs_qm_shake_freelist(
2163 XFS_DQ_HASH_UNLOCK(hash); 2163 XFS_DQ_HASH_UNLOCK(hash);
2164 xfs_qm_freelist_unlock(xfs_Gqm); 2164 xfs_qm_freelist_unlock(xfs_Gqm);
2165 if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS) 2165 if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
2166 return (nreclaimed); 2166 return nreclaimed;
2167 goto tryagain; 2167 goto tryagain;
2168 } 2168 }
2169 xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING"); 2169 xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING");
@@ -2188,7 +2188,7 @@ xfs_qm_shake_freelist(
2188 dqp = nextdqp; 2188 dqp = nextdqp;
2189 } 2189 }
2190 xfs_qm_freelist_unlock(xfs_Gqm); 2190 xfs_qm_freelist_unlock(xfs_Gqm);
2191 return (nreclaimed); 2191 return nreclaimed;
2192} 2192}
2193 2193
2194 2194
@@ -2202,9 +2202,9 @@ xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask)
2202 int ndqused, nfree, n; 2202 int ndqused, nfree, n;
2203 2203
2204 if (!kmem_shake_allow(gfp_mask)) 2204 if (!kmem_shake_allow(gfp_mask))
2205 return (0); 2205 return 0;
2206 if (!xfs_Gqm) 2206 if (!xfs_Gqm)
2207 return (0); 2207 return 0;
2208 2208
2209 nfree = xfs_Gqm->qm_dqfreelist.qh_nelems; /* free dquots */ 2209 nfree = xfs_Gqm->qm_dqfreelist.qh_nelems; /* free dquots */
2210 /* incore dquots in all f/s's */ 2210 /* incore dquots in all f/s's */
@@ -2213,7 +2213,7 @@ xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask)
2213 ASSERT(ndqused >= 0); 2213 ASSERT(ndqused >= 0);
2214 2214
2215 if (nfree <= ndqused && nfree < ndquot) 2215 if (nfree <= ndqused && nfree < ndquot)
2216 return (0); 2216 return 0;
2217 2217
2218 ndqused *= xfs_Gqm->qm_dqfree_ratio; /* target # of free dquots */ 2218 ndqused *= xfs_Gqm->qm_dqfree_ratio; /* target # of free dquots */
2219 n = nfree - ndqused - ndquot; /* # over target */ 2219 n = nfree - ndqused - ndquot; /* # over target */
@@ -2257,7 +2257,7 @@ xfs_qm_dqreclaim_one(void)
2257 xfs_dqunlock(dqp); 2257 xfs_dqunlock(dqp);
2258 xfs_qm_freelist_unlock(xfs_Gqm); 2258 xfs_qm_freelist_unlock(xfs_Gqm);
2259 if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS) 2259 if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
2260 return (NULL); 2260 return NULL;
2261 XQM_STATS_INC(xqmstats.xs_qm_dqwants); 2261 XQM_STATS_INC(xqmstats.xs_qm_dqwants);
2262 goto startagain; 2262 goto startagain;
2263 } 2263 }
@@ -2333,7 +2333,7 @@ xfs_qm_dqreclaim_one(void)
2333 } 2333 }
2334 2334
2335 xfs_qm_freelist_unlock(xfs_Gqm); 2335 xfs_qm_freelist_unlock(xfs_Gqm);
2336 return (dqpout); 2336 return dqpout;
2337} 2337}
2338 2338
2339 2339
@@ -2369,7 +2369,7 @@ xfs_qm_dqalloc_incore(
2369 */ 2369 */
2370 memset(&dqp->q_core, 0, sizeof(dqp->q_core)); 2370 memset(&dqp->q_core, 0, sizeof(dqp->q_core));
2371 *O_dqpp = dqp; 2371 *O_dqpp = dqp;
2372 return (B_FALSE); 2372 return B_FALSE;
2373 } 2373 }
2374 XQM_STATS_INC(xqmstats.xs_qm_dqreclaim_misses); 2374 XQM_STATS_INC(xqmstats.xs_qm_dqreclaim_misses);
2375 } 2375 }
@@ -2382,7 +2382,7 @@ xfs_qm_dqalloc_incore(
2382 *O_dqpp = kmem_zone_zalloc(xfs_Gqm->qm_dqzone, KM_SLEEP); 2382 *O_dqpp = kmem_zone_zalloc(xfs_Gqm->qm_dqzone, KM_SLEEP);
2383 atomic_inc(&xfs_Gqm->qm_totaldquots); 2383 atomic_inc(&xfs_Gqm->qm_totaldquots);
2384 2384
2385 return (B_TRUE); 2385 return B_TRUE;
2386} 2386}
2387 2387
2388 2388
@@ -2407,13 +2407,13 @@ xfs_qm_write_sb_changes(
2407 0, 2407 0,
2408 XFS_DEFAULT_LOG_COUNT))) { 2408 XFS_DEFAULT_LOG_COUNT))) {
2409 xfs_trans_cancel(tp, 0); 2409 xfs_trans_cancel(tp, 0);
2410 return (error); 2410 return error;
2411 } 2411 }
2412 2412
2413 xfs_mod_sb(tp, flags); 2413 xfs_mod_sb(tp, flags);
2414 (void) xfs_trans_commit(tp, 0, NULL); 2414 (void) xfs_trans_commit(tp, 0, NULL);
2415 2415
2416 return (0); 2416 return 0;
2417} 2417}
2418 2418
2419 2419
@@ -2463,7 +2463,7 @@ xfs_qm_vop_dqalloc(
2463 if ((error = xfs_qm_dqattach(ip, XFS_QMOPT_DQALLOC | 2463 if ((error = xfs_qm_dqattach(ip, XFS_QMOPT_DQALLOC |
2464 XFS_QMOPT_ILOCKED))) { 2464 XFS_QMOPT_ILOCKED))) {
2465 xfs_iunlock(ip, lockflags); 2465 xfs_iunlock(ip, lockflags);
2466 return (error); 2466 return error;
2467 } 2467 }
2468 } 2468 }
2469 2469
@@ -2486,7 +2486,7 @@ xfs_qm_vop_dqalloc(
2486 XFS_QMOPT_DOWARN, 2486 XFS_QMOPT_DOWARN,
2487 &uq))) { 2487 &uq))) {
2488 ASSERT(error != ENOENT); 2488 ASSERT(error != ENOENT);
2489 return (error); 2489 return error;
2490 } 2490 }
2491 /* 2491 /*
2492 * Get the ilock in the right order. 2492 * Get the ilock in the right order.
@@ -2517,7 +2517,7 @@ xfs_qm_vop_dqalloc(
2517 if (uq) 2517 if (uq)
2518 xfs_qm_dqrele(uq); 2518 xfs_qm_dqrele(uq);
2519 ASSERT(error != ENOENT); 2519 ASSERT(error != ENOENT);
2520 return (error); 2520 return error;
2521 } 2521 }
2522 xfs_dqunlock(gq); 2522 xfs_dqunlock(gq);
2523 lockflags = XFS_ILOCK_SHARED; 2523 lockflags = XFS_ILOCK_SHARED;
@@ -2565,7 +2565,7 @@ xfs_qm_vop_dqalloc(
2565 *O_gdqpp = gq; 2565 *O_gdqpp = gq;
2566 else if (gq) 2566 else if (gq)
2567 xfs_qm_dqrele(gq); 2567 xfs_qm_dqrele(gq);
2568 return (0); 2568 return 0;
2569} 2569}
2570 2570
2571/* 2571/*
@@ -2608,7 +2608,7 @@ xfs_qm_vop_chown(
2608 xfs_dqunlock(newdq); 2608 xfs_dqunlock(newdq);
2609 *IO_olddq = newdq; 2609 *IO_olddq = newdq;
2610 2610
2611 return (prevdq); 2611 return prevdq;
2612} 2612}
2613 2613
2614/* 2614/*
@@ -2702,12 +2702,12 @@ xfs_qm_vop_rename_dqattach(
2702 ip = i_tab[0]; 2702 ip = i_tab[0];
2703 2703
2704 if (! XFS_IS_QUOTA_ON(ip->i_mount)) 2704 if (! XFS_IS_QUOTA_ON(ip->i_mount))
2705 return (0); 2705 return 0;
2706 2706
2707 if (XFS_NOT_DQATTACHED(ip->i_mount, ip)) { 2707 if (XFS_NOT_DQATTACHED(ip->i_mount, ip)) {
2708 error = xfs_qm_dqattach(ip, 0); 2708 error = xfs_qm_dqattach(ip, 0);
2709 if (error) 2709 if (error)
2710 return (error); 2710 return error;
2711 } 2711 }
2712 for (i = 1; (i < 4 && i_tab[i]); i++) { 2712 for (i = 1; (i < 4 && i_tab[i]); i++) {
2713 /* 2713 /*
@@ -2717,11 +2717,11 @@ xfs_qm_vop_rename_dqattach(
2717 if (XFS_NOT_DQATTACHED(ip->i_mount, ip)) { 2717 if (XFS_NOT_DQATTACHED(ip->i_mount, ip)) {
2718 error = xfs_qm_dqattach(ip, 0); 2718 error = xfs_qm_dqattach(ip, 0);
2719 if (error) 2719 if (error)
2720 return (error); 2720 return error;
2721 } 2721 }
2722 } 2722 }
2723 } 2723 }
2724 return (0); 2724 return 0;
2725} 2725}
2726 2726
2727void 2727void
@@ -2834,7 +2834,7 @@ xfs_qm_dqhashlock_nowait(
2834 int locked; 2834 int locked;
2835 2835
2836 locked = mutex_trylock(&((dqp)->q_hash->qh_lock)); 2836 locked = mutex_trylock(&((dqp)->q_hash->qh_lock));
2837 return (locked); 2837 return locked;
2838} 2838}
2839 2839
2840int 2840int
@@ -2844,7 +2844,7 @@ xfs_qm_freelist_lock_nowait(
2844 int locked; 2844 int locked;
2845 2845
2846 locked = mutex_trylock(&(xqm->qm_dqfreelist.qh_lock)); 2846 locked = mutex_trylock(&(xqm->qm_dqfreelist.qh_lock));
2847 return (locked); 2847 return locked;
2848} 2848}
2849 2849
2850STATIC int 2850STATIC int
@@ -2855,5 +2855,5 @@ xfs_qm_mplist_nowait(
2855 2855
2856 ASSERT(mp->m_quotainfo); 2856 ASSERT(mp->m_quotainfo);
2857 locked = mutex_trylock(&(XFS_QI_MPLLOCK(mp))); 2857 locked = mutex_trylock(&(XFS_QI_MPLLOCK(mp)));
2858 return (locked); 2858 return locked;
2859} 2859}
diff --git a/fs/xfs/xfs_dir_leaf.c b/fs/xfs/xfs_dir_leaf.c
index 950df31efc46..e83074016abb 100644
--- a/fs/xfs/xfs_dir_leaf.c
+++ b/fs/xfs/xfs_dir_leaf.c
@@ -147,7 +147,7 @@ xfs_dir_shortform_create(xfs_da_args_t *args, xfs_ino_t parent)
147 hdr->count = 0; 147 hdr->count = 0;
148 dp->i_d.di_size = sizeof(*hdr); 148 dp->i_d.di_size = sizeof(*hdr);
149 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 149 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
150 return(0); 150 return 0;
151} 151}
152 152
153/* 153/*
@@ -180,7 +180,7 @@ xfs_dir_shortform_addname(xfs_da_args_t *args)
180 if (sfe->namelen == args->namelen && 180 if (sfe->namelen == args->namelen &&
181 args->name[0] == sfe->name[0] && 181 args->name[0] == sfe->name[0] &&
182 memcmp(args->name, sfe->name, args->namelen) == 0) 182 memcmp(args->name, sfe->name, args->namelen) == 0)
183 return(XFS_ERROR(EEXIST)); 183 return XFS_ERROR(EEXIST);
184 sfe = XFS_DIR_SF_NEXTENTRY(sfe); 184 sfe = XFS_DIR_SF_NEXTENTRY(sfe);
185 } 185 }
186 186
@@ -198,7 +198,7 @@ xfs_dir_shortform_addname(xfs_da_args_t *args)
198 dp->i_d.di_size += size; 198 dp->i_d.di_size += size;
199 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 199 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
200 200
201 return(0); 201 return 0;
202} 202}
203 203
204/* 204/*
@@ -238,7 +238,7 @@ xfs_dir_shortform_removename(xfs_da_args_t *args)
238 } 238 }
239 if (i < 0) { 239 if (i < 0) {
240 ASSERT(args->oknoent); 240 ASSERT(args->oknoent);
241 return(XFS_ERROR(ENOENT)); 241 return XFS_ERROR(ENOENT);
242 } 242 }
243 243
244 if ((base + size) != dp->i_d.di_size) { 244 if ((base + size) != dp->i_d.di_size) {
@@ -251,7 +251,7 @@ xfs_dir_shortform_removename(xfs_da_args_t *args)
251 dp->i_d.di_size -= size; 251 dp->i_d.di_size -= size;
252 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 252 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
253 253
254 return(0); 254 return 0;
255} 255}
256 256
257/* 257/*
@@ -390,7 +390,7 @@ xfs_dir_shortform_to_leaf(xfs_da_args_t *iargs)
390 390
391out: 391out:
392 kmem_free(tmpbuffer, size); 392 kmem_free(tmpbuffer, size);
393 return(retval); 393 return retval;
394} 394}
395 395
396STATIC int 396STATIC int
@@ -596,7 +596,7 @@ xfs_dir_shortform_replace(xfs_da_args_t *args)
596 /* XXX - replace assert? */ 596 /* XXX - replace assert? */
597 XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sf->hdr.parent); 597 XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sf->hdr.parent);
598 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); 598 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA);
599 return(0); 599 return 0;
600 } 600 }
601 ASSERT(args->namelen != 1 || args->name[0] != '.'); 601 ASSERT(args->namelen != 1 || args->name[0] != '.');
602 sfe = &sf->list[0]; 602 sfe = &sf->list[0];
@@ -608,12 +608,12 @@ xfs_dir_shortform_replace(xfs_da_args_t *args)
608 (char *)&sfe->inumber, sizeof(xfs_ino_t))); 608 (char *)&sfe->inumber, sizeof(xfs_ino_t)));
609 XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sfe->inumber); 609 XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sfe->inumber);
610 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); 610 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA);
611 return(0); 611 return 0;
612 } 612 }
613 sfe = XFS_DIR_SF_NEXTENTRY(sfe); 613 sfe = XFS_DIR_SF_NEXTENTRY(sfe);
614 } 614 }
615 ASSERT(args->oknoent); 615 ASSERT(args->oknoent);
616 return(XFS_ERROR(ENOENT)); 616 return XFS_ERROR(ENOENT);
617} 617}
618 618
619/* 619/*
@@ -695,7 +695,7 @@ xfs_dir_leaf_to_shortform(xfs_da_args_t *iargs)
695 695
696out: 696out:
697 kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount)); 697 kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount));
698 return(retval); 698 return retval;
699} 699}
700 700
701/* 701/*
@@ -715,17 +715,17 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args)
715 retval = xfs_da_grow_inode(args, &blkno); 715 retval = xfs_da_grow_inode(args, &blkno);
716 ASSERT(blkno == 1); 716 ASSERT(blkno == 1);
717 if (retval) 717 if (retval)
718 return(retval); 718 return retval;
719 retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp1, 719 retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp1,
720 XFS_DATA_FORK); 720 XFS_DATA_FORK);
721 if (retval) 721 if (retval)
722 return(retval); 722 return retval;
723 ASSERT(bp1 != NULL); 723 ASSERT(bp1 != NULL);
724 retval = xfs_da_get_buf(args->trans, args->dp, 1, -1, &bp2, 724 retval = xfs_da_get_buf(args->trans, args->dp, 1, -1, &bp2,
725 XFS_DATA_FORK); 725 XFS_DATA_FORK);
726 if (retval) { 726 if (retval) {
727 xfs_da_buf_done(bp1); 727 xfs_da_buf_done(bp1);
728 return(retval); 728 return retval;
729 } 729 }
730 ASSERT(bp2 != NULL); 730 ASSERT(bp2 != NULL);
731 memcpy(bp2->data, bp1->data, XFS_LBSIZE(dp->i_mount)); 731 memcpy(bp2->data, bp1->data, XFS_LBSIZE(dp->i_mount));
@@ -738,7 +738,7 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args)
738 retval = xfs_da_node_create(args, 0, 1, &bp1, XFS_DATA_FORK); 738 retval = xfs_da_node_create(args, 0, 1, &bp1, XFS_DATA_FORK);
739 if (retval) { 739 if (retval) {
740 xfs_da_buf_done(bp2); 740 xfs_da_buf_done(bp2);
741 return(retval); 741 return retval;
742 } 742 }
743 node = bp1->data; 743 node = bp1->data;
744 leaf = bp2->data; 744 leaf = bp2->data;
@@ -751,7 +751,7 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args)
751 XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0]))); 751 XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0])));
752 xfs_da_buf_done(bp1); 752 xfs_da_buf_done(bp1);
753 753
754 return(retval); 754 return retval;
755} 755}
756 756
757 757
@@ -776,7 +776,7 @@ xfs_dir_leaf_create(xfs_da_args_t *args, xfs_dablk_t blkno, xfs_dabuf_t **bpp)
776 ASSERT(dp != NULL); 776 ASSERT(dp != NULL);
777 retval = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp, XFS_DATA_FORK); 777 retval = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp, XFS_DATA_FORK);
778 if (retval) 778 if (retval)
779 return(retval); 779 return retval;
780 ASSERT(bp != NULL); 780 ASSERT(bp != NULL);
781 leaf = bp->data; 781 leaf = bp->data;
782 memset((char *)leaf, 0, XFS_LBSIZE(dp->i_mount)); 782 memset((char *)leaf, 0, XFS_LBSIZE(dp->i_mount));
@@ -791,7 +791,7 @@ xfs_dir_leaf_create(xfs_da_args_t *args, xfs_dablk_t blkno, xfs_dabuf_t **bpp)
791 xfs_da_log_buf(args->trans, bp, 0, XFS_LBSIZE(dp->i_mount) - 1); 791 xfs_da_log_buf(args->trans, bp, 0, XFS_LBSIZE(dp->i_mount) - 1);
792 792
793 *bpp = bp; 793 *bpp = bp;
794 return(0); 794 return 0;
795} 795}
796 796
797/* 797/*
@@ -813,10 +813,10 @@ xfs_dir_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
813 ASSERT(oldblk->magic == XFS_DIR_LEAF_MAGIC); 813 ASSERT(oldblk->magic == XFS_DIR_LEAF_MAGIC);
814 error = xfs_da_grow_inode(args, &blkno); 814 error = xfs_da_grow_inode(args, &blkno);
815 if (error) 815 if (error)
816 return(error); 816 return error;
817 error = xfs_dir_leaf_create(args, blkno, &newblk->bp); 817 error = xfs_dir_leaf_create(args, blkno, &newblk->bp);
818 if (error) 818 if (error)
819 return(error); 819 return error;
820 newblk->blkno = blkno; 820 newblk->blkno = blkno;
821 newblk->magic = XFS_DIR_LEAF_MAGIC; 821 newblk->magic = XFS_DIR_LEAF_MAGIC;
822 822
@@ -826,7 +826,7 @@ xfs_dir_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
826 xfs_dir_leaf_rebalance(state, oldblk, newblk); 826 xfs_dir_leaf_rebalance(state, oldblk, newblk);
827 error = xfs_da_blk_link(state, oldblk, newblk); 827 error = xfs_da_blk_link(state, oldblk, newblk);
828 if (error) 828 if (error)
829 return(error); 829 return error;
830 830
831 /* 831 /*
832 * Insert the new entry in the correct block. 832 * Insert the new entry in the correct block.
@@ -842,7 +842,7 @@ xfs_dir_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
842 */ 842 */
843 oldblk->hashval = xfs_dir_leaf_lasthash(oldblk->bp, NULL); 843 oldblk->hashval = xfs_dir_leaf_lasthash(oldblk->bp, NULL);
844 newblk->hashval = xfs_dir_leaf_lasthash(newblk->bp, NULL); 844 newblk->hashval = xfs_dir_leaf_lasthash(newblk->bp, NULL);
845 return(error); 845 return error;
846} 846}
847 847
848/* 848/*
@@ -885,7 +885,7 @@ xfs_dir_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args, int index)
885 if (INT_GET(map->size, ARCH_CONVERT) >= tmp) { 885 if (INT_GET(map->size, ARCH_CONVERT) >= tmp) {
886 if (!args->justcheck) 886 if (!args->justcheck)
887 xfs_dir_leaf_add_work(bp, args, index, i); 887 xfs_dir_leaf_add_work(bp, args, index, i);
888 return(0); 888 return 0;
889 } 889 }
890 sum += INT_GET(map->size, ARCH_CONVERT); 890 sum += INT_GET(map->size, ARCH_CONVERT);
891 } 891 }
@@ -896,7 +896,7 @@ xfs_dir_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args, int index)
896 * no good and we should just give up. 896 * no good and we should just give up.
897 */ 897 */
898 if (!hdr->holes && (sum < entsize)) 898 if (!hdr->holes && (sum < entsize))
899 return(XFS_ERROR(ENOSPC)); 899 return XFS_ERROR(ENOSPC);
900 900
901 /* 901 /*
902 * Compact the entries to coalesce free space. 902 * Compact the entries to coalesce free space.
@@ -909,18 +909,18 @@ xfs_dir_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args, int index)
909 (uint)sizeof(xfs_dir_leaf_entry_t) : 0, 909 (uint)sizeof(xfs_dir_leaf_entry_t) : 0,
910 args->justcheck); 910 args->justcheck);
911 if (error) 911 if (error)
912 return(error); 912 return error;
913 /* 913 /*
914 * After compaction, the block is guaranteed to have only one 914 * After compaction, the block is guaranteed to have only one
915 * free region, in freemap[0]. If it is not big enough, give up. 915 * free region, in freemap[0]. If it is not big enough, give up.
916 */ 916 */
917 if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT) < 917 if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT) <
918 (entsize + (uint)sizeof(xfs_dir_leaf_entry_t))) 918 (entsize + (uint)sizeof(xfs_dir_leaf_entry_t)))
919 return(XFS_ERROR(ENOSPC)); 919 return XFS_ERROR(ENOSPC);
920 920
921 if (!args->justcheck) 921 if (!args->justcheck)
922 xfs_dir_leaf_add_work(bp, args, index, 0); 922 xfs_dir_leaf_add_work(bp, args, index, 0);
923 return(0); 923 return 0;
924} 924}
925 925
926/* 926/*
@@ -1072,7 +1072,7 @@ xfs_dir_leaf_compact(xfs_trans_t *trans, xfs_dabuf_t *bp, int musthave,
1072 kmem_free(tmpbuffer, lbsize); 1072 kmem_free(tmpbuffer, lbsize);
1073 if (musthave || justcheck) 1073 if (musthave || justcheck)
1074 kmem_free(tmpbuffer2, lbsize); 1074 kmem_free(tmpbuffer2, lbsize);
1075 return(rval); 1075 return rval;
1076} 1076}
1077 1077
1078/* 1078/*
@@ -1292,7 +1292,7 @@ xfs_dir_leaf_figure_balance(xfs_da_state_t *state,
1292 1292
1293 *countarg = count; 1293 *countarg = count;
1294 *namebytesarg = totallen; 1294 *namebytesarg = totallen;
1295 return(foundit); 1295 return foundit;
1296} 1296}
1297 1297
1298/*======================================================================== 1298/*========================================================================
@@ -1334,7 +1334,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action)
1334 INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); 1334 INT_GET(leaf->hdr.namebytes, ARCH_CONVERT);
1335 if (bytes > (state->blocksize >> 1)) { 1335 if (bytes > (state->blocksize >> 1)) {
1336 *action = 0; /* blk over 50%, don't try to join */ 1336 *action = 0; /* blk over 50%, don't try to join */
1337 return(0); 1337 return 0;
1338 } 1338 }
1339 1339
1340 /* 1340 /*
@@ -1353,13 +1353,13 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action)
1353 error = xfs_da_path_shift(state, &state->altpath, forward, 1353 error = xfs_da_path_shift(state, &state->altpath, forward,
1354 0, &retval); 1354 0, &retval);
1355 if (error) 1355 if (error)
1356 return(error); 1356 return error;
1357 if (retval) { 1357 if (retval) {
1358 *action = 0; 1358 *action = 0;
1359 } else { 1359 } else {
1360 *action = 2; 1360 *action = 2;
1361 } 1361 }
1362 return(0); 1362 return 0;
1363 } 1363 }
1364 1364
1365 /* 1365 /*
@@ -1381,7 +1381,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action)
1381 blkno, -1, &bp, 1381 blkno, -1, &bp,
1382 XFS_DATA_FORK); 1382 XFS_DATA_FORK);
1383 if (error) 1383 if (error)
1384 return(error); 1384 return error;
1385 ASSERT(bp != NULL); 1385 ASSERT(bp != NULL);
1386 1386
1387 leaf = (xfs_dir_leafblock_t *)info; 1387 leaf = (xfs_dir_leafblock_t *)info;
@@ -1402,7 +1402,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action)
1402 } 1402 }
1403 if (i >= 2) { 1403 if (i >= 2) {
1404 *action = 0; 1404 *action = 0;
1405 return(0); 1405 return 0;
1406 } 1406 }
1407 xfs_da_buf_done(bp); 1407 xfs_da_buf_done(bp);
1408 1408
@@ -1419,13 +1419,13 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action)
1419 0, &retval); 1419 0, &retval);
1420 } 1420 }
1421 if (error) 1421 if (error)
1422 return(error); 1422 return error;
1423 if (retval) { 1423 if (retval) {
1424 *action = 0; 1424 *action = 0;
1425 } else { 1425 } else {
1426 *action = 1; 1426 *action = 1;
1427 } 1427 }
1428 return(0); 1428 return 0;
1429} 1429}
1430 1430
1431/* 1431/*
@@ -1575,8 +1575,8 @@ xfs_dir_leaf_remove(xfs_trans_t *trans, xfs_dabuf_t *bp, int index)
1575 tmp += INT_GET(leaf->hdr.count, ARCH_CONVERT) * ((uint)sizeof(xfs_dir_leaf_name_t) - 1); 1575 tmp += INT_GET(leaf->hdr.count, ARCH_CONVERT) * ((uint)sizeof(xfs_dir_leaf_name_t) - 1);
1576 tmp += INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); 1576 tmp += INT_GET(leaf->hdr.namebytes, ARCH_CONVERT);
1577 if (tmp < mp->m_dir_magicpct) 1577 if (tmp < mp->m_dir_magicpct)
1578 return(1); /* leaf is < 37% full */ 1578 return 1; /* leaf is < 37% full */
1579 return(0); 1579 return 0;
1580} 1580}
1581 1581
1582/* 1582/*
@@ -1732,7 +1732,7 @@ xfs_dir_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args, int *index)
1732 if ((probe == INT_GET(leaf->hdr.count, ARCH_CONVERT)) || (INT_GET(entry->hashval, ARCH_CONVERT) != hashval)) { 1732 if ((probe == INT_GET(leaf->hdr.count, ARCH_CONVERT)) || (INT_GET(entry->hashval, ARCH_CONVERT) != hashval)) {
1733 *index = probe; 1733 *index = probe;
1734 ASSERT(args->oknoent); 1734 ASSERT(args->oknoent);
1735 return(XFS_ERROR(ENOENT)); 1735 return XFS_ERROR(ENOENT);
1736 } 1736 }
1737 1737
1738 /* 1738 /*
@@ -1745,14 +1745,14 @@ xfs_dir_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args, int *index)
1745 memcmp(args->name, namest->name, args->namelen) == 0) { 1745 memcmp(args->name, namest->name, args->namelen) == 0) {
1746 XFS_DIR_SF_GET_DIRINO(&namest->inumber, &args->inumber); 1746 XFS_DIR_SF_GET_DIRINO(&namest->inumber, &args->inumber);
1747 *index = probe; 1747 *index = probe;
1748 return(XFS_ERROR(EEXIST)); 1748 return XFS_ERROR(EEXIST);
1749 } 1749 }
1750 entry++; 1750 entry++;
1751 probe++; 1751 probe++;
1752 } 1752 }
1753 *index = probe; 1753 *index = probe;
1754 ASSERT(probe == INT_GET(leaf->hdr.count, ARCH_CONVERT) || args->oknoent); 1754 ASSERT(probe == INT_GET(leaf->hdr.count, ARCH_CONVERT) || args->oknoent);
1755 return(XFS_ERROR(ENOENT)); 1755 return XFS_ERROR(ENOENT);
1756} 1756}
1757 1757
1758/*======================================================================== 1758/*========================================================================
@@ -1890,9 +1890,9 @@ xfs_dir_leaf_order(xfs_dabuf_t *leaf1_bp, xfs_dabuf_t *leaf2_bp)
1890 INT_GET(leaf1->entries[ 0 ].hashval, ARCH_CONVERT)) || 1890 INT_GET(leaf1->entries[ 0 ].hashval, ARCH_CONVERT)) ||
1891 (INT_GET(leaf2->entries[ INT_GET(leaf2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < 1891 (INT_GET(leaf2->entries[ INT_GET(leaf2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) <
1892 INT_GET(leaf1->entries[ INT_GET(leaf1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) { 1892 INT_GET(leaf1->entries[ INT_GET(leaf1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) {
1893 return(1); 1893 return 1;
1894 } 1894 }
1895 return(0); 1895 return 0;
1896} 1896}
1897 1897
1898/* 1898/*
@@ -1942,7 +1942,7 @@ xfs_dir_leaf_getdents_int(
1942 leaf = bp->data; 1942 leaf = bp->data;
1943 if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) { 1943 if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) {
1944 *eobp = 1; 1944 *eobp = 1;
1945 return(XFS_ERROR(ENOENT)); /* XXX wrong code */ 1945 return XFS_ERROR(ENOENT); /* XXX wrong code */
1946 } 1946 }
1947 1947
1948 want_entno = XFS_DA_COOKIE_ENTRY(mp, uio->uio_offset); 1948 want_entno = XFS_DA_COOKIE_ENTRY(mp, uio->uio_offset);
@@ -2000,7 +2000,7 @@ xfs_dir_leaf_getdents_int(
2000 * the node code will be setting uio_offset anyway. 2000 * the node code will be setting uio_offset anyway.
2001 */ 2001 */
2002 *eobp = 0; 2002 *eobp = 0;
2003 return(0); 2003 return 0;
2004 } 2004 }
2005 xfs_dir_trace_g_due("leaf: hash found", dp, uio, entry); 2005 xfs_dir_trace_g_due("leaf: hash found", dp, uio, entry);
2006 2006
@@ -2057,7 +2057,7 @@ xfs_dir_leaf_getdents_int(
2057 retval = xfs_da_read_buf(dp->i_transp, dp, thishash, 2057 retval = xfs_da_read_buf(dp->i_transp, dp, thishash,
2058 nextda, &bp2, XFS_DATA_FORK); 2058 nextda, &bp2, XFS_DATA_FORK);
2059 if (retval) 2059 if (retval)
2060 return(retval); 2060 return retval;
2061 2061
2062 ASSERT(bp2 != NULL); 2062 ASSERT(bp2 != NULL);
2063 2063
@@ -2073,7 +2073,7 @@ xfs_dir_leaf_getdents_int(
2073 leaf2); 2073 leaf2);
2074 xfs_da_brelse(dp->i_transp, bp2); 2074 xfs_da_brelse(dp->i_transp, bp2);
2075 2075
2076 return(XFS_ERROR(EFSCORRUPTED)); 2076 return XFS_ERROR(EFSCORRUPTED);
2077 } 2077 }
2078 2078
2079 nexthash = INT_GET(leaf2->entries[0].hashval, 2079 nexthash = INT_GET(leaf2->entries[0].hashval,
@@ -2139,7 +2139,7 @@ xfs_dir_leaf_getdents_int(
2139 2139
2140 xfs_dir_trace_g_du("leaf: E-O-B", dp, uio); 2140 xfs_dir_trace_g_du("leaf: E-O-B", dp, uio);
2141 2141
2142 return(retval); 2142 return retval;
2143 } 2143 }
2144 } 2144 }
2145 2145
@@ -2149,7 +2149,7 @@ xfs_dir_leaf_getdents_int(
2149 2149
2150 xfs_dir_trace_g_du("leaf: E-O-F", dp, uio); 2150 xfs_dir_trace_g_du("leaf: E-O-F", dp, uio);
2151 2151
2152 return(0); 2152 return 0;
2153} 2153}
2154 2154
2155/* 2155/*
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 163031c1e394..b4d971b01588 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -501,7 +501,7 @@ xfs_reserve_blocks(
501 if (inval == (__uint64_t *)NULL) { 501 if (inval == (__uint64_t *)NULL) {
502 outval->resblks = mp->m_resblks; 502 outval->resblks = mp->m_resblks;
503 outval->resblks_avail = mp->m_resblks_avail; 503 outval->resblks_avail = mp->m_resblks_avail;
504 return(0); 504 return 0;
505 } 505 }
506 506
507 request = *inval; 507 request = *inval;
@@ -537,7 +537,7 @@ xfs_reserve_blocks(
537 outval->resblks = mp->m_resblks; 537 outval->resblks = mp->m_resblks;
538 outval->resblks_avail = mp->m_resblks_avail; 538 outval->resblks_avail = mp->m_resblks_avail;
539 XFS_SB_UNLOCK(mp, s); 539 XFS_SB_UNLOCK(mp, s);
540 return(0); 540 return 0;
541} 541}
542 542
543void 543void
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 3d9a36e77363..9176995160ed 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -403,7 +403,7 @@ xfs_log_release_iclog(xfs_mount_t *mp,
403 403
404 if (xlog_state_release_iclog(log, iclog)) { 404 if (xlog_state_release_iclog(log, iclog)) {
405 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 405 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR);
406 return(EIO); 406 return EIO;
407 } 407 }
408 408
409 return 0; 409 return 0;
@@ -556,7 +556,7 @@ xfs_log_unmount(xfs_mount_t *mp)
556 556
557 error = xfs_log_unmount_write(mp); 557 error = xfs_log_unmount_write(mp);
558 xfs_log_unmount_dealloc(mp); 558 xfs_log_unmount_dealloc(mp);
559 return (error); 559 return error;
560} 560}
561 561
562/* 562/*
@@ -728,7 +728,7 @@ xfs_log_write(xfs_mount_t * mp,
728 if ((error = xlog_write(mp, reg, nentries, tic, start_lsn, NULL, 0))) { 728 if ((error = xlog_write(mp, reg, nentries, tic, start_lsn, NULL, 0))) {
729 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 729 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR);
730 } 730 }
731 return (error); 731 return error;
732} /* xfs_log_write */ 732} /* xfs_log_write */
733 733
734 734
@@ -836,7 +836,7 @@ xfs_log_need_covered(xfs_mount_t *mp)
836 needed = 1; 836 needed = 1;
837 } 837 }
838 LOG_UNLOCK(log, s); 838 LOG_UNLOCK(log, s);
839 return(needed); 839 return needed;
840} 840}
841 841
842/****************************************************************************** 842/******************************************************************************
@@ -1003,7 +1003,7 @@ xlog_bdstrat_cb(struct xfs_buf *bp)
1003 XFS_BUF_ERROR(bp, EIO); 1003 XFS_BUF_ERROR(bp, EIO);
1004 XFS_BUF_STALE(bp); 1004 XFS_BUF_STALE(bp);
1005 xfs_biodone(bp); 1005 xfs_biodone(bp);
1006 return (XFS_ERROR(EIO)); 1006 return XFS_ERROR(EIO);
1007 1007
1008 1008
1009} 1009}
@@ -1263,7 +1263,7 @@ xlog_commit_record(xfs_mount_t *mp,
1263 iclog, XLOG_COMMIT_TRANS))) { 1263 iclog, XLOG_COMMIT_TRANS))) {
1264 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR); 1264 xfs_force_shutdown(mp, XFS_LOG_IO_ERROR);
1265 } 1265 }
1266 return (error); 1266 return error;
1267} /* xlog_commit_record */ 1267} /* xlog_commit_record */
1268 1268
1269 1269
@@ -1460,7 +1460,7 @@ xlog_sync(xlog_t *log,
1460 if ((error = XFS_bwrite(bp))) { 1460 if ((error = XFS_bwrite(bp))) {
1461 xfs_ioerror_alert("xlog_sync", log->l_mp, bp, 1461 xfs_ioerror_alert("xlog_sync", log->l_mp, bp,
1462 XFS_BUF_ADDR(bp)); 1462 XFS_BUF_ADDR(bp));
1463 return (error); 1463 return error;
1464 } 1464 }
1465 if (split) { 1465 if (split) {
1466 bp = iclog->ic_log->l_xbuf; 1466 bp = iclog->ic_log->l_xbuf;
@@ -1498,10 +1498,10 @@ xlog_sync(xlog_t *log,
1498 if ((error = XFS_bwrite(bp))) { 1498 if ((error = XFS_bwrite(bp))) {
1499 xfs_ioerror_alert("xlog_sync (split)", log->l_mp, 1499 xfs_ioerror_alert("xlog_sync (split)", log->l_mp,
1500 bp, XFS_BUF_ADDR(bp)); 1500 bp, XFS_BUF_ADDR(bp));
1501 return (error); 1501 return error;
1502 } 1502 }
1503 } 1503 }
1504 return (0); 1504 return 0;
1505} /* xlog_sync */ 1505} /* xlog_sync */
1506 1506
1507 1507
@@ -1798,7 +1798,7 @@ xlog_write(xfs_mount_t * mp,
1798 for (index = 0; index < nentries; ) { 1798 for (index = 0; index < nentries; ) {
1799 if ((error = xlog_state_get_iclog_space(log, len, &iclog, ticket, 1799 if ((error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
1800 &contwr, &log_offset))) 1800 &contwr, &log_offset)))
1801 return (error); 1801 return error;
1802 1802
1803 ASSERT(log_offset <= iclog->ic_size - 1); 1803 ASSERT(log_offset <= iclog->ic_size - 1);
1804 ptr = (__psint_t) ((char *)iclog->ic_datap+log_offset); 1804 ptr = (__psint_t) ((char *)iclog->ic_datap+log_offset);
@@ -1903,7 +1903,7 @@ xlog_write(xfs_mount_t * mp,
1903 xlog_state_finish_copy(log, iclog, record_cnt, data_cnt); 1903 xlog_state_finish_copy(log, iclog, record_cnt, data_cnt);
1904 record_cnt = data_cnt = 0; 1904 record_cnt = data_cnt = 0;
1905 if ((error = xlog_state_release_iclog(log, iclog))) 1905 if ((error = xlog_state_release_iclog(log, iclog)))
1906 return (error); 1906 return error;
1907 break; /* don't increment index */ 1907 break; /* don't increment index */
1908 } else { /* copied entire region */ 1908 } else { /* copied entire region */
1909 index++; 1909 index++;
@@ -1917,7 +1917,7 @@ xlog_write(xfs_mount_t * mp,
1917 ASSERT(flags & XLOG_COMMIT_TRANS); 1917 ASSERT(flags & XLOG_COMMIT_TRANS);
1918 *commit_iclog = iclog; 1918 *commit_iclog = iclog;
1919 } else if ((error = xlog_state_release_iclog(log, iclog))) 1919 } else if ((error = xlog_state_release_iclog(log, iclog)))
1920 return (error); 1920 return error;
1921 if (index == nentries) 1921 if (index == nentries)
1922 return 0; /* we are done */ 1922 return 0; /* we are done */
1923 else 1923 else
@@ -1934,7 +1934,7 @@ xlog_write(xfs_mount_t * mp,
1934 *commit_iclog = iclog; 1934 *commit_iclog = iclog;
1935 return 0; 1935 return 0;
1936 } 1936 }
1937 return (xlog_state_release_iclog(log, iclog)); 1937 return xlog_state_release_iclog(log, iclog);
1938} /* xlog_write */ 1938} /* xlog_write */
1939 1939
1940 1940
@@ -2050,7 +2050,7 @@ xlog_get_lowest_lsn(
2050 } 2050 }
2051 lsn_log = lsn_log->ic_next; 2051 lsn_log = lsn_log->ic_next;
2052 } while (lsn_log != log->l_iclog); 2052 } while (lsn_log != log->l_iclog);
2053 return(lowest_lsn); 2053 return lowest_lsn;
2054} 2054}
2055 2055
2056 2056
@@ -2402,7 +2402,7 @@ restart:
2402 if (iclog->ic_refcnt == 1) { 2402 if (iclog->ic_refcnt == 1) {
2403 LOG_UNLOCK(log, s); 2403 LOG_UNLOCK(log, s);
2404 if ((error = xlog_state_release_iclog(log, iclog))) 2404 if ((error = xlog_state_release_iclog(log, iclog)))
2405 return (error); 2405 return error;
2406 } else { 2406 } else {
2407 iclog->ic_refcnt--; 2407 iclog->ic_refcnt--;
2408 LOG_UNLOCK(log, s); 2408 LOG_UNLOCK(log, s);
@@ -2569,7 +2569,7 @@ xlog_regrant_write_log_space(xlog_t *log,
2569 XLOG_TIC_RESET_RES(tic); 2569 XLOG_TIC_RESET_RES(tic);
2570 2570
2571 if (tic->t_cnt > 0) 2571 if (tic->t_cnt > 0)
2572 return (0); 2572 return 0;
2573 2573
2574#ifdef DEBUG 2574#ifdef DEBUG
2575 if (log->l_flags & XLOG_ACTIVE_RECOVERY) 2575 if (log->l_flags & XLOG_ACTIVE_RECOVERY)
@@ -2667,7 +2667,7 @@ redo:
2667 xlog_trace_loggrant(log, tic, "xlog_regrant_write_log_space: exit"); 2667 xlog_trace_loggrant(log, tic, "xlog_regrant_write_log_space: exit");
2668 xlog_verify_grant_head(log, 1); 2668 xlog_verify_grant_head(log, 1);
2669 GRANT_UNLOCK(log, s); 2669 GRANT_UNLOCK(log, s);
2670 return (0); 2670 return 0;
2671 2671
2672 2672
2673 error_return: 2673 error_return:
@@ -2837,7 +2837,7 @@ xlog_state_release_iclog(xlog_t *log,
2837 if (sync) { 2837 if (sync) {
2838 return xlog_sync(log, iclog); 2838 return xlog_sync(log, iclog);
2839 } 2839 }
2840 return (0); 2840 return 0;
2841 2841
2842} /* xlog_state_release_iclog */ 2842} /* xlog_state_release_iclog */
2843 2843
@@ -3127,7 +3127,7 @@ try_again:
3127 } while (iclog != log->l_iclog); 3127 } while (iclog != log->l_iclog);
3128 3128
3129 LOG_UNLOCK(log, s); 3129 LOG_UNLOCK(log, s);
3130 return (0); 3130 return 0;
3131} /* xlog_state_sync */ 3131} /* xlog_state_sync */
3132 3132
3133 3133
@@ -3545,12 +3545,12 @@ xlog_state_ioerror(
3545 ic->ic_state = XLOG_STATE_IOERROR; 3545 ic->ic_state = XLOG_STATE_IOERROR;
3546 ic = ic->ic_next; 3546 ic = ic->ic_next;
3547 } while (ic != iclog); 3547 } while (ic != iclog);
3548 return (0); 3548 return 0;
3549 } 3549 }
3550 /* 3550 /*
3551 * Return non-zero, if state transition has already happened. 3551 * Return non-zero, if state transition has already happened.
3552 */ 3552 */
3553 return (1); 3553 return 1;
3554} 3554}
3555 3555
3556/* 3556/*
@@ -3587,7 +3587,7 @@ xfs_log_force_umount(
3587 log->l_flags & XLOG_ACTIVE_RECOVERY) { 3587 log->l_flags & XLOG_ACTIVE_RECOVERY) {
3588 mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN; 3588 mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN;
3589 XFS_BUF_DONE(mp->m_sb_bp); 3589 XFS_BUF_DONE(mp->m_sb_bp);
3590 return (0); 3590 return 0;
3591 } 3591 }
3592 3592
3593 /* 3593 /*
@@ -3596,7 +3596,7 @@ xfs_log_force_umount(
3596 */ 3596 */
3597 if (logerror && log->l_iclog->ic_state & XLOG_STATE_IOERROR) { 3597 if (logerror && log->l_iclog->ic_state & XLOG_STATE_IOERROR) {
3598 ASSERT(XLOG_FORCED_SHUTDOWN(log)); 3598 ASSERT(XLOG_FORCED_SHUTDOWN(log));
3599 return (1); 3599 return 1;
3600 } 3600 }
3601 retval = 0; 3601 retval = 0;
3602 /* 3602 /*
@@ -3678,7 +3678,7 @@ xfs_log_force_umount(
3678 } 3678 }
3679#endif 3679#endif
3680 /* return non-zero if log IOERROR transition had already happened */ 3680 /* return non-zero if log IOERROR transition had already happened */
3681 return (retval); 3681 return retval;
3682} 3682}
3683 3683
3684STATIC int 3684STATIC int
@@ -3692,8 +3692,8 @@ xlog_iclogs_empty(xlog_t *log)
3692 * any language. 3692 * any language.
3693 */ 3693 */
3694 if (iclog->ic_header.h_num_logops) 3694 if (iclog->ic_header.h_num_logops)
3695 return(0); 3695 return 0;
3696 iclog = iclog->ic_next; 3696 iclog = iclog->ic_next;
3697 } while (iclog != log->l_iclog); 3697 } while (iclog != log->l_iclog);
3698 return(1); 3698 return 1;
3699} 3699}
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 6088e14f84e3..62188ea392c7 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -646,7 +646,7 @@ xfs_mountfs(
646 646
647 if (mp->m_sb_bp == NULL) { 647 if (mp->m_sb_bp == NULL) {
648 if ((error = xfs_readsb(mp))) { 648 if ((error = xfs_readsb(mp))) {
649 return (error); 649 return error;
650 } 650 }
651 } 651 }
652 xfs_mount_common(mp, sbp); 652 xfs_mount_common(mp, sbp);
@@ -889,7 +889,7 @@ xfs_mountfs(
889 * For client case we are done now 889 * For client case we are done now
890 */ 890 */
891 if (mfsi_flags & XFS_MFSI_CLIENT) { 891 if (mfsi_flags & XFS_MFSI_CLIENT) {
892 return(0); 892 return 0;
893 } 893 }
894 894
895 /* 895 /*
@@ -1182,7 +1182,7 @@ xfs_unmountfs_writesb(xfs_mount_t *mp)
1182 xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting. Filesystem may not be marked shared readonly"); 1182 xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting. Filesystem may not be marked shared readonly");
1183 } 1183 }
1184 xfs_buf_relse(sbp); 1184 xfs_buf_relse(sbp);
1185 return (error); 1185 return error;
1186} 1186}
1187 1187
1188/* 1188/*
@@ -1257,19 +1257,19 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
1257 lcounter += delta; 1257 lcounter += delta;
1258 if (lcounter < 0) { 1258 if (lcounter < 0) {
1259 ASSERT(0); 1259 ASSERT(0);
1260 return (XFS_ERROR(EINVAL)); 1260 return XFS_ERROR(EINVAL);
1261 } 1261 }
1262 mp->m_sb.sb_icount = lcounter; 1262 mp->m_sb.sb_icount = lcounter;
1263 return (0); 1263 return 0;
1264 case XFS_SBS_IFREE: 1264 case XFS_SBS_IFREE:
1265 lcounter = (long long)mp->m_sb.sb_ifree; 1265 lcounter = (long long)mp->m_sb.sb_ifree;
1266 lcounter += delta; 1266 lcounter += delta;
1267 if (lcounter < 0) { 1267 if (lcounter < 0) {
1268 ASSERT(0); 1268 ASSERT(0);
1269 return (XFS_ERROR(EINVAL)); 1269 return XFS_ERROR(EINVAL);
1270 } 1270 }
1271 mp->m_sb.sb_ifree = lcounter; 1271 mp->m_sb.sb_ifree = lcounter;
1272 return (0); 1272 return 0;
1273 case XFS_SBS_FDBLOCKS: 1273 case XFS_SBS_FDBLOCKS:
1274 1274
1275 lcounter = (long long)mp->m_sb.sb_fdblocks; 1275 lcounter = (long long)mp->m_sb.sb_fdblocks;
@@ -1296,101 +1296,101 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
1296 if (rsvd) { 1296 if (rsvd) {
1297 lcounter = (long long)mp->m_resblks_avail + delta; 1297 lcounter = (long long)mp->m_resblks_avail + delta;
1298 if (lcounter < 0) { 1298 if (lcounter < 0) {
1299 return (XFS_ERROR(ENOSPC)); 1299 return XFS_ERROR(ENOSPC);
1300 } 1300 }
1301 mp->m_resblks_avail = lcounter; 1301 mp->m_resblks_avail = lcounter;
1302 return (0); 1302 return 0;
1303 } else { /* not reserved */ 1303 } else { /* not reserved */
1304 return (XFS_ERROR(ENOSPC)); 1304 return XFS_ERROR(ENOSPC);
1305 } 1305 }
1306 } 1306 }
1307 } 1307 }
1308 1308
1309 mp->m_sb.sb_fdblocks = lcounter; 1309 mp->m_sb.sb_fdblocks = lcounter;
1310 return (0); 1310 return 0;
1311 case XFS_SBS_FREXTENTS: 1311 case XFS_SBS_FREXTENTS:
1312 lcounter = (long long)mp->m_sb.sb_frextents; 1312 lcounter = (long long)mp->m_sb.sb_frextents;
1313 lcounter += delta; 1313 lcounter += delta;
1314 if (lcounter < 0) { 1314 if (lcounter < 0) {
1315 return (XFS_ERROR(ENOSPC)); 1315 return XFS_ERROR(ENOSPC);
1316 } 1316 }
1317 mp->m_sb.sb_frextents = lcounter; 1317 mp->m_sb.sb_frextents = lcounter;
1318 return (0); 1318 return 0;
1319 case XFS_SBS_DBLOCKS: 1319 case XFS_SBS_DBLOCKS:
1320 lcounter = (long long)mp->m_sb.sb_dblocks; 1320 lcounter = (long long)mp->m_sb.sb_dblocks;
1321 lcounter += delta; 1321 lcounter += delta;
1322 if (lcounter < 0) { 1322 if (lcounter < 0) {
1323 ASSERT(0); 1323 ASSERT(0);
1324 return (XFS_ERROR(EINVAL)); 1324 return XFS_ERROR(EINVAL);
1325 } 1325 }
1326 mp->m_sb.sb_dblocks = lcounter; 1326 mp->m_sb.sb_dblocks = lcounter;
1327 return (0); 1327 return 0;
1328 case XFS_SBS_AGCOUNT: 1328 case XFS_SBS_AGCOUNT:
1329 scounter = mp->m_sb.sb_agcount; 1329 scounter = mp->m_sb.sb_agcount;
1330 scounter += delta; 1330 scounter += delta;
1331 if (scounter < 0) { 1331 if (scounter < 0) {
1332 ASSERT(0); 1332 ASSERT(0);
1333 return (XFS_ERROR(EINVAL)); 1333 return XFS_ERROR(EINVAL);
1334 } 1334 }
1335 mp->m_sb.sb_agcount = scounter; 1335 mp->m_sb.sb_agcount = scounter;
1336 return (0); 1336 return 0;
1337 case XFS_SBS_IMAX_PCT: 1337 case XFS_SBS_IMAX_PCT:
1338 scounter = mp->m_sb.sb_imax_pct; 1338 scounter = mp->m_sb.sb_imax_pct;
1339 scounter += delta; 1339 scounter += delta;
1340 if (scounter < 0) { 1340 if (scounter < 0) {
1341 ASSERT(0); 1341 ASSERT(0);
1342 return (XFS_ERROR(EINVAL)); 1342 return XFS_ERROR(EINVAL);
1343 } 1343 }
1344 mp->m_sb.sb_imax_pct = scounter; 1344 mp->m_sb.sb_imax_pct = scounter;
1345 return (0); 1345 return 0;
1346 case XFS_SBS_REXTSIZE: 1346 case XFS_SBS_REXTSIZE:
1347 scounter = mp->m_sb.sb_rextsize; 1347 scounter = mp->m_sb.sb_rextsize;
1348 scounter += delta; 1348 scounter += delta;
1349 if (scounter < 0) { 1349 if (scounter < 0) {
1350 ASSERT(0); 1350 ASSERT(0);
1351 return (XFS_ERROR(EINVAL)); 1351 return XFS_ERROR(EINVAL);
1352 } 1352 }
1353 mp->m_sb.sb_rextsize = scounter; 1353 mp->m_sb.sb_rextsize = scounter;
1354 return (0); 1354 return 0;
1355 case XFS_SBS_RBMBLOCKS: 1355 case XFS_SBS_RBMBLOCKS:
1356 scounter = mp->m_sb.sb_rbmblocks; 1356 scounter = mp->m_sb.sb_rbmblocks;
1357 scounter += delta; 1357 scounter += delta;
1358 if (scounter < 0) { 1358 if (scounter < 0) {
1359 ASSERT(0); 1359 ASSERT(0);
1360 return (XFS_ERROR(EINVAL)); 1360 return XFS_ERROR(EINVAL);
1361 } 1361 }
1362 mp->m_sb.sb_rbmblocks = scounter; 1362 mp->m_sb.sb_rbmblocks = scounter;
1363 return (0); 1363 return 0;
1364 case XFS_SBS_RBLOCKS: 1364 case XFS_SBS_RBLOCKS:
1365 lcounter = (long long)mp->m_sb.sb_rblocks; 1365 lcounter = (long long)mp->m_sb.sb_rblocks;
1366 lcounter += delta; 1366 lcounter += delta;
1367 if (lcounter < 0) { 1367 if (lcounter < 0) {
1368 ASSERT(0); 1368 ASSERT(0);
1369 return (XFS_ERROR(EINVAL)); 1369 return XFS_ERROR(EINVAL);
1370 } 1370 }
1371 mp->m_sb.sb_rblocks = lcounter; 1371 mp->m_sb.sb_rblocks = lcounter;
1372 return (0); 1372 return 0;
1373 case XFS_SBS_REXTENTS: 1373 case XFS_SBS_REXTENTS:
1374 lcounter = (long long)mp->m_sb.sb_rextents; 1374 lcounter = (long long)mp->m_sb.sb_rextents;
1375 lcounter += delta; 1375 lcounter += delta;
1376 if (lcounter < 0) { 1376 if (lcounter < 0) {
1377 ASSERT(0); 1377 ASSERT(0);
1378 return (XFS_ERROR(EINVAL)); 1378 return XFS_ERROR(EINVAL);
1379 } 1379 }
1380 mp->m_sb.sb_rextents = lcounter; 1380 mp->m_sb.sb_rextents = lcounter;
1381 return (0); 1381 return 0;
1382 case XFS_SBS_REXTSLOG: 1382 case XFS_SBS_REXTSLOG:
1383 scounter = mp->m_sb.sb_rextslog; 1383 scounter = mp->m_sb.sb_rextslog;
1384 scounter += delta; 1384 scounter += delta;
1385 if (scounter < 0) { 1385 if (scounter < 0) {
1386 ASSERT(0); 1386 ASSERT(0);
1387 return (XFS_ERROR(EINVAL)); 1387 return XFS_ERROR(EINVAL);
1388 } 1388 }
1389 mp->m_sb.sb_rextslog = scounter; 1389 mp->m_sb.sb_rextslog = scounter;
1390 return (0); 1390 return 0;
1391 default: 1391 default:
1392 ASSERT(0); 1392 ASSERT(0);
1393 return (XFS_ERROR(EINVAL)); 1393 return XFS_ERROR(EINVAL);
1394 } 1394 }
1395} 1395}
1396 1396
@@ -1409,7 +1409,7 @@ xfs_mod_incore_sb(xfs_mount_t *mp, xfs_sb_field_t field, int delta, int rsvd)
1409 s = XFS_SB_LOCK(mp); 1409 s = XFS_SB_LOCK(mp);
1410 status = xfs_mod_incore_sb_unlocked(mp, field, delta, rsvd); 1410 status = xfs_mod_incore_sb_unlocked(mp, field, delta, rsvd);
1411 XFS_SB_UNLOCK(mp, s); 1411 XFS_SB_UNLOCK(mp, s);
1412 return (status); 1412 return status;
1413} 1413}
1414 1414
1415/* 1415/*
@@ -1470,7 +1470,7 @@ xfs_mod_incore_sb_batch(xfs_mount_t *mp, xfs_mod_sb_t *msb, uint nmsb, int rsvd)
1470 } 1470 }
1471 } 1471 }
1472 XFS_SB_UNLOCK(mp, s); 1472 XFS_SB_UNLOCK(mp, s);
1473 return (status); 1473 return status;
1474} 1474}
1475 1475
1476/* 1476/*
@@ -1500,7 +1500,7 @@ xfs_getsb(
1500 } 1500 }
1501 XFS_BUF_HOLD(bp); 1501 XFS_BUF_HOLD(bp);
1502 ASSERT(XFS_BUF_ISDONE(bp)); 1502 ASSERT(XFS_BUF_ISDONE(bp));
1503 return (bp); 1503 return bp;
1504} 1504}
1505 1505
1506/* 1506/*
diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c
index 486147ef0e3d..1117d600d741 100644
--- a/fs/xfs/xfs_trans_item.c
+++ b/fs/xfs/xfs_trans_item.c
@@ -78,7 +78,7 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t *lip)
78 lidp->lid_size = 0; 78 lidp->lid_size = 0;
79 lip->li_desc = lidp; 79 lip->li_desc = lidp;
80 lip->li_mountp = tp->t_mountp; 80 lip->li_mountp = tp->t_mountp;
81 return (lidp); 81 return lidp;
82 } 82 }
83 83
84 /* 84 /*
@@ -119,7 +119,7 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t *lip)
119 lidp->lid_size = 0; 119 lidp->lid_size = 0;
120 lip->li_desc = lidp; 120 lip->li_desc = lidp;
121 lip->li_mountp = tp->t_mountp; 121 lip->li_mountp = tp->t_mountp;
122 return (lidp); 122 return lidp;
123} 123}
124 124
125/* 125/*
@@ -180,7 +180,7 @@ xfs_trans_find_item(xfs_trans_t *tp, xfs_log_item_t *lip)
180{ 180{
181 ASSERT(lip->li_desc != NULL); 181 ASSERT(lip->li_desc != NULL);
182 182
183 return (lip->li_desc); 183 return lip->li_desc;
184} 184}
185 185
186 186
@@ -219,10 +219,10 @@ xfs_trans_first_item(xfs_trans_t *tp)
219 continue; 219 continue;
220 } 220 }
221 221
222 return (XFS_LIC_SLOT(licp, i)); 222 return XFS_LIC_SLOT(licp, i);
223 } 223 }
224 cmn_err(CE_WARN, "xfs_trans_first_item() -- no first item"); 224 cmn_err(CE_WARN, "xfs_trans_first_item() -- no first item");
225 return(NULL); 225 return NULL;
226} 226}
227 227
228 228
@@ -252,7 +252,7 @@ xfs_trans_next_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp)
252 continue; 252 continue;
253 } 253 }
254 254
255 return (XFS_LIC_SLOT(licp, i)); 255 return XFS_LIC_SLOT(licp, i);
256 } 256 }
257 257
258 /* 258 /*
@@ -261,7 +261,7 @@ xfs_trans_next_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp)
261 * If there is no next chunk, return NULL. 261 * If there is no next chunk, return NULL.
262 */ 262 */
263 if (licp->lic_next == NULL) { 263 if (licp->lic_next == NULL) {
264 return (NULL); 264 return NULL;
265 } 265 }
266 266
267 licp = licp->lic_next; 267 licp = licp->lic_next;
@@ -271,7 +271,7 @@ xfs_trans_next_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp)
271 continue; 271 continue;
272 } 272 }
273 273
274 return (XFS_LIC_SLOT(licp, i)); 274 return XFS_LIC_SLOT(licp, i);
275 } 275 }
276 ASSERT(0); 276 ASSERT(0);
277 /* NOTREACHED */ 277 /* NOTREACHED */
@@ -425,7 +425,7 @@ xfs_trans_unlock_chunk(
425 } 425 }
426 } 426 }
427 427
428 return (freed); 428 return freed;
429} 429}
430 430
431 431
@@ -478,7 +478,7 @@ xfs_trans_add_busy(xfs_trans_t *tp, xfs_agnumber_t ag, xfs_extlen_t idx)
478 */ 478 */
479 lbsp->lbc_ag = ag; 479 lbsp->lbc_ag = ag;
480 lbsp->lbc_idx = idx; 480 lbsp->lbc_idx = idx;
481 return (lbsp); 481 return lbsp;
482 } 482 }
483 483
484 /* 484 /*
@@ -512,7 +512,7 @@ xfs_trans_add_busy(xfs_trans_t *tp, xfs_agnumber_t ag, xfs_extlen_t idx)
512 tp->t_busy_free--; 512 tp->t_busy_free--;
513 lbsp->lbc_ag = ag; 513 lbsp->lbc_ag = ag;
514 lbsp->lbc_idx = idx; 514 lbsp->lbc_idx = idx;
515 return (lbsp); 515 return lbsp;
516} 516}
517 517
518 518
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 8076cc981e11..eaab355f5a89 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -338,7 +338,7 @@ xfs_setattr(
338 code = XFS_QM_DQVOPALLOC(mp, ip, uid, gid, projid, qflags, 338 code = XFS_QM_DQVOPALLOC(mp, ip, uid, gid, projid, qflags,
339 &udqp, &gdqp); 339 &udqp, &gdqp);
340 if (code) 340 if (code)
341 return (code); 341 return code;
342 } 342 }
343 343
344 /* 344 /*
@@ -1027,11 +1027,8 @@ xfs_readlink(
1027 1027
1028 } 1028 }
1029 1029
1030
1031error_return: 1030error_return:
1032
1033 xfs_iunlock(ip, XFS_ILOCK_SHARED); 1031 xfs_iunlock(ip, XFS_ILOCK_SHARED);
1034
1035 return error; 1032 return error;
1036} 1033}
1037 1034
@@ -1206,7 +1203,7 @@ xfs_inactive_free_eofblocks(
1206 last_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); 1203 last_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp));
1207 map_len = last_fsb - end_fsb; 1204 map_len = last_fsb - end_fsb;
1208 if (map_len <= 0) 1205 if (map_len <= 0)
1209 return (0); 1206 return 0;
1210 1207
1211 nimaps = 1; 1208 nimaps = 1;
1212 xfs_ilock(ip, XFS_ILOCK_SHARED); 1209 xfs_ilock(ip, XFS_ILOCK_SHARED);
@@ -1221,7 +1218,7 @@ xfs_inactive_free_eofblocks(
1221 * Attach the dquots to the inode up front. 1218 * Attach the dquots to the inode up front.
1222 */ 1219 */
1223 if ((error = XFS_QM_DQATTACH(mp, ip, 0))) 1220 if ((error = XFS_QM_DQATTACH(mp, ip, 0)))
1224 return (error); 1221 return error;
1225 1222
1226 /* 1223 /*
1227 * There are blocks after the end of file. 1224 * There are blocks after the end of file.
@@ -1249,7 +1246,7 @@ xfs_inactive_free_eofblocks(
1249 ASSERT(XFS_FORCED_SHUTDOWN(mp)); 1246 ASSERT(XFS_FORCED_SHUTDOWN(mp));
1250 xfs_trans_cancel(tp, 0); 1247 xfs_trans_cancel(tp, 0);
1251 xfs_iunlock(ip, XFS_IOLOCK_EXCL); 1248 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
1252 return (error); 1249 return error;
1253 } 1250 }
1254 1251
1255 xfs_ilock(ip, XFS_ILOCK_EXCL); 1252 xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -1277,7 +1274,7 @@ xfs_inactive_free_eofblocks(
1277 } 1274 }
1278 xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 1275 xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
1279 } 1276 }
1280 return (error); 1277 return error;
1281} 1278}
1282 1279
1283/* 1280/*
@@ -1455,7 +1452,7 @@ xfs_inactive_symlink_local(
1455 if (error) { 1452 if (error) {
1456 xfs_trans_cancel(*tpp, 0); 1453 xfs_trans_cancel(*tpp, 0);
1457 *tpp = NULL; 1454 *tpp = NULL;
1458 return (error); 1455 return error;
1459 } 1456 }
1460 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 1457 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
1461 1458
@@ -1468,7 +1465,7 @@ xfs_inactive_symlink_local(
1468 XFS_DATA_FORK); 1465 XFS_DATA_FORK);
1469 ASSERT(ip->i_df.if_bytes == 0); 1466 ASSERT(ip->i_df.if_bytes == 0);
1470 } 1467 }
1471 return (0); 1468 return 0;
1472} 1469}
1473 1470
1474/* 1471/*
@@ -1494,7 +1491,7 @@ xfs_inactive_attrs(
1494 if (error) { 1491 if (error) {
1495 *tpp = NULL; 1492 *tpp = NULL;
1496 xfs_iunlock(ip, XFS_IOLOCK_EXCL); 1493 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
1497 return (error); /* goto out*/ 1494 return error; /* goto out */
1498 } 1495 }
1499 1496
1500 tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); 1497 tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE);
@@ -1507,7 +1504,7 @@ xfs_inactive_attrs(
1507 xfs_trans_cancel(tp, 0); 1504 xfs_trans_cancel(tp, 0);
1508 *tpp = NULL; 1505 *tpp = NULL;
1509 xfs_iunlock(ip, XFS_IOLOCK_EXCL); 1506 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
1510 return (error); 1507 return error;
1511 } 1508 }
1512 1509
1513 xfs_ilock(ip, XFS_ILOCK_EXCL); 1510 xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -1518,7 +1515,7 @@ xfs_inactive_attrs(
1518 ASSERT(ip->i_d.di_anextents == 0); 1515 ASSERT(ip->i_d.di_anextents == 0);
1519 1516
1520 *tpp = tp; 1517 *tpp = tp;
1521 return (0); 1518 return 0;
1522} 1519}
1523 1520
1524STATIC int 1521STATIC int
@@ -1557,7 +1554,7 @@ xfs_release(
1557 (!(ip->i_d.di_flags & 1554 (!(ip->i_d.di_flags &
1558 (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)))) { 1555 (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)))) {
1559 if ((error = xfs_inactive_free_eofblocks(mp, ip))) 1556 if ((error = xfs_inactive_free_eofblocks(mp, ip)))
1560 return (error); 1557 return error;
1561 /* Update linux inode block count after free above */ 1558 /* Update linux inode block count after free above */
1562 LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp, 1559 LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp,
1563 ip->i_d.di_nblocks + ip->i_delayed_blks); 1560 ip->i_d.di_nblocks + ip->i_delayed_blks);
@@ -1638,7 +1635,7 @@ xfs_inactive(
1638 (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) || 1635 (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) ||
1639 (ip->i_delayed_blks != 0)))) { 1636 (ip->i_delayed_blks != 0)))) {
1640 if ((error = xfs_inactive_free_eofblocks(mp, ip))) 1637 if ((error = xfs_inactive_free_eofblocks(mp, ip)))
1641 return (VN_INACTIVE_CACHE); 1638 return VN_INACTIVE_CACHE;
1642 /* Update linux inode block count after free above */ 1639 /* Update linux inode block count after free above */
1643 LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp, 1640 LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp,
1644 ip->i_d.di_nblocks + ip->i_delayed_blks); 1641 ip->i_d.di_nblocks + ip->i_delayed_blks);
@@ -1649,7 +1646,7 @@ xfs_inactive(
1649 ASSERT(ip->i_d.di_nlink == 0); 1646 ASSERT(ip->i_d.di_nlink == 0);
1650 1647
1651 if ((error = XFS_QM_DQATTACH(mp, ip, 0))) 1648 if ((error = XFS_QM_DQATTACH(mp, ip, 0)))
1652 return (VN_INACTIVE_CACHE); 1649 return VN_INACTIVE_CACHE;
1653 1650
1654 tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); 1651 tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE);
1655 if (truncate) { 1652 if (truncate) {
@@ -1672,7 +1669,7 @@ xfs_inactive(
1672 ASSERT(XFS_FORCED_SHUTDOWN(mp)); 1669 ASSERT(XFS_FORCED_SHUTDOWN(mp));
1673 xfs_trans_cancel(tp, 0); 1670 xfs_trans_cancel(tp, 0);
1674 xfs_iunlock(ip, XFS_IOLOCK_EXCL); 1671 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
1675 return (VN_INACTIVE_CACHE); 1672 return VN_INACTIVE_CACHE;
1676 } 1673 }
1677 1674
1678 xfs_ilock(ip, XFS_ILOCK_EXCL); 1675 xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -1693,7 +1690,7 @@ xfs_inactive(
1693 xfs_trans_cancel(tp, 1690 xfs_trans_cancel(tp,
1694 XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT); 1691 XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
1695 xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 1692 xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
1696 return (VN_INACTIVE_CACHE); 1693 return VN_INACTIVE_CACHE;
1697 } 1694 }
1698 } else if ((ip->i_d.di_mode & S_IFMT) == S_IFLNK) { 1695 } else if ((ip->i_d.di_mode & S_IFMT) == S_IFLNK) {
1699 1696
@@ -1707,7 +1704,7 @@ xfs_inactive(
1707 1704
1708 if (error) { 1705 if (error) {
1709 ASSERT(tp == NULL); 1706 ASSERT(tp == NULL);
1710 return (VN_INACTIVE_CACHE); 1707 return VN_INACTIVE_CACHE;
1711 } 1708 }
1712 1709
1713 xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 1710 xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
@@ -1720,7 +1717,7 @@ xfs_inactive(
1720 if (error) { 1717 if (error) {
1721 ASSERT(XFS_FORCED_SHUTDOWN(mp)); 1718 ASSERT(XFS_FORCED_SHUTDOWN(mp));
1722 xfs_trans_cancel(tp, 0); 1719 xfs_trans_cancel(tp, 0);
1723 return (VN_INACTIVE_CACHE); 1720 return VN_INACTIVE_CACHE;
1724 } 1721 }
1725 1722
1726 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 1723 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
@@ -1742,7 +1739,7 @@ xfs_inactive(
1742 * cancelled, and the inode is unlocked. Just get out. 1739 * cancelled, and the inode is unlocked. Just get out.
1743 */ 1740 */
1744 if (error) 1741 if (error)
1745 return (VN_INACTIVE_CACHE); 1742 return VN_INACTIVE_CACHE;
1746 } else if (ip->i_afp) { 1743 } else if (ip->i_afp) {
1747 xfs_idestroy_fork(ip, XFS_ATTR_FORK); 1744 xfs_idestroy_fork(ip, XFS_ATTR_FORK);
1748 } 1745 }
@@ -2049,8 +2046,8 @@ std_return:
2049 abort_return: 2046 abort_return:
2050 cancel_flags |= XFS_TRANS_ABORT; 2047 cancel_flags |= XFS_TRANS_ABORT;
2051 /* FALLTHROUGH */ 2048 /* FALLTHROUGH */
2052 error_return:
2053 2049
2050 error_return:
2054 if (tp != NULL) 2051 if (tp != NULL)
2055 xfs_trans_cancel(tp, cancel_flags); 2052 xfs_trans_cancel(tp, cancel_flags);
2056 2053
@@ -2724,9 +2721,9 @@ std_return:
2724 abort_return: 2721 abort_return:
2725 cancel_flags |= XFS_TRANS_ABORT; 2722 cancel_flags |= XFS_TRANS_ABORT;
2726 /* FALLTHROUGH */ 2723 /* FALLTHROUGH */
2724
2727 error_return: 2725 error_return:
2728 xfs_trans_cancel(tp, cancel_flags); 2726 xfs_trans_cancel(tp, cancel_flags);
2729
2730 goto std_return; 2727 goto std_return;
2731} 2728}
2732/* 2729/*
@@ -3199,10 +3196,12 @@ std_return:
3199 } 3196 }
3200 return error; 3197 return error;
3201 3198
3202 error1: 3199error1:
3203 xfs_bmap_cancel(&free_list); 3200 xfs_bmap_cancel(&free_list);
3204 cancel_flags |= XFS_TRANS_ABORT; 3201 cancel_flags |= XFS_TRANS_ABORT;
3205 error_return: 3202 /* FALLTHROUGH */
3203
3204error_return:
3206 xfs_trans_cancel(tp, cancel_flags); 3205 xfs_trans_cancel(tp, cancel_flags);
3207 goto std_return; 3206 goto std_return;
3208} 3207}
@@ -3618,9 +3617,9 @@ xfs_rwlock(
3618 if (locktype == VRWLOCK_WRITE) { 3617 if (locktype == VRWLOCK_WRITE) {
3619 xfs_ilock(ip, XFS_IOLOCK_EXCL); 3618 xfs_ilock(ip, XFS_IOLOCK_EXCL);
3620 } else if (locktype == VRWLOCK_TRY_READ) { 3619 } else if (locktype == VRWLOCK_TRY_READ) {
3621 return (xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)); 3620 return xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED);
3622 } else if (locktype == VRWLOCK_TRY_WRITE) { 3621 } else if (locktype == VRWLOCK_TRY_WRITE) {
3623 return (xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)); 3622 return xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL);
3624 } else { 3623 } else {
3625 ASSERT((locktype == VRWLOCK_READ) || 3624 ASSERT((locktype == VRWLOCK_READ) ||
3626 (locktype == VRWLOCK_WRITE_DIRECT)); 3625 (locktype == VRWLOCK_WRITE_DIRECT));
@@ -3868,7 +3867,7 @@ xfs_finish_reclaim(
3868 xfs_ifunlock(ip); 3867 xfs_ifunlock(ip);
3869 xfs_iunlock(ip, XFS_ILOCK_EXCL); 3868 xfs_iunlock(ip, XFS_ILOCK_EXCL);
3870 } 3869 }
3871 return(1); 3870 return 1;
3872 } 3871 }
3873 ip->i_flags |= XFS_IRECLAIM; 3872 ip->i_flags |= XFS_IRECLAIM;
3874 write_unlock(&ih->ih_lock); 3873 write_unlock(&ih->ih_lock);
@@ -4045,7 +4044,7 @@ xfs_alloc_file_space(
4045 offset, end_dmi_offset - offset, 4044 offset, end_dmi_offset - offset,
4046 0, NULL); 4045 0, NULL);
4047 if (error) 4046 if (error)
4048 return(error); 4047 return error;
4049 } 4048 }
4050 4049
4051 /* 4050 /*
@@ -4305,7 +4304,7 @@ xfs_free_file_space(
4305 offset, end_dmi_offset - offset, 4304 offset, end_dmi_offset - offset,
4306 AT_DELAY_FLAG(attr_flags), NULL); 4305 AT_DELAY_FLAG(attr_flags), NULL);
4307 if (error) 4306 if (error)
4308 return(error); 4307 return error;
4309 } 4308 }
4310 4309
4311 ASSERT(attr_flags & ATTR_NOLOCK ? attr_flags & ATTR_DMI : 1); 4310 ASSERT(attr_flags & ATTR_NOLOCK ? attr_flags & ATTR_DMI : 1);