]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm, slab: Match SLAB and SLUB kmem_cache_alloc_xxx_trace() prototype
authorEzequiel Garcia <elezegarcia@gmail.com>
Sat, 8 Sep 2012 20:47:56 +0000 (17:47 -0300)
committerPekka Enberg <penberg@kernel.org>
Tue, 25 Sep 2012 07:17:24 +0000 (10:17 +0300)
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: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
include/linux/slab_def.h
mm/slab.c

index 604ebc832a9a63c78e958a78b3a3cfac3a88b035..e98caebdd0bc18775cef07c8b1d369082cf917e5 100644 (file)
@@ -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);
 }
@@ -148,7 +147,7 @@ found:
 #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;
        }
index 6c356793612d27b0280314f35657003ed1e700ef..4c54a2357937603115c511a45ce1f2b0258d23eb 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -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;
 
@@ -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;
 
@@ -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)