Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Seth Jennings | 4e2e277 | 2013-07-10 16:04:55 -0700 | [diff] [blame] | 2 | #ifndef _ZBUD_H_ |
| 3 | #define _ZBUD_H_ |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | |
| 7 | struct zbud_pool; |
| 8 | |
| 9 | struct zbud_ops { |
| 10 | int (*evict)(struct zbud_pool *pool, unsigned long handle); |
| 11 | }; |
| 12 | |
Krzysztof Kozlowski | c83db4f | 2015-09-08 15:05:06 -0700 | [diff] [blame] | 13 | struct zbud_pool *zbud_create_pool(gfp_t gfp, const struct zbud_ops *ops); |
Seth Jennings | 4e2e277 | 2013-07-10 16:04:55 -0700 | [diff] [blame] | 14 | void zbud_destroy_pool(struct zbud_pool *pool); |
Dan Streetman | 99eef8e | 2014-08-06 16:08:33 -0700 | [diff] [blame] | 15 | int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp, |
Seth Jennings | 4e2e277 | 2013-07-10 16:04:55 -0700 | [diff] [blame] | 16 | unsigned long *handle); |
| 17 | void zbud_free(struct zbud_pool *pool, unsigned long handle); |
| 18 | int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries); |
| 19 | void *zbud_map(struct zbud_pool *pool, unsigned long handle); |
| 20 | void zbud_unmap(struct zbud_pool *pool, unsigned long handle); |
| 21 | u64 zbud_get_pool_size(struct zbud_pool *pool); |
| 22 | |
| 23 | #endif /* _ZBUD_H_ */ |