Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 2 | #ifndef SLAB_H |
| 3 | #define SLAB_H |
| 4 | |
| 5 | #include <linux/types.h> |
Matthew Wilcox | 3d4d5d6 | 2018-02-25 06:00:11 -0500 | [diff] [blame] | 6 | #include <linux/gfp.h> |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 7 | |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 8 | #define SLAB_HWCACHE_ALIGN 1 |
| 9 | #define SLAB_PANIC 2 |
| 10 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ |
| 11 | |
Matthew Wilcox | de1af8f | 2016-12-14 15:09:25 -0800 | [diff] [blame] | 12 | void *kmalloc(size_t size, gfp_t); |
| 13 | void kfree(void *); |
| 14 | |
Matthew Wilcox | 3d4d5d6 | 2018-02-25 06:00:11 -0500 | [diff] [blame] | 15 | static inline void *kzalloc(size_t size, gfp_t gfp) |
| 16 | { |
| 17 | return kmalloc(size, gfp | __GFP_ZERO); |
| 18 | } |
| 19 | |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 20 | void *kmem_cache_alloc(struct kmem_cache *cachep, int flags); |
| 21 | void kmem_cache_free(struct kmem_cache *cachep, void *objp); |
| 22 | |
| 23 | struct kmem_cache * |
| 24 | kmem_cache_create(const char *name, size_t size, size_t offset, |
| 25 | unsigned long flags, void (*ctor)(void *)); |
| 26 | |
| 27 | #endif /* SLAB_H */ |