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