Lines Matching defs:bin

99 bin_delete(struct lruhash* table, struct lruhash_bin* bin)
103 if(!bin)
105 lock_quick_destroy(&bin->lock);
106 p = bin->overflow_list;
107 bin->overflow_list = NULL;
125 * bin x & mask, and new mask uses one more bit, so all entries in
126 * one bin will go into the old bin or bin | newbit */
130 /* so, really, this task could also be threaded, per bin. */
141 /* link into correct new bin */
168 bin_overflow_remove(struct lruhash_bin* bin, struct lruhash_entry* entry)
170 struct lruhash_entry* p = bin->overflow_list;
171 struct lruhash_entry** prevp = &bin->overflow_list;
186 struct lruhash_bin* bin;
203 bin = &table->array[d->hash & table->size_mask];
205 lock_quick_lock(&bin->lock);
206 bin_overflow_remove(bin, d);
214 lock_quick_unlock(&bin->lock);
220 struct lruhash_bin* bin, hashvalue_type hash, void* key, size_t* collisions)
223 struct lruhash_entry* p = bin->overflow_list;
308 struct lruhash_bin* bin;
320 /* find bin */
322 bin = &table->array[hash & table->size_mask];
323 lock_quick_lock(&bin->lock);
326 if(!(found=bin_find_entry(table, bin, hash, entry->key, &collisions))) {
327 /* if not: add to bin */
328 entry->overflow_next = bin->overflow_list;
329 bin->overflow_list = entry;
346 lock_quick_unlock(&bin->lock);
367 struct lruhash_bin* bin;
371 bin = &table->array[hash & table->size_mask];
372 lock_quick_lock(&bin->lock);
373 if((entry=bin_find_entry(table, bin, hash, key, NULL)))
381 lock_quick_unlock(&bin->lock);
389 struct lruhash_bin* bin;
398 bin = &table->array[hash & table->size_mask];
399 lock_quick_lock(&bin->lock);
400 if((entry=bin_find_entry(table, bin, hash, key, NULL))) {
401 bin_overflow_remove(bin, entry);
405 lock_quick_unlock(&bin->lock);
414 lock_quick_unlock(&bin->lock);
422 /** clear bin, respecting locks, does not do space, LRU */
424 bin_clear(struct lruhash* table, struct lruhash_bin* bin)
428 lock_quick_lock(&bin->lock);
429 p = bin->overflow_list;
441 bin->overflow_list = NULL;
442 lock_quick_unlock(&bin->lock);
490 log_info("bin[%d] %d", (int)i, here);
494 log_info(" bin min %d, avg %.2lf, max %d", min,
621 struct lruhash_bin* bin;
633 /* find bin */
635 bin = &table->array[hash & table->size_mask];
636 lock_quick_lock(&bin->lock);
639 if ((found = bin_find_entry(table, bin, hash, entry->key, &collisions)) != NULL) {
645 /* if not: add to bin */
646 entry->overflow_next = bin->overflow_list;
647 bin->overflow_list = entry;
657 lock_quick_unlock(&bin->lock);