[XFS] Fix block reservation mechanism.

The block reservation mechanism has been broken since the per-cpu
superblock counters were introduced. Make the block reservation code work
with the per-cpu counters by syncing the counters, snapshotting the amount
of available space and then doing a modifcation of the counter state
according to the result. Continue in a loop until we either have no space
available or we reserve some space.

SGI-PV: 956323
SGI-Modid: xfs-linux-melb:xfs-kern:27895a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:
David Chinner
2007-02-10 18:36:17 +11:00
committed by Tim Shimmin
parent 20f4ebf2bf
commit dbcabad19a
4 changed files with 54 additions and 20 deletions

View File

@ -1979,8 +1979,8 @@ xfs_icsb_enable_counter(
xfs_icsb_unlock_all_counters(mp);
}
STATIC void
xfs_icsb_sync_counters_int(
void
xfs_icsb_sync_counters_flags(
xfs_mount_t *mp,
int flags)
{
@ -2012,17 +2012,7 @@ STATIC void
xfs_icsb_sync_counters(
xfs_mount_t *mp)
{
xfs_icsb_sync_counters_int(mp, 0);
}
/*
* lazy addition used for things like df, background sb syncs, etc
*/
void
xfs_icsb_sync_counters_lazy(
xfs_mount_t *mp)
{
xfs_icsb_sync_counters_int(mp, XFS_ICSB_LAZY_COUNT);
xfs_icsb_sync_counters_flags(mp, 0);
}
/*