Commit f3d21552 authored by Wang, Yalin's avatar Wang, Yalin Committed by Dave Chinner

xfs: change kmem_free to use generic kvfree()

Change kmem_free to use kvfree() generic function, remove the
duplicated code.
Signed-off-by: default avatarYalin Wang <yalin.wang@sonymobile.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 8add71ca
...@@ -91,16 +91,6 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags) ...@@ -91,16 +91,6 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
return ptr; return ptr;
} }
void
kmem_free(const void *ptr)
{
if (!is_vmalloc_addr(ptr)) {
kfree(ptr);
} else {
vfree(ptr);
}
}
void * void *
kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
xfs_km_flags_t flags) xfs_km_flags_t flags)
......
...@@ -63,7 +63,10 @@ kmem_flags_convert(xfs_km_flags_t flags) ...@@ -63,7 +63,10 @@ kmem_flags_convert(xfs_km_flags_t flags)
extern void *kmem_alloc(size_t, xfs_km_flags_t); extern void *kmem_alloc(size_t, xfs_km_flags_t);
extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t); extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t);
extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t); extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t);
extern void kmem_free(const void *); static inline void kmem_free(const void *ptr)
{
kvfree(ptr);
}
extern void *kmem_zalloc_greedy(size_t *, size_t, size_t); extern void *kmem_zalloc_greedy(size_t *, size_t, size_t);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment