]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG:: filter_snapc: Return immediately if no snapc need to trim 3257/head
authorNing Yao <zay11022@gmail.com>
Fri, 26 Dec 2014 04:20:35 +0000 (04:20 +0000)
committerNing Yao <zay11022@gmail.com>
Fri, 26 Dec 2014 04:20:35 +0000 (04:20 +0000)
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 <zay11022@gmail.com>
src/osd/PG.cc

index 49b7c9d4f5808db969cbb0d95aee0441f91ff6a1..20d71548c0bf0639fdbefe6fae29374eab66e551 100644 (file)
@@ -2999,6 +2999,10 @@ void PG::update_snap_map(
  */
 void PG::filter_snapc(vector<snapid_t> &snaps)
 {
+  //nothing needs to trim, we can return immediately
+  if(snap_trimq.empty() && info.purged_snaps.empty())
+    return;
+
   bool filtering = false;
   vector<snapid_t> newsnaps;
   for (vector<snapid_t>::iterator p = snaps.begin();