Lines Matching defs:kcache
52 struct key_cache* kcache = (struct key_cache*)calloc(1,
53 sizeof(*kcache));
55 if(!kcache) {
62 kcache->slab = slabhash_create(numtables, start_size, maxmem,
65 if(!kcache->slab) {
67 free(kcache);
70 return kcache;
74 key_cache_delete(struct key_cache* kcache)
76 if(!kcache)
78 slabhash_delete(kcache->slab);
79 free(kcache);
83 key_cache_insert(struct key_cache* kcache, struct key_entry_key* kkey,
95 slabhash_insert(kcache->slab, k->entry.hash, &k->entry,
102 * @param kcache: the key cache.
111 key_cache_search(struct key_cache* kcache, uint8_t* name, size_t namelen,
121 e = slabhash_lookup(kcache->slab, lookfor.entry.hash, &lookfor, wr);
128 key_cache_obtain(struct key_cache* kcache, uint8_t* name, size_t namelen,
133 struct key_entry_key* k = key_cache_search(kcache, name,
157 key_cache_get_mem(struct key_cache* kcache)
159 return sizeof(*kcache) + slabhash_get_mem(kcache->slab);
162 void key_cache_remove(struct key_cache* kcache,
171 slabhash_remove(kcache->slab, lookfor.entry.hash, &lookfor);