From 6130730c90f23eb572cdfa8f7a57404bbbc398d2 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Thu, 26 Jul 2007 19:59:20 -0700 Subject: [PATCH] sss --- include/linux/slub_def.h | 33 +++++++++++++++++++-------------- mm/slub.c | 6 ------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 6ebf394..7d48fc9 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -165,22 +165,8 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) #define SLUB_DMA (__force gfp_t)0 #endif -void *kmem_cache_alloc(struct kmem_cache *, gfp_t); void *__kmalloc(size_t size, gfp_t flags); -static inline void *kmalloc(size_t size, gfp_t flags) -{ - if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { - struct kmem_cache *s = kmalloc_slab(size); - - if (!s) - return ZERO_SIZE_PTR; - - return kmem_cache_alloc(s, flags); - } else - return __kmalloc(size, flags); -} - #ifdef CONFIG_NUMA void *__kmalloc_node(size_t size, gfp_t flags, int node); void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); @@ -300,4 +286,23 @@ slow: } #endif + +static inline void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags) +{ + return slab_alloc(s, gfpflags, -1, __builtin_return_address(0)); +} + +static inline void *kmalloc(size_t size, gfp_t flags) +{ + if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { + struct kmem_cache *s = kmalloc_slab(size); + + if (!s) + return ZERO_SIZE_PTR; + + return kmem_cache_alloc(s, flags); + } else + return __kmalloc(size, flags); +} + #endif /* _LINUX_SLUB_DEF_H */ diff --git a/mm/slub.c b/mm/slub.c index 2a09696..a2a7812 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1525,12 +1525,6 @@ debug: goto out; } -void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags) -{ - return slab_alloc(s, gfpflags, -1, __builtin_return_address(0)); -} -EXPORT_SYMBOL(kmem_cache_alloc); - #ifdef CONFIG_NUMA void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node) { -- 1.4.4.4