Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: change kmem_free to use generic kvfree()

Change kmem_free to use kvfree() generic function, remove the
duplicated code.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>

authored by

Wang, Yalin and committed by
Dave Chinner
f3d21552 8add71ca

+4 -11
-10
fs/xfs/kmem.c
··· 91 91 return ptr; 92 92 } 93 93 94 - void 95 - kmem_free(const void *ptr) 96 - { 97 - if (!is_vmalloc_addr(ptr)) { 98 - kfree(ptr); 99 - } else { 100 - vfree(ptr); 101 - } 102 - } 103 - 104 94 void * 105 95 kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, 106 96 xfs_km_flags_t flags)
+4 -1
fs/xfs/kmem.h
··· 63 63 extern void *kmem_alloc(size_t, xfs_km_flags_t); 64 64 extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t); 65 65 extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t); 66 - extern void kmem_free(const void *); 66 + static inline void kmem_free(const void *ptr) 67 + { 68 + kvfree(ptr); 69 + } 67 70 68 71 69 72 extern void *kmem_zalloc_greedy(size_t *, size_t, size_t);