diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc index 5e32aed8a30..8ea41251bba 100644 --- a/iocore/cache/CacheWrite.cc +++ b/iocore/cache/CacheWrite.cc @@ -680,7 +680,7 @@ Vol::evacuateDocReadDone(int event, Event *e) if (!b) { goto Ldone; } - if ((b->f.pinned && !b->readers) && doc->pinned < static_cast(Thread::get_hrtime() / HRTIME_SECOND)) { + if ((b->f.pinned && !b->readers) && doc->pinned < static_cast(Thread::get_hrtime() / HRTIME_SECOND)) { goto Ldone; } @@ -817,7 +817,7 @@ agg_copy(char *p, CacheVC *vc) doc->checksum = DOC_NO_CHECKSUM; if (vc->pin_in_cache) { dir_set_pinned(&vc->dir, 1); - doc->pinned = static_cast(Thread::get_hrtime() / HRTIME_SECOND) + vc->pin_in_cache; + doc->pinned = static_cast(Thread::get_hrtime() / HRTIME_SECOND) + vc->pin_in_cache; } else { dir_set_pinned(&vc->dir, 0); doc->pinned = 0; @@ -1720,7 +1720,7 @@ Cache::open_write(Continuation *cont, const CacheKey *key, CacheFragType frag_ty c->f.overwrite = (options & CACHE_WRITE_OPT_OVERWRITE) != 0; c->f.close_complete = (options & CACHE_WRITE_OPT_CLOSE_COMPLETE) != 0; c->f.sync = (options & CACHE_WRITE_OPT_SYNC) == CACHE_WRITE_OPT_SYNC; - c->pin_in_cache = static_cast(apin_in_cache); + c->pin_in_cache = apin_in_cache; if ((res = c->vol->open_write_lock(c, false, 1)) > 0) { // document currently being written, abort @@ -1820,7 +1820,7 @@ Cache::open_write(Continuation *cont, const CacheKey *key, CacheHTTPInfo *info, c->base_stat = cache_write_active_stat; } CACHE_INCREMENT_DYN_STAT(c->base_stat + CACHE_STAT_ACTIVE); - c->pin_in_cache = static_cast(apin_in_cache); + c->pin_in_cache = apin_in_cache; { CACHE_TRY_LOCK(lock, c->vol->mutex, cont->mutex->thread_holding); diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h index 91f49936935..fd6b2867941 100644 --- a/iocore/cache/P_CacheInternal.h +++ b/iocore/cache/P_CacheInternal.h @@ -465,7 +465,7 @@ struct CacheVC : public CacheVConnection { Event *trigger; CacheKey *read_key; ContinuationHandler save_handler; - uint32_t pin_in_cache; + time_t pin_in_cache; ink_hrtime start_time; int base_stat; int recursive; diff --git a/iocore/cache/P_CacheVol.h b/iocore/cache/P_CacheVol.h index 544b1d86fbb..be066923dcc 100644 --- a/iocore/cache/P_CacheVol.h +++ b/iocore/cache/P_CacheVol.h @@ -298,8 +298,8 @@ struct Doc { uint32_t unused : 8; ///< Unused, forced to zero. uint32_t sync_serial; uint32_t write_serial; - uint32_t pinned; // pinned until uint32_t checksum; + time_t pinned; // pinned until #if TS_ENABLE_FIPS == 1 CryptoHash key; ///< Key for this doc. #endif