1
2
3
4
5
6
7
8#ifndef _ZCACHE_H_
9#define _ZCACHE_H_
10
11struct zcache_preload {
12 struct tmem_obj *obj;
13 struct tmem_objnode *objnodes[OBJNODE_TREE_MAX_PATH];
14};
15
16struct tmem_pool;
17
18#define MAX_POOLS_PER_CLIENT 16
19
20#define MAX_CLIENTS 16
21#define LOCAL_CLIENT ((uint16_t)-1)
22
23struct zcache_client {
24 struct tmem_pool *tmem_pools[MAX_POOLS_PER_CLIENT];
25 bool allocated;
26 atomic_t refcount;
27};
28
29extern struct tmem_pool *zcache_get_pool_by_id(uint16_t cli_id,
30 uint16_t poolid);
31extern void zcache_put_pool(struct tmem_pool *pool);
32
33extern int zcache_put_page(int, int, struct tmem_oid *,
34 uint32_t, void *,
35 unsigned int, bool, int);
36extern int zcache_get_page(int, int, struct tmem_oid *, uint32_t,
37 void *, size_t *, bool, int);
38extern int zcache_flush_page(int, int, struct tmem_oid *, uint32_t);
39extern int zcache_flush_object(int, int, struct tmem_oid *);
40extern void zcache_decompress_to_page(char *, unsigned int, struct page *);
41
42#ifdef CONFIG_RAMSTER
43extern void *zcache_pampd_create(char *, unsigned int, bool, int,
44 struct tmem_handle *);
45int zcache_autocreate_pool(unsigned int cli_id, unsigned int pool_id, bool eph);
46#endif
47
48#define MAX_POOLS_PER_CLIENT 16
49
50#define MAX_CLIENTS 16
51#define LOCAL_CLIENT ((uint16_t)-1)
52
53#endif
54