]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Get the currently atime of the object in cache pool for eviction 2816/head
authorXinze Chi <xmdxcxz@gmail.com>
Wed, 29 Oct 2014 07:11:11 +0000 (07:11 +0000)
committerXinze Chi <xmdxcxz@gmail.com>
Wed, 29 Oct 2014 07:11:11 +0000 (07:11 +0000)
Because if there are mutiple atime in agent_state for the same object, we should use the recently one.

Signed-off-by: Xinze Chi <xmdxcxz@gmail.com>
src/osd/ReplicatedPG.cc

index bfceffa50f2d92274975e5faae985745ba5a4bca..7c33887e3ab2096458f7ef228706e62d2d906cee 100644 (file)
@@ -11911,8 +11911,8 @@ void ReplicatedPG::agent_estimate_atime_temp(const hobject_t& oid,
       return;
   }
   time_t now = ceph_clock_now(NULL).sec();
-  for (map<time_t,HitSetRef>::iterator p = agent_state->hit_set_map.begin();
-       p != agent_state->hit_set_map.end();
+  for (map<time_t,HitSetRef>::iterator p = agent_state->hit_set_map.rbegin();
+       p != agent_state->hit_set_map.rend();
        ++p) {
     if (p->second->contains(oid)) {
       if (*atime < 0)