Lines Matching full:bin

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