From 0d95a031bcb178f91ac0c029b662dee38a659279 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Aug 2010 11:04:42 -0700 Subject: [PATCH] Use vmem_alloc() for 128K allocation The mzap_update() function allocates enough memory for a full dbuf which can be 128K in size. Ideally, this memory should be allocated from our slab but in the short term it's simplest just to vmem_alloc() the memory instead. Closes #48 --- module/zfs/zap_micro.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index aa86bdecb1..04369bbc50 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -532,7 +532,7 @@ mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, zap_flags_t flags) ASSERT(RW_WRITE_HELD(&zap->zap_rwlock)); sz = zap->zap_dbuf->db_size; - mzp = kmem_alloc(sz, KM_SLEEP); + mzp = vmem_alloc(sz, KM_SLEEP); bcopy(zap->zap_dbuf->db_data, mzp, sz); nchunks = zap->zap_m.zap_num_chunks; @@ -540,7 +540,7 @@ mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, zap_flags_t flags) err = dmu_object_set_blocksize(zap->zap_objset, zap->zap_object, 1ULL << fzap_default_block_shift, 0, tx); if (err) { - kmem_free(mzp, sz); + vmem_free(mzp, sz); return (err); } } @@ -566,7 +566,7 @@ mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, zap_flags_t flags) if (err) break; } - kmem_free(mzp, sz); + vmem_free(mzp, sz); *zapp = zap; return (err); }