From: Tim Chase Date: Sun, 24 Apr 2016 23:29:03 +0000 (-0500) Subject: Use vmem_free() in dfl_free() and add dfl_alloc() X-Git-Tag: zfs-0.8.0-rc1~152^2~102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bf657b90c792ff4539a75d3b66593de556580c0;p=zfs Use vmem_free() in dfl_free() and add dfl_alloc() This change was lost, somehow, in e5f9a9a. Since the arrays can be rather large, they need to be allocated with vmem_zalloc() via dfl_alloc() and freed with vmem_free() via dfl_free(). The new dfl_alloc() function should be used to allocate object of type dkioc_free_list_t in order that they're allocated from vmem. Signed-off-by: Brian Behlendorf Signed-off-by: Tim Chase Signed-off-by: Nikolay Borisov Closes #543 --- diff --git a/include/sys/dkioc_free_util.h b/include/sys/dkioc_free_util.h index a424d4232..bea5a5bbc 100644 --- a/include/sys/dkioc_free_util.h +++ b/include/sys/dkioc_free_util.h @@ -48,7 +48,11 @@ typedef struct dkioc_free_list_s { } dkioc_free_list_t; static inline void dfl_free(dkioc_free_list_t *dfl) { - kmem_free(dfl, DFL_SZ(dfl->dfl_num_exts)); + vmem_free(dfl, DFL_SZ(dfl->dfl_num_exts)); +} + +static inline dkioc_free_list_t *dfl_alloc(uint64_t dfl_num_exts, int flags) { + return vmem_zalloc(DFL_SZ(dfl_num_exts), flags); } #endif /* _SPL_DKIOC_UTIL_H */