aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_qm.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-09-27 21:03:27 -0400
committerTim Shimmin <tes@sgi.com>2006-09-27 21:03:27 -0400
commit77e4635ae191774526ed695482a151ac986f3806 (patch)
tree42cfa03f913883cd7f3d53be19b7e8c25258ee2c /fs/xfs/quota/xfs_qm.c
parent572d95f49f3652fffe8242c4498b85f4083e52ab (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/xfs_qm.c')
-rw-r--r--fs/xfs/quota/xfs_qm.c13
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)
112{ 112{
113 xfs_dqhash_t *udqhash, *gdqhash; 113 xfs_dqhash_t *udqhash, *gdqhash;
114 xfs_qm_t *xqm; 114 xfs_qm_t *xqm;
115 uint i, hsize, flags = KM_SLEEP | KM_MAYFAIL | KM_LARGE; 115 uint i, hsize;
116 116
117 /* 117 /*
118 * Initialize the dquot hash tables. 118 * Initialize the dquot hash tables.
119 */ 119 */
120 hsize = XFS_QM_HASHSIZE_HIGH; 120 udqhash = kmem_zalloc_greedy(&hsize,
121 while (!(udqhash = kmem_zalloc(hsize * sizeof(*udqhash), flags))) { 121 XFS_QM_HASHSIZE_LOW, XFS_QM_HASHSIZE_HIGH,
122 if ((hsize >>= 1) <= XFS_QM_HASHSIZE_LOW) 122 KM_SLEEP | KM_MAYFAIL | KM_LARGE);
123 flags = KM_SLEEP; 123 gdqhash = kmem_zalloc(hsize, KM_SLEEP | KM_LARGE);
124 } 124 hsize /= sizeof(xfs_dqhash_t);
125 gdqhash = kmem_zalloc(hsize * sizeof(*gdqhash), KM_SLEEP | KM_LARGE);
126 ndquot = hsize << 8; 125 ndquot = hsize << 8;
127 126
128 xqm = kmem_zalloc(sizeof(xfs_qm_t), KM_SLEEP); 127 xqm = kmem_zalloc(sizeof(xfs_qm_t), KM_SLEEP);