Lines Matching refs:bcache
37 struct pt_block_cache *bcache; in pt_bcache_alloc() local
43 size = sizeof(*bcache) + (nentries * sizeof(struct pt_bcache_entry)); in pt_bcache_alloc()
47 bcache = malloc((size_t) size); in pt_bcache_alloc()
48 if (!bcache) in pt_bcache_alloc()
51 memset(bcache, 0, (size_t) size); in pt_bcache_alloc()
52 bcache->nentries = (uint32_t) nentries; in pt_bcache_alloc()
54 return bcache; in pt_bcache_alloc()
57 void pt_bcache_free(struct pt_block_cache *bcache) in pt_bcache_free() argument
59 free(bcache); in pt_bcache_free()
62 int pt_bcache_add(struct pt_block_cache *bcache, uint64_t index, in pt_bcache_add() argument
65 if (!bcache) in pt_bcache_add()
68 if (bcache->nentries <= index) in pt_bcache_add()
75 bcache->entry[(uint32_t) index] = bce; in pt_bcache_add()
81 const struct pt_block_cache *bcache, uint64_t index) in pt_bcache_lookup() argument
83 if (!bce || !bcache) in pt_bcache_lookup()
86 if (bcache->nentries <= index) in pt_bcache_lookup()
93 *bce = bcache->entry[(uint32_t) index]; in pt_bcache_lookup()