blob: bb5368df4be84397f28ec90b134b63687fdcaed6 [file] [log] [blame]
Paul Mundt6193a2f2007-07-15 23:38:22 -07001#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H
3
4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
5
Eduard - Gabriel Munteanu3eae2cb22008-08-10 20:14:07 +03006static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
7 gfp_t flags)
Paul Mundt6193a2f2007-07-15 23:38:22 -07008{
9 return kmem_cache_alloc_node(cachep, flags, -1);
10}
11
12void *__kmalloc_node(size_t size, gfp_t flags, int node);
13
Eduard - Gabriel Munteanu3eae2cb22008-08-10 20:14:07 +030014static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
Paul Mundt6193a2f2007-07-15 23:38:22 -070015{
16 return __kmalloc_node(size, flags, node);
17}
18
19/**
20 * kmalloc - allocate memory
21 * @size: how many bytes of memory are required.
22 * @flags: the type of memory to allocate (see kcalloc).
23 *
24 * kmalloc is the normal method of allocating memory
25 * in the kernel.
26 */
Eduard - Gabriel Munteanu3eae2cb22008-08-10 20:14:07 +030027static __always_inline void *kmalloc(size_t size, gfp_t flags)
Paul Mundt6193a2f2007-07-15 23:38:22 -070028{
29 return __kmalloc_node(size, flags, -1);
30}
31
Eduard - Gabriel Munteanu3eae2cb22008-08-10 20:14:07 +030032static __always_inline void *__kmalloc(size_t size, gfp_t flags)
Paul Mundt6193a2f2007-07-15 23:38:22 -070033{
34 return kmalloc(size, flags);
35}
36
Pekka Enberg7e85ee02009-06-12 14:03:06 +030037static inline void kmem_cache_init_late(void)
38{
39 /* Nothing to do */
40}
41
Paul Mundt6193a2f2007-07-15 23:38:22 -070042#endif /* __LINUX_SLOB_DEF_H */