From: Ning Yao Date: Fri, 26 Dec 2014 04:20:35 +0000 (+0000) Subject: PG:: filter_snapc: Return immediately if no snapc need to trim X-Git-Tag: v0.92~92^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3257%2Fhead;p=ceph.git PG:: filter_snapc: Return immediately if no snapc need to trim we can return immediately if no snapc need to trim. Do not iterater snapc vector and do extra judgement and ops. Signed-off-by: Ning Yao --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 49b7c9d4f580..20d71548c0bf 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2999,6 +2999,10 @@ void PG::update_snap_map( */ void PG::filter_snapc(vector &snaps) { + //nothing needs to trim, we can return immediately + if(snap_trimq.empty() && info.purged_snaps.empty()) + return; + bool filtering = false; vector newsnaps; for (vector::iterator p = snaps.begin();