]> granicus.if.org Git - zfs/commitdiff
Use vmem_alloc() in spa_config_write()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 3 Apr 2015 16:12:02 +0000 (09:12 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 7 Apr 2015 22:10:19 +0000 (15:10 -0700)
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

module/zfs/spa_config.c

index 624bcb7887f36d320ce4fc344fa4633315052c41..e846ec9adc434f5a61f6f88135930ebbff3881a4 100644 (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);
 }