]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::BackfillInfo: introduce trim_to
authorSamuel Just <sam.just@inktank.com>
Mon, 28 Oct 2013 22:49:58 +0000 (15:49 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 8 Oct 2014 22:49:38 +0000 (15:49 -0700)
We'll use this to trim off last_backfill_started since it'll
often be included in rescans.

Signed-off-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 8774f03d39b061bc1e811ee8af9d49108f0443c1)

src/osd/PG.h

index 38ca6ad8f4b4d876e7ad35760cb468d645dffe67..d7c06dd42bf451774cbc25fbfd088515aeecffc2 100644 (file)
@@ -469,6 +469,14 @@ protected:
       return end == hobject_t::get_max();
     }
 
+    /// removes items <= soid and adjusts begin to the first object
+    void trim_to(const hobject_t &soid) {
+      trim();
+      while (!objects.empty() && objects.begin()->first <= soid) {
+       pop_front();
+      }
+    }
+
     /// Adjusts begin to the first object
     void trim() {
       if (!objects.empty())