Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 1 | #ifndef SLAB_H |
| 2 | #define SLAB_H |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 6 | #define SLAB_HWCACHE_ALIGN 1 |
| 7 | #define SLAB_PANIC 2 |
| 8 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ |
| 9 | |
Matthew Wilcox | de1af8f | 2016-12-14 15:09:25 -0800 | [diff] [blame^] | 10 | void *kmalloc(size_t size, gfp_t); |
| 11 | void kfree(void *); |
| 12 | |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 13 | struct kmem_cache { |
| 14 | int size; |
| 15 | void (*ctor)(void *); |
| 16 | }; |
| 17 | |
| 18 | void *kmem_cache_alloc(struct kmem_cache *cachep, int flags); |
| 19 | void kmem_cache_free(struct kmem_cache *cachep, void *objp); |
| 20 | |
| 21 | struct kmem_cache * |
| 22 | kmem_cache_create(const char *name, size_t size, size_t offset, |
| 23 | unsigned long flags, void (*ctor)(void *)); |
| 24 | |
| 25 | #endif /* SLAB_H */ |