| 403 | } |
| 404 | |
| 405 | RamCacheCLFUSEntry * |
| 406 | RamCacheCLFUS::_destroy(RamCacheCLFUSEntry *e) |
| 407 | { |
| 408 | RamCacheCLFUSEntry *ret = e->hash_link.next; |
| 409 | this->_move_compressed(e); |
| 410 | this->_lru[e->flag_bits.lru].remove(e); |
| 411 | if (!e->flag_bits.lru) { |
| 412 | this->_objects--; |
| 413 | this->_bytes -= e->size + ENTRY_OVERHEAD; |
| 414 | ts::Metrics::Gauge::decrement(cache_rsb.ram_cache_bytes, e->size); |
| 415 | ts::Metrics::Gauge::decrement(stripe->cache_vol->vol_rsb.ram_cache_bytes, e->size); |
| 416 | e->data = nullptr; |
| 417 | } else { |
| 418 | this->_history--; |
| 419 | } |
| 420 | uint32_t b = e->key.slice32(3) % this->_nbuckets; |
| 421 | this->_bucket[b].remove(e); |
| 422 | DDbg(dbg_ctl_ram_cache, "put %X %" PRId64 " DESTROYED", e->key.slice32(3), e->auxkey); |
| 423 | THREAD_FREE(e, ramCacheCLFUSEntryAllocator, this_thread()); |
| 424 | return ret; |
| 425 | } |
| 426 | |
| 427 | void |
| 428 | RamCacheCLFUS::compress_entries(EThread *thread, int do_at_most) |
no test coverage detected