mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-24 18:39:34 +03:00
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:
parent
40d06e3c78
commit
f42d7f4111
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user