Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Retire kmem_virt()
Browse files Browse the repository at this point in the history
The initial port of ZFS to Linux required a way to identify virtual
memory to make IO to virtual memory backed slabs work, so kmem_virt()
was created. Linux 2.6.25 introduced is_vmalloc_addr(), which is
logically equivalent to kmem_virt(). Support for kernels before 2.6.26
was later dropped and more recently, support for kernels before Linux
2.6.32 has been dropped. We retire kmem_virt() in favor of
is_vmalloc_addr() to cleanup the code.

Signed-off-by: Richard Yao <ryao@gentoo.org>
  • Loading branch information
ryao committed Nov 3, 2014
1 parent 340b095 commit 723c8bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions include/sys/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion module/spl/spl-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 723c8bb

Please sign in to comment.