diff --git a/include/sys/kmem.h b/include/sys/kmem.h index 60ff8273..7115734d 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -402,8 +402,6 @@ void spl_kmem_fini(void); #define kmem_cache_reap_now(skc) \ spl_kmem_cache_reap_now(skc, skc->skc_reap) #define kmem_reap() spl_kmem_reap() -#define kmem_virt(ptr) (((ptr) >= (void *)VMALLOC_START) && \ - ((ptr) < (void *)VMALLOC_END)) /* * Allow custom slab allocation flags to be set for KMC_SLAB based caches. diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 2aa54fdf..e8292426 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -1976,7 +1976,7 @@ spl_kmem_cache_free(spl_kmem_cache_t *skc, void *obj) * are guaranteed to have physical addresses. They must be removed * from the tree of emergency objects and the freed. */ - if ((skc->skc_flags & KMC_VMEM) && !kmem_virt(obj)) + if ((skc->skc_flags & KMC_VMEM) && !is_vmalloc_addr(obj)) SGOTO(out, spl_emergency_free(skc, obj)); local_irq_save(flags);