Commit | Line | Data |
---|---|---|
6193a2ff PM |
1 | #ifndef __LINUX_SLOB_DEF_H |
2 | #define __LINUX_SLOB_DEF_H | |
3 | ||
a6eb9fe1 FT |
4 | #ifdef ARCH_DMA_MINALIGN |
5 | #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN | |
6 | #else | |
bac49ce4 DW |
7 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long) |
8 | #endif | |
9 | ||
10 | #ifndef ARCH_SLAB_MINALIGN | |
11 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long) | |
12 | #endif | |
13 | ||
6193a2ff PM |
14 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
15 | ||
3eae2cb2 EGM |
16 | static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, |
17 | gfp_t flags) | |
6193a2ff PM |
18 | { |
19 | return kmem_cache_alloc_node(cachep, flags, -1); | |
20 | } | |
21 | ||
22 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | |
23 | ||
3eae2cb2 | 24 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
6193a2ff PM |
25 | { |
26 | return __kmalloc_node(size, flags, node); | |
27 | } | |
28 | ||
29 | /** | |
30 | * kmalloc - allocate memory | |
31 | * @size: how many bytes of memory are required. | |
32 | * @flags: the type of memory to allocate (see kcalloc). | |
33 | * | |
34 | * kmalloc is the normal method of allocating memory | |
35 | * in the kernel. | |
36 | */ | |
3eae2cb2 | 37 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
6193a2ff PM |
38 | { |
39 | return __kmalloc_node(size, flags, -1); | |
40 | } | |
41 | ||
3eae2cb2 | 42 | static __always_inline void *__kmalloc(size_t size, gfp_t flags) |
6193a2ff PM |
43 | { |
44 | return kmalloc(size, flags); | |
45 | } | |
46 | ||
6193a2ff | 47 | #endif /* __LINUX_SLOB_DEF_H */ |