Lines Matching defs:bin

97 bin_delete(struct lruhash* table, struct lruhash_bin* bin)
101 if(!bin)
103 lock_quick_destroy(&bin->lock);
104 p = bin->overflow_list;
105 bin->overflow_list = NULL;
123 * bin x & mask, and new mask uses one more bit, so all entries in
124 * one bin will go into the old bin or bin | newbit */
128 /* so, really, this task could also be threaded, per bin. */
139 /* link into correct new bin */
166 bin_overflow_remove(struct lruhash_bin* bin, struct lruhash_entry* entry)
168 struct lruhash_entry* p = bin->overflow_list;
169 struct lruhash_entry** prevp = &bin->overflow_list;
184 struct lruhash_bin* bin;
201 bin = &table->array[d->hash & table->size_mask];
203 lock_quick_lock(&bin->lock);
204 bin_overflow_remove(bin, d);
212 lock_quick_unlock(&bin->lock);
218 struct lruhash_bin* bin, hashvalue_t hash, void* key)
220 struct lruhash_entry* p = bin->overflow_list;
302 struct lruhash_bin* bin;
313 /* find bin */
315 bin = &table->array[hash & table->size_mask];
316 lock_quick_lock(&bin->lock);
319 if(!(found=bin_find_entry(table, bin, hash, entry->key))) {
320 /* if not: add to bin */
321 entry->overflow_next = bin->overflow_list;
322 bin->overflow_list = entry;
337 lock_quick_unlock(&bin->lock);
358 struct lruhash_bin* bin;
362 bin = &table->array[hash & table->size_mask];
363 lock_quick_lock(&bin->lock);
364 if((entry=bin_find_entry(table, bin, hash, key)))
372 lock_quick_unlock(&bin->lock);
380 struct lruhash_bin* bin;
389 bin = &table->array[hash & table->size_mask];
390 lock_quick_lock(&bin->lock);
391 if((entry=bin_find_entry(table, bin, hash, key))) {
392 bin_overflow_remove(bin, entry);
396 lock_quick_unlock(&bin->lock);
406 lock_quick_unlock(&bin->lock);
413 /** clear bin, respecting locks, does not do space, LRU */
415 bin_clear(struct lruhash* table, struct lruhash_bin* bin)
419 lock_quick_lock(&bin->lock);
420 p = bin->overflow_list;
432 bin->overflow_list = NULL;
433 lock_quick_unlock(&bin->lock);
481 log_info("bin[%d] %d", (int)i, here);
485 log_info(" bin min %d, avg %.2lf, max %d", min,