Lines Matching refs:bcache

64 struct bcache  struct
122 expand_hash_table (struct bcache *bcache) in expand_hash_table() argument
141 bcache->expand_count++; in expand_hash_table()
142 bcache->expand_hash_count += bcache->unique_count; in expand_hash_table()
145 new_num_buckets = bcache->num_buckets * 2; in expand_hash_table()
147 if (sizes[i] > bcache->num_buckets) in expand_hash_table()
159 bcache->structure_size -= (bcache->num_buckets in expand_hash_table()
160 * sizeof (bcache->bucket[0])); in expand_hash_table()
161 bcache->structure_size += new_size; in expand_hash_table()
165 for (i = 0; i < bcache->num_buckets; i++) in expand_hash_table()
169 for (s = bcache->bucket[i]; s; s = next) in expand_hash_table()
182 if (bcache->bucket) in expand_hash_table()
183 xfree (bcache->bucket); in expand_hash_table()
184 bcache->bucket = new_buckets; in expand_hash_table()
185 bcache->num_buckets = new_num_buckets; in expand_hash_table()
199 bcache_data (const void *addr, int length, struct bcache *bcache) in bcache_data() argument
207 if (bcache->unique_count >= bcache->num_buckets * CHAIN_LENGTH_THRESHOLD) in bcache_data()
208 expand_hash_table (bcache); in bcache_data()
210 bcache->total_count++; in bcache_data()
211 bcache->total_size += length; in bcache_data()
215 hash_index = full_hash % bcache->num_buckets; in bcache_data()
220 for (s = bcache->bucket[hash_index]; s; s = s->next) in bcache_data()
228 bcache->half_hash_miss_count++; in bcache_data()
235 = obstack_alloc (&bcache->cache, BSTRING_SIZE (length)); in bcache_data()
238 new->next = bcache->bucket[hash_index]; in bcache_data()
240 bcache->bucket[hash_index] = new; in bcache_data()
242 bcache->unique_count++; in bcache_data()
243 bcache->unique_size += length; in bcache_data()
244 bcache->structure_size += BSTRING_SIZE (length); in bcache_data()
251 deprecated_bcache (const void *addr, int length, struct bcache *bcache) in deprecated_bcache() argument
253 return bcache_data (addr, length, bcache); in deprecated_bcache()
257 bcache (const void *addr, int length, struct bcache *bcache) in bcache() function
259 return bcache_data (addr, length, bcache); in bcache()
264 struct bcache *
268 struct bcache *b = XCALLOC (1, struct bcache); in bcache_xmalloc()
278 bcache_xfree (struct bcache *bcache) in bcache_xfree() argument
280 if (bcache == NULL) in bcache_xfree()
282 obstack_free (&bcache->cache, 0); in bcache_xfree()
283 xfree (bcache->bucket); in bcache_xfree()
284 xfree (bcache); in bcache_xfree()
315 print_bcache_statistics (struct bcache *c, char *type) in print_bcache_statistics()
436 bcache_memory_used (struct bcache *bcache) in bcache_memory_used() argument
438 return obstack_memory_used (&bcache->cache); in bcache_memory_used()