Skip to content

Commit

Permalink
mm, slab: Match SLAB and SLUB kmem_cache_alloc_xxx_trace() prototype
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
ezequielgarcia authored and penberg committed Sep 25, 2012
1 parent 7c0cb9c commit 4052147
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions include/linux/slab_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
void *__kmalloc(size_t size, gfp_t flags);

#ifdef CONFIG_TRACING
extern void *kmem_cache_alloc_trace(size_t size,
struct kmem_cache *cachep, gfp_t flags);
extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
#else
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);
}
Expand Down Expand Up @@ -148,7 +147,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
#endif
cachep = malloc_sizes[i].cs_cachep;

ret = kmem_cache_alloc_trace(size, cachep, flags);
ret = kmem_cache_alloc_trace(cachep, flags, size);

return ret;
}
Expand Down
10 changes: 5 additions & 5 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -3835,7 +3835,7 @@ EXPORT_SYMBOL(kmem_cache_alloc);

#ifdef CONFIG_TRACING
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;

Expand All @@ -3862,10 +3862,10 @@ void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
EXPORT_SYMBOL(kmem_cache_alloc_node);

#ifdef CONFIG_TRACING
void *kmem_cache_alloc_node_trace(size_t size,
struct kmem_cache *cachep,
void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
gfp_t flags,
int nodeid)
int nodeid,
size_t size)
{
void *ret;

Expand All @@ -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);
if (unlikely(ZERO_OR_NULL_PTR(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)
Expand Down

0 comments on commit 4052147

Please sign in to comment.