aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slab_def.h')
-rw-r--r--include/linux/slab_def.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 16e814ffab8d..32bdc2ffd715 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -58,36 +58,6 @@ found:
58 return __kmalloc(size, flags); 58 return __kmalloc(size, flags);
59} 59}
60 60
61static inline void *kzalloc(size_t size, gfp_t flags)
62{
63 if (__builtin_constant_p(size)) {
64 int i = 0;
65
66 if (!size)
67 return ZERO_SIZE_PTR;
68
69#define CACHE(x) \
70 if (size <= x) \
71 goto found; \
72 else \
73 i++;
74#include "kmalloc_sizes.h"
75#undef CACHE
76 {
77 extern void __you_cannot_kzalloc_that_much(void);
78 __you_cannot_kzalloc_that_much();
79 }
80found:
81#ifdef CONFIG_ZONE_DMA
82 if (flags & GFP_DMA)
83 return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep,
84 flags);
85#endif
86 return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags);
87 }
88 return __kzalloc(size, flags);
89}
90
91#ifdef CONFIG_NUMA 61#ifdef CONFIG_NUMA
92extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 62extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
93extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 63extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);