aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slob_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slob_def.h')
-rw-r--r--include/linux/slob_def.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
new file mode 100644
index 000000000000..a2daf2d418a9
--- /dev/null
+++ b/include/linux/slob_def.h
@@ -0,0 +1,46 @@
1#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
6static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
7{
8 return kmem_cache_alloc_node(cachep, flags, -1);
9}
10
11void *__kmalloc_node(size_t size, gfp_t flags, int node);
12
13static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
14{
15 return __kmalloc_node(size, flags, node);
16}
17
18/**
19 * kmalloc - allocate memory
20 * @size: how many bytes of memory are required.
21 * @flags: the type of memory to allocate (see kcalloc).
22 *
23 * kmalloc is the normal method of allocating memory
24 * in the kernel.
25 */
26static inline void *kmalloc(size_t size, gfp_t flags)
27{
28 return __kmalloc_node(size, flags, -1);
29}
30
31static inline void *__kmalloc(size_t size, gfp_t flags)
32{
33 return kmalloc(size, flags);
34}
35
36/**
37 * kzalloc - allocate memory. The memory is set to zero.
38 * @size: how many bytes of memory are required.
39 * @flags: the type of memory to allocate (see kcalloc).
40 */
41static inline void *kzalloc(size_t size, gfp_t flags)
42{
43 return __kzalloc(size, flags);
44}
45
46#endif /* __LINUX_SLOB_DEF_H */