zbud.h 740 B

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