Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 1 | #ifndef __LINUX_SLOB_DEF_H |
| 2 | #define __LINUX_SLOB_DEF_H |
| 3 | |
Ezequiel Garcia | 90f2cbb | 2012-09-08 17:47:51 -0300 | [diff] [blame] | 4 | #include <linux/numa.h> |
| 5 | |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 6 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
| 7 | |
Eduard - Gabriel Munteanu | 3eae2cb2 | 2008-08-10 20:14:07 +0300 | [diff] [blame] | 8 | static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, |
| 9 | gfp_t flags) |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 10 | { |
Ezequiel Garcia | 90f2cbb | 2012-09-08 17:47:51 -0300 | [diff] [blame] | 11 | return kmem_cache_alloc_node(cachep, flags, NUMA_NO_NODE); |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 15 | |
Eduard - Gabriel Munteanu | 3eae2cb2 | 2008-08-10 20:14:07 +0300 | [diff] [blame] | 16 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 17 | { |
| 18 | return __kmalloc_node(size, flags, node); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * kmalloc - allocate memory |
| 23 | * @size: how many bytes of memory are required. |
| 24 | * @flags: the type of memory to allocate (see kcalloc). |
| 25 | * |
| 26 | * kmalloc is the normal method of allocating memory |
| 27 | * in the kernel. |
| 28 | */ |
Eduard - Gabriel Munteanu | 3eae2cb2 | 2008-08-10 20:14:07 +0300 | [diff] [blame] | 29 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 30 | { |
Ezequiel Garcia | 90f2cbb | 2012-09-08 17:47:51 -0300 | [diff] [blame] | 31 | return __kmalloc_node(size, flags, NUMA_NO_NODE); |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 32 | } |
| 33 | |
Eduard - Gabriel Munteanu | 3eae2cb2 | 2008-08-10 20:14:07 +0300 | [diff] [blame] | 34 | static __always_inline void *__kmalloc(size_t size, gfp_t flags) |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 35 | { |
| 36 | return kmalloc(size, flags); |
| 37 | } |
| 38 | |
Paul Mundt | 6193a2f | 2007-07-15 23:38:22 -0700 | [diff] [blame] | 39 | #endif /* __LINUX_SLOB_DEF_H */ |