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