slab.h 618 B

12345678910111213141516171819202122232425262728
  1. #ifndef SLAB_H
  2. #define SLAB_H
  3. #include <linux/types.h>
  4. #define GFP_KERNEL 1
  5. #define SLAB_HWCACHE_ALIGN 1
  6. #define SLAB_PANIC 2
  7. #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
  8. static inline int gfpflags_allow_blocking(gfp_t mask)
  9. {
  10. return 1;
  11. }
  12. struct kmem_cache {
  13. int size;
  14. void (*ctor)(void *);
  15. };
  16. void *kmem_cache_alloc(struct kmem_cache *cachep, int flags);
  17. void kmem_cache_free(struct kmem_cache *cachep, void *objp);
  18. struct kmem_cache *
  19. kmem_cache_create(const char *name, size_t size, size_t offset,
  20. unsigned long flags, void (*ctor)(void *));
  21. #endif /* SLAB_H */