From: Samuel Just Date: Mon, 28 Oct 2013 22:49:58 +0000 (-0700) Subject: PG::BackfillInfo: introduce trim_to X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0642ca16c6ff6f93186d7aedb6b9d28426c4b3d4;p=ceph.git PG::BackfillInfo: introduce trim_to We'll use this to trim off last_backfill_started since it'll often be included in rescans. Signed-off-by: Samuel Just (cherry picked from commit 8774f03d39b061bc1e811ee8af9d49108f0443c1) --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 38ca6ad8f4b..d7c06dd42bf 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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())