zbud.h 701 B

12345678910111213141516171819202122
  1. #ifndef _ZBUD_H_
  2. #define _ZBUD_H_
  3. #include <linux/types.h>
  4. struct zbud_pool;
  5. struct zbud_ops {
  6. int (*evict)(struct zbud_pool *pool, unsigned long handle);
  7. };
  8. struct zbud_pool *zbud_create_pool(gfp_t gfp, const struct zbud_ops *ops);
  9. void zbud_destroy_pool(struct zbud_pool *pool);
  10. int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp,
  11. unsigned long *handle);
  12. void zbud_free(struct zbud_pool *pool, unsigned long handle);
  13. int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries);
  14. void *zbud_map(struct zbud_pool *pool, unsigned long handle);
  15. void zbud_unmap(struct zbud_pool *pool, unsigned long handle);
  16. u64 zbud_get_pool_size(struct zbud_pool *pool);
  17. #endif /* _ZBUD_H_ */