diff options
author | Nathan Scott <nathans@sgi.com> | 2006-09-28 11:03:27 +1000 |
---|---|---|
committer | Tim Shimmin <tes@sgi.com> | 2006-09-28 11:03:27 +1000 |
commit | 77e4635ae191774526ed695482a151ac986f3806 (patch) | |
tree | 42cfa03f913883cd7f3d53be19b7e8c25258ee2c /fs/xfs/quota | |
parent | 572d95f49f3652fffe8242c4498b85f4083e52ab (diff) |
[XFS] Add a greedy allocation interface, allocating within a min/max size
range.
SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26803a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 3f86c7c04648..8b2c6cf2c849 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c @@ -112,17 +112,16 @@ xfs_Gqm_init(void) { xfs_dqhash_t *udqhash, *gdqhash; xfs_qm_t *xqm; - uint i, hsize, flags = KM_SLEEP | KM_MAYFAIL | KM_LARGE; + uint i, hsize; /* * Initialize the dquot hash tables. */ - hsize = XFS_QM_HASHSIZE_HIGH; - while (!(udqhash = kmem_zalloc(hsize * sizeof(*udqhash), flags))) { - if ((hsize >>= 1) <= XFS_QM_HASHSIZE_LOW) - flags = KM_SLEEP; - } - gdqhash = kmem_zalloc(hsize * sizeof(*gdqhash), KM_SLEEP | KM_LARGE); + udqhash = kmem_zalloc_greedy(&hsize, + XFS_QM_HASHSIZE_LOW, XFS_QM_HASHSIZE_HIGH, + KM_SLEEP | KM_MAYFAIL | KM_LARGE); + gdqhash = kmem_zalloc(hsize, KM_SLEEP | KM_LARGE); + hsize /= sizeof(xfs_dqhash_t); ndquot = hsize << 8; xqm = kmem_zalloc(sizeof(xfs_qm_t), KM_SLEEP); |