Commit 4052147c authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Pekka Enberg

mm, slab: Match SLAB and SLUB kmem_cache_alloc_xxx_trace() prototype

This long (seemingly unnecessary) patch does not fix anything and
its only goal is to produce common code between SLAB and SLUB.

Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: default avatarEzequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 7c0cb9c6
...@@ -111,11 +111,10 @@ void *kmem_cache_alloc(struct kmem_cache *, gfp_t); ...@@ -111,11 +111,10 @@ void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
void *__kmalloc(size_t size, gfp_t flags); void *__kmalloc(size_t size, gfp_t flags);
#ifdef CONFIG_TRACING #ifdef CONFIG_TRACING
extern void *kmem_cache_alloc_trace(size_t size, extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
struct kmem_cache *cachep, gfp_t flags);
#else #else
static __always_inline void * static __always_inline void *
kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size)
{ {
return kmem_cache_alloc(cachep, flags); return kmem_cache_alloc(cachep, flags);
} }
...@@ -148,7 +147,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) ...@@ -148,7 +147,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
#endif #endif
cachep = malloc_sizes[i].cs_cachep; cachep = malloc_sizes[i].cs_cachep;
ret = kmem_cache_alloc_trace(size, cachep, flags); ret = kmem_cache_alloc_trace(cachep, flags, size);
return ret; return ret;
} }
......
...@@ -3835,7 +3835,7 @@ EXPORT_SYMBOL(kmem_cache_alloc); ...@@ -3835,7 +3835,7 @@ EXPORT_SYMBOL(kmem_cache_alloc);
#ifdef CONFIG_TRACING #ifdef CONFIG_TRACING
void * void *
kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size)
{ {
void *ret; void *ret;
...@@ -3862,10 +3862,10 @@ void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid) ...@@ -3862,10 +3862,10 @@ void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
EXPORT_SYMBOL(kmem_cache_alloc_node); EXPORT_SYMBOL(kmem_cache_alloc_node);
#ifdef CONFIG_TRACING #ifdef CONFIG_TRACING
void *kmem_cache_alloc_node_trace(size_t size, void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
struct kmem_cache *cachep,
gfp_t flags, gfp_t flags,
int nodeid) int nodeid,
size_t size)
{ {
void *ret; void *ret;
...@@ -3887,7 +3887,7 @@ __do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller) ...@@ -3887,7 +3887,7 @@ __do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller)
cachep = kmem_find_general_cachep(size, flags); cachep = kmem_find_general_cachep(size, flags);
if (unlikely(ZERO_OR_NULL_PTR(cachep))) if (unlikely(ZERO_OR_NULL_PTR(cachep)))
return cachep; return cachep;
return kmem_cache_alloc_node_trace(size, cachep, flags, node); return kmem_cache_alloc_node_trace(cachep, flags, node, size);
} }
#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_TRACING) #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_TRACING)
......
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