Use vmem_alloc() in spa_config_write()

The packed nvlist allocated in spa_config_write() may exceed the
warning threshold for large configurations.  Use the vmem interfaces
for this short lived allocation.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3251
This commit is contained in:
Brian Behlendorf 2015-04-03 09:12:02 -07:00
parent 40d06e3c78
commit f42d7f4111

View File

@ -167,7 +167,7 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl)
*/
VERIFY(nvlist_size(nvl, &buflen, NV_ENCODE_XDR) == 0);
buf = kmem_alloc(buflen, KM_SLEEP);
buf = vmem_alloc(buflen, KM_SLEEP);
temp = kmem_zalloc(MAXPATHLEN, KM_SLEEP);
VERIFY(nvlist_pack(nvl, &buf, &buflen, NV_ENCODE_XDR,
@ -191,7 +191,7 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl)
(void) vn_remove(temp, UIO_SYSSPACE, RMFILE);
kmem_free(buf, buflen);
vmem_free(buf, buflen);
kmem_free(temp, MAXPATHLEN);
}