diff options
author | Ezequiel Garcia <elezegarcia@gmail.com> | 2012-09-08 16:47:52 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-09-25 03:12:19 -0400 |
commit | ff4fcd01ec86d98d15d2fd96f22f19bb1d341b88 (patch) | |
tree | 8cc024f7284b07ccbdf01e9b90bf752ddbf974d4 | |
parent | 90f2cbbc49a8fe5a49cea1d362d90e377b949d49 (diff) |
mm, slab: Remove silly function slab_buffer_size()
This function is seldom used, and can be simply replaced with cachep->size.
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | include/linux/slab_def.h | 5 | ||||
-rw-r--r-- | mm/slab.c | 12 |
2 files changed, 2 insertions, 15 deletions
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 36d7031a1a53..604ebc832a9a 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -113,17 +113,12 @@ void *__kmalloc(size_t size, gfp_t flags); | |||
113 | #ifdef CONFIG_TRACING | 113 | #ifdef CONFIG_TRACING |
114 | extern void *kmem_cache_alloc_trace(size_t size, | 114 | extern void *kmem_cache_alloc_trace(size_t size, |
115 | struct kmem_cache *cachep, gfp_t flags); | 115 | struct kmem_cache *cachep, gfp_t flags); |
116 | extern size_t slab_buffer_size(struct kmem_cache *cachep); | ||
117 | #else | 116 | #else |
118 | static __always_inline void * | 117 | static __always_inline void * |
119 | kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) | 118 | kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) |
120 | { | 119 | { |
121 | return kmem_cache_alloc(cachep, flags); | 120 | return kmem_cache_alloc(cachep, flags); |
122 | } | 121 | } |
123 | static inline size_t slab_buffer_size(struct kmem_cache *cachep) | ||
124 | { | ||
125 | return 0; | ||
126 | } | ||
127 | #endif | 122 | #endif |
128 | 123 | ||
129 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 124 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
@@ -498,14 +498,6 @@ static void **dbg_userword(struct kmem_cache *cachep, void *objp) | |||
498 | 498 | ||
499 | #endif | 499 | #endif |
500 | 500 | ||
501 | #ifdef CONFIG_TRACING | ||
502 | size_t slab_buffer_size(struct kmem_cache *cachep) | ||
503 | { | ||
504 | return cachep->size; | ||
505 | } | ||
506 | EXPORT_SYMBOL(slab_buffer_size); | ||
507 | #endif | ||
508 | |||
509 | /* | 501 | /* |
510 | * Do not go above this order unless 0 objects fit into the slab or | 502 | * Do not go above this order unless 0 objects fit into the slab or |
511 | * overridden on the command line. | 503 | * overridden on the command line. |
@@ -3850,7 +3842,7 @@ kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) | |||
3850 | ret = __cache_alloc(cachep, flags, __builtin_return_address(0)); | 3842 | ret = __cache_alloc(cachep, flags, __builtin_return_address(0)); |
3851 | 3843 | ||
3852 | trace_kmalloc(_RET_IP_, ret, | 3844 | trace_kmalloc(_RET_IP_, ret, |
3853 | size, slab_buffer_size(cachep), flags); | 3845 | size, cachep->size, flags); |
3854 | return ret; | 3846 | return ret; |
3855 | } | 3847 | } |
3856 | EXPORT_SYMBOL(kmem_cache_alloc_trace); | 3848 | EXPORT_SYMBOL(kmem_cache_alloc_trace); |
@@ -3881,7 +3873,7 @@ void *kmem_cache_alloc_node_trace(size_t size, | |||
3881 | ret = __cache_alloc_node(cachep, flags, nodeid, | 3873 | ret = __cache_alloc_node(cachep, flags, nodeid, |
3882 | __builtin_return_address(0)); | 3874 | __builtin_return_address(0)); |
3883 | trace_kmalloc_node(_RET_IP_, ret, | 3875 | trace_kmalloc_node(_RET_IP_, ret, |
3884 | size, slab_buffer_size(cachep), | 3876 | size, cachep->size, |
3885 | flags, nodeid); | 3877 | flags, nodeid); |
3886 | return ret; | 3878 | return ret; |
3887 | } | 3879 | } |