diff options
author | Wang, Yalin <Yalin.Wang@sonymobile.com> | 2015-02-01 17:54:18 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-02-01 17:54:18 -0500 |
commit | f3d215526e6955028dfbbfd446db8716275fb0c7 (patch) | |
tree | 54746620d411e8ea2da4757615044c931e94813f /fs/xfs | |
parent | 8add71ca3fd67c5f222622711f95cfd6cec2a996 (diff) |
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/kmem.c | 10 | ||||
-rw-r--r-- | fs/xfs/kmem.h | 5 |
2 files changed, 4 insertions, 11 deletions
diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c index 53e95b2a1369..a7a3a63bb360 100644 --- a/fs/xfs/kmem.c +++ b/fs/xfs/kmem.c | |||
@@ -91,16 +91,6 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags) | |||
91 | return ptr; | 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 | void * | 94 | void * |
105 | kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, | 95 | kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, |
106 | xfs_km_flags_t flags) | 96 | xfs_km_flags_t flags) |
diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h index 64db0e53edea..cc6b768fc068 100644 --- a/fs/xfs/kmem.h +++ b/fs/xfs/kmem.h | |||
@@ -63,7 +63,10 @@ kmem_flags_convert(xfs_km_flags_t flags) | |||
63 | extern void *kmem_alloc(size_t, xfs_km_flags_t); | 63 | extern void *kmem_alloc(size_t, xfs_km_flags_t); |
64 | extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t); | 64 | extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t); |
65 | extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t); | 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 | extern void *kmem_zalloc_greedy(size_t *, size_t, size_t); | 72 | extern void *kmem_zalloc_greedy(size_t *, size_t, size_t); |