From: Xinze Chi Date: Wed, 29 Oct 2014 07:11:11 +0000 (+0000) Subject: Get the currently atime of the object in cache pool for eviction X-Git-Tag: v0.89~72^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1fef4c3d541cba360738437420ebfa2447d5802e;p=ceph.git Get the currently atime of the object in cache pool for eviction Because if there are mutiple atime in agent_state for the same object, we should use the recently one. Signed-off-by: Xinze Chi --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index bfceffa50f2d9..7c33887e3ab20 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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::iterator p = agent_state->hit_set_map.begin(); - p != agent_state->hit_set_map.end(); + for (map::iterator p = agent_state->hit_set_map.rbegin(); + p != agent_state->hit_set_map.rend(); ++p) { if (p->second->contains(oid)) { if (*atime < 0)