From a59ea4f382ba7c8590d0c5165b3fbe6f11d3fd35 Mon Sep 17 00:00:00 2001 From: John Plevyak Date: Sat, 21 Nov 2020 15:31:10 -0800 Subject: [PATCH] Convert auxkey form 2 uint32_t to 1 uint64_t. Signed-off-by: John Plevyak --- iocore/cache/Cache.cc | 5 +-- iocore/cache/CacheDir.cc | 3 +- iocore/cache/CacheWrite.cc | 3 +- iocore/cache/P_RamCache.h | 10 ++--- iocore/cache/RamCacheCLFUS.cc | 75 ++++++++++++++++------------------- iocore/cache/RamCacheLRU.cc | 46 ++++++++++----------- 6 files changed, 64 insertions(+), 78 deletions(-) diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc index 8d2d9e13af0..663349d3308 100644 --- a/iocore/cache/Cache.cc +++ b/iocore/cache/Cache.cc @@ -2271,8 +2271,7 @@ CacheVC::handleReadDone(int event, Event *e) (doc_len && static_cast(doc_len) < cache_config_ram_cache_cutoff) || !cache_config_ram_cache_cutoff); if (cutoff_check && !f.doc_from_ram_cache) { uint64_t o = dir_offset(&dir); - vol->ram_cache->put(read_key, buf.get(), doc->len, http_copy_hdr, static_cast(o >> 32), - static_cast(o)); + vol->ram_cache->put(read_key, buf.get(), doc->len, http_copy_hdr, o); } if (!doc_len) { // keep a pointer to it. In case the state machine decides to @@ -2304,7 +2303,7 @@ CacheVC::handleRead(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */) // check ram cache ink_assert(vol->mutex->thread_holding == this_ethread()); int64_t o = dir_offset(&dir); - int ram_hit_state = vol->ram_cache->get(read_key, &buf, static_cast(o >> 32), static_cast(o)); + int ram_hit_state = vol->ram_cache->get(read_key, &buf, static_cast(o)); f.compressed_in_ram = (ram_hit_state > RAM_HIT_COMPRESS_NONE) ? 1 : 0; if (ram_hit_state >= RAM_HIT_COMPRESS_NONE) { goto LramHit; diff --git a/iocore/cache/CacheDir.cc b/iocore/cache/CacheDir.cc index 04b6288e05d..3bc464d87c4 100644 --- a/iocore/cache/CacheDir.cc +++ b/iocore/cache/CacheDir.cc @@ -823,8 +823,7 @@ dir_lookaside_fixup(const CacheKey *key, Vol *d) DDebug("dir_lookaside", "fixup %X %X offset %" PRId64 " phase %d %d", key->slice32(0), key->slice32(1), dir_offset(&b->new_dir), dir_phase(&b->new_dir), res); int64_t o = dir_offset(&b->dir), n = dir_offset(&b->new_dir); - d->ram_cache->fixup(key, static_cast(o >> 32), static_cast(o), static_cast(n >> 32), - static_cast(n)); + d->ram_cache->fixup(key, static_cast(o), static_cast(n)); d->lookaside[i].remove(b); free_EvacuationBlock(b, d->mutex->thread_holding); return res; diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc index cff181864d3..56446cb8f73 100644 --- a/iocore/cache/CacheWrite.cc +++ b/iocore/cache/CacheWrite.cc @@ -521,8 +521,7 @@ CacheVC::evacuateDocDone(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */) } if (dir_overwrite(&doc->first_key, vol, &dir, &overwrite_dir)) { int64_t o = dir_offset(&overwrite_dir), n = dir_offset(&dir); - vol->ram_cache->fixup(&doc->first_key, static_cast(o >> 32), static_cast(o), - static_cast(n >> 32), static_cast(n)); + vol->ram_cache->fixup(&doc->first_key, static_cast(o), static_cast(n)); } } else { DDebug("cache_evac", "evacuating earliest: %X %d", (int)doc->key.slice32(0), (int)dir_offset(&overwrite_dir)); diff --git a/iocore/cache/P_RamCache.h b/iocore/cache/P_RamCache.h index 7bece04e098..ab06171a308 100644 --- a/iocore/cache/P_RamCache.h +++ b/iocore/cache/P_RamCache.h @@ -31,12 +31,10 @@ class RamCache { public: // returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match - virtual int get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey1 = 0, uint32_t auxkey2 = 0) = 0; - virtual int put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy = false, uint32_t auxkey1 = 0, - uint32_t auxkey2 = 0) = 0; - virtual int fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_auxkey2, uint32_t new_auxkey1, - uint32_t new_auxkey2) = 0; - virtual int64_t size() const = 0; + virtual int get(CryptoHash *key, Ptr *ret_data, uint64_t auxkey = 0) = 0; + virtual int put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy = false, uint64_t auxkey = 0) = 0; + virtual int fixup(const CryptoHash *key, uint64_t old_auxkey, uint64_t new_auxkey) = 0; + virtual int64_t size() const = 0; virtual void init(int64_t max_bytes, Vol *vol) = 0; virtual ~RamCache(){}; diff --git a/iocore/cache/RamCacheCLFUS.cc b/iocore/cache/RamCacheCLFUS.cc index 6e5c96ceeab..9eca91d3ccf 100644 --- a/iocore/cache/RamCacheCLFUS.cc +++ b/iocore/cache/RamCacheCLFUS.cc @@ -50,8 +50,7 @@ struct RamCacheCLFUSEntry { CryptoHash key; - uint32_t auxkey1; - uint32_t auxkey2; + uint64_t auxkey; uint64_t hits; uint32_t size; // memory used including padding in buffer uint32_t len; // actual data length @@ -76,10 +75,9 @@ class RamCacheCLFUS : public RamCache RamCacheCLFUS() {} // returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match - int get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey1 = 0, uint32_t auxkey2 = 0) override; - int put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy = false, uint32_t auxkey1 = 0, - uint32_t auxkey2 = 0) override; - int fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_auxkey2, uint32_t new_auxkey1, uint32_t new_auxkey2) override; + int get(CryptoHash *key, Ptr *ret_data, uint64_t auxkey = 0) override; + int put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy = false, uint64_t auxkey = 0) override; + int fixup(const CryptoHash *key, uint64_t old_auxkey, uint64_t new_auxkey) override; int64_t size() const override; void init(int64_t max_bytes, Vol *vol) override; @@ -237,7 +235,7 @@ check_accounting(RamCacheCLFUS *c) #endif int -RamCacheCLFUS::get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey1, uint32_t auxkey2) +RamCacheCLFUS::get(CryptoHash *key, Ptr *ret_data, uint64_t auxkey) { if (!this->_max_bytes) { return 0; @@ -246,7 +244,7 @@ RamCacheCLFUS::get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey RamCacheCLFUSEntry *e = this->_bucket[i].head; char *b = nullptr; while (e) { - if (e->key == *key && e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2) { + if (e->key == *key && e->auxkey == auxkey) { this->_move_compressed(e); if (!e->flag_bits.lru) { // in memory if (CACHE_VALUE(e) > this->_average_value) { @@ -313,25 +311,25 @@ RamCacheCLFUS::get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey (*ret_data) = data; } CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_hits_stat, 1); - DDebug("ram_cache", "get %X %d %d size %d HIT", key->slice32(3), auxkey1, auxkey2, e->size); + DDebug("ram_cache", "get %X %" PRId64 " size %d HIT", key->slice32(3), auxkey, e->size); return ram_hit_state; } else { CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_misses_stat, 1); - DDebug("ram_cache", "get %X %d %d HISTORY", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "get %X %" PRId64 " HISTORY", key->slice32(3), auxkey); return 0; } } assert(e != e->hash_link.next); e = e->hash_link.next; } - DDebug("ram_cache", "get %X %d %d MISS", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "get %X %" PRId64 " MISS", key->slice32(3), auxkey); Lerror: CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_misses_stat, 1); return 0; Lfailed: ats_free(b); this->_destroy(e); - DDebug("ram_cache", "get %X %d %d Z_ERR", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "get %X %" PRId64 " Z_ERR", key->slice32(3), auxkey); goto Lerror; } @@ -361,7 +359,7 @@ RamCacheCLFUS::_tick() this->_history--; uint32_t b = e->key.slice32(3) % this->_nbuckets; this->_bucket[b].remove(e); - DDebug("ram_cache", "put %X %d %d size %d FREED", e->key.slice32(3), e->auxkey1, e->auxkey2, e->size); + DDebug("ram_cache", "put %X %" PRId64 " size %d FREED", e->key.slice32(3), e->auxkey, e->size); THREAD_FREE(e, ramCacheCLFUSEntryAllocator, this_thread()); } @@ -369,7 +367,7 @@ void RamCacheCLFUS::_victimize(RamCacheCLFUSEntry *e) { this->_objects--; - DDebug("ram_cache", "put %X %d %d size %d VICTIMIZED", e->key.slice32(3), e->auxkey1, e->auxkey2, e->size); + DDebug("ram_cache", "put %X %" PRId64 " size %d VICTIMIZED", e->key.slice32(3), e->auxkey, e->size); e->data = nullptr; e->flag_bits.lru = 1; this->_lru[1].enqueue(e); @@ -405,7 +403,7 @@ RamCacheCLFUS::_destroy(RamCacheCLFUSEntry *e) } uint32_t b = e->key.slice32(3) % this->_nbuckets; this->_bucket[b].remove(e); - DDebug("ram_cache", "put %X %d %d DESTROYED", e->key.slice32(3), e->auxkey1, e->auxkey2); + DDebug("ram_cache", "put %X %" PRId64 " DESTROYED", e->key.slice32(3), e->auxkey); THREAD_FREE(e, ramCacheCLFUSEntryAllocator, this_thread()); return ret; } @@ -552,7 +550,7 @@ RamCacheCLFUS::compress_entries(EThread *thread, int do_at_most) ats_free(b); e->flag_bits.incompressible = 1; Lcontinue:; - DDebug("ram_cache", "compress %X %d %d %d %d %d %d %d", e->key.slice32(3), e->auxkey1, e->auxkey2, e->flag_bits.incompressible, + DDebug("ram_cache", "compress %X %" PRId64 " %d %d %d %d %d", e->key.slice32(3), e->auxkey, e->flag_bits.incompressible, e->flag_bits.compressed, e->len, e->compressed_len, this->_ncompressed); if (!e->lru_link.next) { break; @@ -576,7 +574,7 @@ void RamCacheCLFUS::_requeue_victims(Que(RamCacheCLFUSEntry, lru_link) & victims } int -RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, uint32_t auxkey1, uint32_t auxkey2) +RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, uint64_t auxkey) { if (!this->_max_bytes) { return 0; @@ -587,7 +585,7 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, double victim_value = 0; while (e) { if (e->key == *key) { - if (e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2) { + if (e->auxkey == auxkey) { break; } else { e = this->_destroy(e); // discard when aux keys conflict @@ -618,7 +616,7 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, check_accounting(this); e->flag_bits.copy = copy; e->flag_bits.compressed = 0; - DDebug("ram_cache", "put %X %d %d size %d HIT", key->slice32(3), auxkey1, auxkey2, e->size); + DDebug("ram_cache", "put %X %" PRId64 " size %d HIT", key->slice32(3), auxkey, e->size); return 1; } else { this->_lru[1].remove(e); @@ -642,7 +640,7 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, uint16_t kk = this->_seen[s]; this->_seen[s] = k; if (this->_history >= this->_objects && kk != k) { - DDebug("ram_cache", "put %X %d %d size %d UNSEEN", key->slice32(3), auxkey1, auxkey2, size); + DDebug("ram_cache", "put %X %" PRId64 " size %d UNSEEN", key->slice32(3), auxkey, size); return 0; } } @@ -656,7 +654,7 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, this->_lru[1].enqueue(e); } this->_requeue_victims(victims); - DDebug("ram_cache", "put %X %d %d NO VICTIM", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "put %X %" PRId64 " NO VICTIM", key->slice32(3), auxkey); return 0; } this->_average_value = (CACHE_VALUE(victim) + (this->_average_value * (AVERAGE_VALUE_OVER - 1))) / AVERAGE_VALUE_OVER; @@ -681,7 +679,7 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, if (this->_bytes + victim->size + size > this->_max_bytes && victim_value > CACHE_VALUE(e)) { this->_requeue_victims(victims); this->_lru[1].enqueue(e); - DDebug("ram_cache", "put %X %d %d size %d INC %" PRId64 " HISTORY", key->slice32(3), auxkey1, auxkey2, e->size, e->hits); + DDebug("ram_cache", "put %X %" PRId64 " size %d INC %" PRId64 " HISTORY", key->slice32(3), auxkey, e->size, e->hits); return 0; } } @@ -703,11 +701,10 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, if (e) { this->_history--; // move from history } else { - e = THREAD_ALLOC(ramCacheCLFUSEntryAllocator, this_ethread()); - e->key = *key; - e->auxkey1 = auxkey1; - e->auxkey2 = auxkey2; - e->hits = 1; + e = THREAD_ALLOC(ramCacheCLFUSEntryAllocator, this_ethread()); + e->key = *key; + e->auxkey = auxkey; + e->hits = 1; this->_bucket[i].push(e); if (this->_objects > this->_nbuckets) { ++this->_ibuckets; @@ -732,28 +729,27 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy, this->_lru[0].enqueue(e); e->len = len; check_accounting(this); - DDebug("ram_cache", "put %X %d %d size %d INSERTED", key->slice32(3), auxkey1, auxkey2, e->size); + DDebug("ram_cache", "put %X %" PRId64 " size %d INSERTED", key->slice32(3), auxkey, e->size); return 1; Lhistory: this->_requeue_victims(victims); check_accounting(this); - e = THREAD_ALLOC(ramCacheCLFUSEntryAllocator, this_ethread()); - e->key = *key; - e->auxkey1 = auxkey1; - e->auxkey2 = auxkey2; - e->hits = 1; - e->size = data->block_size(); - e->flags = 0; + e = THREAD_ALLOC(ramCacheCLFUSEntryAllocator, this_ethread()); + e->key = *key; + e->auxkey = auxkey; + e->hits = 1; + e->size = data->block_size(); + e->flags = 0; this->_bucket[i].push(e); e->flag_bits.lru = 1; this->_lru[1].enqueue(e); this->_history++; - DDebug("ram_cache", "put %X %d %d HISTORY", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "put %X %" PRId64 " HISTORY", key->slice32(3), auxkey); return 0; } int -RamCacheCLFUS::fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_auxkey2, uint32_t new_auxkey1, uint32_t new_auxkey2) +RamCacheCLFUS::fixup(const CryptoHash *key, uint64_t old_auxkey, uint64_t new_auxkey) { if (!this->_max_bytes) { return 0; @@ -761,9 +757,8 @@ RamCacheCLFUS::fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_a uint32_t i = key->slice32(3) % this->_nbuckets; RamCacheCLFUSEntry *e = this->_bucket[i].head; while (e) { - if (e->key == *key && e->auxkey1 == old_auxkey1 && e->auxkey2 == old_auxkey2) { - e->auxkey1 = new_auxkey1; - e->auxkey2 = new_auxkey2; + if (e->key == *key && e->auxkey == old_auxkey) { + e->auxkey = new_auxkey; return 1; } e = e->hash_link.next; diff --git a/iocore/cache/RamCacheLRU.cc b/iocore/cache/RamCacheLRU.cc index 550e69c9808..1103ee612a2 100644 --- a/iocore/cache/RamCacheLRU.cc +++ b/iocore/cache/RamCacheLRU.cc @@ -25,8 +25,7 @@ struct RamCacheLRUEntry { CryptoHash key; - uint32_t auxkey1; - uint32_t auxkey2; + uint64_t auxkey; LINK(RamCacheLRUEntry, lru_link); LINK(RamCacheLRUEntry, hash_link); Ptr data; @@ -39,11 +38,10 @@ struct RamCacheLRU : public RamCache { int64_t bytes = 0; int64_t objects = 0; - // returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match - int get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey1 = 0, uint32_t auxkey2 = 0) override; - int put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy = false, uint32_t auxkey1 = 0, - uint32_t auxkey2 = 0) override; - int fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_auxkey2, uint32_t new_auxkey1, uint32_t new_auxkey2) override; + // returns 1 on found/stored, 0 on not found/stored, if provided auxkey must match + int get(CryptoHash *key, Ptr *ret_data, uint64_t auxkey = 0) override; + int put(CryptoHash *key, IOBufferData *data, uint32_t len, bool copy = false, uint64_t auxkey = 0) override; + int fixup(const CryptoHash *key, uint64_t old_auxkey, uint64_t new_auxkey) override; int64_t size() const override; void init(int64_t max_bytes, Vol *vol) override; @@ -119,7 +117,7 @@ RamCacheLRU::init(int64_t abytes, Vol *avol) } int -RamCacheLRU::get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey1, uint32_t auxkey2) +RamCacheLRU::get(CryptoHash *key, Ptr *ret_data, uint64_t auxkey) { if (!max_bytes) { return 0; @@ -127,17 +125,17 @@ RamCacheLRU::get(CryptoHash *key, Ptr *ret_data, uint32_t auxkey1, uint32_t i = key->slice32(3) % nbuckets; RamCacheLRUEntry *e = bucket[i].head; while (e) { - if (e->key == *key && e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2) { + if (e->key == *key && e->auxkey == auxkey) { lru.remove(e); lru.enqueue(e); (*ret_data) = e->data; - DDebug("ram_cache", "get %X %d %d HIT", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "get %X %" PRIu64 " HIT", key->slice32(3), auxkey); CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_hits_stat, 1); return 1; } e = e->hash_link.next; } - DDebug("ram_cache", "get %X %d %d MISS", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "get %X %" PRIu64 " MISS", key->slice32(3), auxkey); CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_misses_stat, 1); return 0; } @@ -151,7 +149,7 @@ RamCacheLRU::remove(RamCacheLRUEntry *e) lru.remove(e); bytes -= ENTRY_OVERHEAD + e->data->block_size(); CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_bytes_stat, -(ENTRY_OVERHEAD + e->data->block_size())); - DDebug("ram_cache", "put %X %d %d FREED", e->key.slice32(3), e->auxkey1, e->auxkey2); + DDebug("ram_cache", "put %X %" PRIu64 " FREED", e->key.slice32(3), e->auxkey); e->data = nullptr; THREAD_FREE(e, ramCacheLRUEntryAllocator, this_thread()); objects--; @@ -160,7 +158,7 @@ RamCacheLRU::remove(RamCacheLRUEntry *e) // ignore 'copy' since we don't touch the data int -RamCacheLRU::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool, uint32_t auxkey1, uint32_t auxkey2) +RamCacheLRU::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool, uint64_t auxkey) { if (!max_bytes) { return 0; @@ -171,14 +169,14 @@ RamCacheLRU::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool, uint32 uint16_t kk = seen[i]; seen[i] = k; if ((kk != k)) { - DDebug("ram_cache", "put %X %d %d len %d UNSEEN", key->slice32(3), auxkey1, auxkey2, len); + DDebug("ram_cache", "put %X %" PRIu64 " len %d UNSEEN", key->slice32(3), auxkey, len); return 0; } } RamCacheLRUEntry *e = bucket[i].head; while (e) { if (e->key == *key) { - if (e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2) { + if (e->auxkey == auxkey) { lru.remove(e); lru.enqueue(e); return 1; @@ -189,11 +187,10 @@ RamCacheLRU::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool, uint32 } e = e->hash_link.next; } - e = THREAD_ALLOC(ramCacheLRUEntryAllocator, this_ethread()); - e->key = *key; - e->auxkey1 = auxkey1; - e->auxkey2 = auxkey2; - e->data = data; + e = THREAD_ALLOC(ramCacheLRUEntryAllocator, this_ethread()); + e->key = *key; + e->auxkey = auxkey; + e->data = data; bucket[i].push(e); lru.enqueue(e); bytes += ENTRY_OVERHEAD + data->block_size(); @@ -207,7 +204,7 @@ RamCacheLRU::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool, uint32 break; } } - DDebug("ram_cache", "put %X %d %d INSERTED", key->slice32(3), auxkey1, auxkey2); + DDebug("ram_cache", "put %X %" PRIu64 " INSERTED", key->slice32(3), auxkey); if (objects > nbuckets) { ++ibuckets; resize_hashtable(); @@ -216,7 +213,7 @@ RamCacheLRU::put(CryptoHash *key, IOBufferData *data, uint32_t len, bool, uint32 } int -RamCacheLRU::fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_auxkey2, uint32_t new_auxkey1, uint32_t new_auxkey2) +RamCacheLRU::fixup(const CryptoHash *key, uint64_t old_auxkey, uint64_t new_auxkey) { if (!max_bytes) { return 0; @@ -224,9 +221,8 @@ RamCacheLRU::fixup(const CryptoHash *key, uint32_t old_auxkey1, uint32_t old_aux uint32_t i = key->slice32(3) % nbuckets; RamCacheLRUEntry *e = bucket[i].head; while (e) { - if (e->key == *key && e->auxkey1 == old_auxkey1 && e->auxkey2 == old_auxkey2) { - e->auxkey1 = new_auxkey1; - e->auxkey2 = new_auxkey2; + if (e->key == *key && e->auxkey == old_auxkey) { + e->auxkey = new_auxkey; return 1; } e = e->hash_link.next;