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(-) Index: linux-2.6.23-rc1/include/linux/slub_def.h =================================================================== --- linux-2.6.23-rc1.orig/include/linux/slub_def.h 2007-07-26 20:14:43.000000000 -0700 +++ linux-2.6.23-rc1/include/linux/slub_def.h 2007-07-26 20:21:02.000000000 -0700 @@ -165,22 +165,8 @@ static inline struct kmem_cache *kmalloc #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); @@ -301,4 +287,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 */ Index: linux-2.6.23-rc1/mm/slub.c =================================================================== --- linux-2.6.23-rc1.orig/mm/slub.c 2007-07-26 20:11:06.000000000 -0700 +++ linux-2.6.23-rc1/mm/slub.c 2007-07-26 20:21:02.000000000 -0700 @@ -1530,12 +1530,6 @@ debug: } EXPORT_SYMBOL(__slab_alloc); -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) {