diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-09-29 22:25:55 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-10-18 16:07:59 -0400 |
commit | 96540c78583a417113df4d027e6b68a595ab9a09 (patch) | |
tree | 777505137ab426a9dff955cd8e3fe0c3afc0e482 /fs/xfs/xfs_bmap.c | |
parent | 61ba35dea0593fbc8d062cab3e4c4c3da5ce7104 (diff) |
xfs: do not use xfs_mod_incore_sb for per-cpu counters
Export xfs_icsb_modify_counters and always use it for modifying
the per-cpu counters. Remove support for per-cpu counters from
xfs_mod_incore_sb to simplify it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 5e33b7862d41..8abd12e32e13 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -614,7 +614,7 @@ xfs_bmap_add_extent( | |||
614 | nblks += cur->bc_private.b.allocated; | 614 | nblks += cur->bc_private.b.allocated; |
615 | ASSERT(nblks <= da_old); | 615 | ASSERT(nblks <= da_old); |
616 | if (nblks < da_old) | 616 | if (nblks < da_old) |
617 | xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, | 617 | xfs_icsb_modify_counters(ip->i_mount, XFS_SBS_FDBLOCKS, |
618 | (int64_t)(da_old - nblks), rsvd); | 618 | (int64_t)(da_old - nblks), rsvd); |
619 | } | 619 | } |
620 | /* | 620 | /* |
@@ -1079,7 +1079,8 @@ xfs_bmap_add_extent_delay_real( | |||
1079 | diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) - | 1079 | diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) - |
1080 | (cur ? cur->bc_private.b.allocated : 0)); | 1080 | (cur ? cur->bc_private.b.allocated : 0)); |
1081 | if (diff > 0 && | 1081 | if (diff > 0 && |
1082 | xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) { | 1082 | xfs_icsb_modify_counters(ip->i_mount, XFS_SBS_FDBLOCKS, |
1083 | -((int64_t)diff), rsvd)) { | ||
1083 | /* | 1084 | /* |
1084 | * Ick gross gag me with a spoon. | 1085 | * Ick gross gag me with a spoon. |
1085 | */ | 1086 | */ |
@@ -1089,16 +1090,18 @@ xfs_bmap_add_extent_delay_real( | |||
1089 | temp--; | 1090 | temp--; |
1090 | diff--; | 1091 | diff--; |
1091 | if (!diff || | 1092 | if (!diff || |
1092 | !xfs_mod_incore_sb(ip->i_mount, | 1093 | !xfs_icsb_modify_counters(ip->i_mount, |
1093 | XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) | 1094 | XFS_SBS_FDBLOCKS, |
1095 | -((int64_t)diff), rsvd)) | ||
1094 | break; | 1096 | break; |
1095 | } | 1097 | } |
1096 | if (temp2) { | 1098 | if (temp2) { |
1097 | temp2--; | 1099 | temp2--; |
1098 | diff--; | 1100 | diff--; |
1099 | if (!diff || | 1101 | if (!diff || |
1100 | !xfs_mod_incore_sb(ip->i_mount, | 1102 | !xfs_icsb_modify_counters(ip->i_mount, |
1101 | XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) | 1103 | XFS_SBS_FDBLOCKS, |
1104 | -((int64_t)diff), rsvd)) | ||
1102 | break; | 1105 | break; |
1103 | } | 1106 | } |
1104 | } | 1107 | } |
@@ -1766,7 +1769,7 @@ xfs_bmap_add_extent_hole_delay( | |||
1766 | } | 1769 | } |
1767 | if (oldlen != newlen) { | 1770 | if (oldlen != newlen) { |
1768 | ASSERT(oldlen > newlen); | 1771 | ASSERT(oldlen > newlen); |
1769 | xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, | 1772 | xfs_icsb_modify_counters(ip->i_mount, XFS_SBS_FDBLOCKS, |
1770 | (int64_t)(oldlen - newlen), rsvd); | 1773 | (int64_t)(oldlen - newlen), rsvd); |
1771 | /* | 1774 | /* |
1772 | * Nothing to do for disk quota accounting here. | 1775 | * Nothing to do for disk quota accounting here. |
@@ -3111,9 +3114,10 @@ xfs_bmap_del_extent( | |||
3111 | * Nothing to do for disk quota accounting here. | 3114 | * Nothing to do for disk quota accounting here. |
3112 | */ | 3115 | */ |
3113 | ASSERT(da_old >= da_new); | 3116 | ASSERT(da_old >= da_new); |
3114 | if (da_old > da_new) | 3117 | if (da_old > da_new) { |
3115 | xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int64_t)(da_old - da_new), | 3118 | xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS, |
3116 | rsvd); | 3119 | (int64_t)(da_old - da_new), rsvd); |
3120 | } | ||
3117 | done: | 3121 | done: |
3118 | *logflagsp = flags; | 3122 | *logflagsp = flags; |
3119 | return error; | 3123 | return error; |
@@ -4526,13 +4530,13 @@ xfs_bmapi( | |||
4526 | -((int64_t)extsz), (flags & | 4530 | -((int64_t)extsz), (flags & |
4527 | XFS_BMAPI_RSVBLOCKS)); | 4531 | XFS_BMAPI_RSVBLOCKS)); |
4528 | } else { | 4532 | } else { |
4529 | error = xfs_mod_incore_sb(mp, | 4533 | error = xfs_icsb_modify_counters(mp, |
4530 | XFS_SBS_FDBLOCKS, | 4534 | XFS_SBS_FDBLOCKS, |
4531 | -((int64_t)alen), (flags & | 4535 | -((int64_t)alen), (flags & |
4532 | XFS_BMAPI_RSVBLOCKS)); | 4536 | XFS_BMAPI_RSVBLOCKS)); |
4533 | } | 4537 | } |
4534 | if (!error) { | 4538 | if (!error) { |
4535 | error = xfs_mod_incore_sb(mp, | 4539 | error = xfs_icsb_modify_counters(mp, |
4536 | XFS_SBS_FDBLOCKS, | 4540 | XFS_SBS_FDBLOCKS, |
4537 | -((int64_t)indlen), (flags & | 4541 | -((int64_t)indlen), (flags & |
4538 | XFS_BMAPI_RSVBLOCKS)); | 4542 | XFS_BMAPI_RSVBLOCKS)); |
@@ -4542,7 +4546,7 @@ xfs_bmapi( | |||
4542 | (int64_t)extsz, (flags & | 4546 | (int64_t)extsz, (flags & |
4543 | XFS_BMAPI_RSVBLOCKS)); | 4547 | XFS_BMAPI_RSVBLOCKS)); |
4544 | else if (error) | 4548 | else if (error) |
4545 | xfs_mod_incore_sb(mp, | 4549 | xfs_icsb_modify_counters(mp, |
4546 | XFS_SBS_FDBLOCKS, | 4550 | XFS_SBS_FDBLOCKS, |
4547 | (int64_t)alen, (flags & | 4551 | (int64_t)alen, (flags & |
4548 | XFS_BMAPI_RSVBLOCKS)); | 4552 | XFS_BMAPI_RSVBLOCKS)); |
@@ -5206,7 +5210,7 @@ xfs_bunmapi( | |||
5206 | ip, -((long)del.br_blockcount), 0, | 5210 | ip, -((long)del.br_blockcount), 0, |
5207 | XFS_QMOPT_RES_RTBLKS); | 5211 | XFS_QMOPT_RES_RTBLKS); |
5208 | } else { | 5212 | } else { |
5209 | xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, | 5213 | xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS, |
5210 | (int64_t)del.br_blockcount, rsvd); | 5214 | (int64_t)del.br_blockcount, rsvd); |
5211 | (void)xfs_trans_reserve_quota_nblks(NULL, | 5215 | (void)xfs_trans_reserve_quota_nblks(NULL, |
5212 | ip, -((long)del.br_blockcount), 0, | 5216 | ip, -((long)del.br_blockcount), 0, |