blob: e183a0a65ac1cb176f60a4131cf5bf0419c3608b [file] [log] [blame]
Seth Jennings4e2e2772013-07-10 16:04:55 -07001#ifndef _ZBUD_H_
2#define _ZBUD_H_
3
4#include <linux/types.h>
5
6struct zbud_pool;
7
8struct zbud_ops {
9 int (*evict)(struct zbud_pool *pool, unsigned long handle);
10};
11
Krzysztof Kozlowskic83db4f2015-09-08 15:05:06 -070012struct zbud_pool *zbud_create_pool(gfp_t gfp, const struct zbud_ops *ops);
Seth Jennings4e2e2772013-07-10 16:04:55 -070013void zbud_destroy_pool(struct zbud_pool *pool);
Dan Streetman99eef8e2014-08-06 16:08:33 -070014int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp,
Seth Jennings4e2e2772013-07-10 16:04:55 -070015 unsigned long *handle);
16void zbud_free(struct zbud_pool *pool, unsigned long handle);
17int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries);
18void *zbud_map(struct zbud_pool *pool, unsigned long handle);
19void zbud_unmap(struct zbud_pool *pool, unsigned long handle);
20u64 zbud_get_pool_size(struct zbud_pool *pool);
21
22#endif /* _ZBUD_H_ */