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.87.2~11^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=55541b90db0a6d6c26c1fae6a4958fa5a320f82c;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 (cherry picked from commit 1fef4c3d541cba360738437420ebfa2447d5802e) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b9edd70f44be..1ad6a67e2590 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -11914,8 +11914,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)