From: Sage Weil Date: Thu, 23 Jul 2015 20:28:36 +0000 (-0400) Subject: osd: add and use operator<< for BackfillInterval X-Git-Tag: v9.1.0~346^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d90cc26b11374552fdafd70c36a360efee6cc7f0;p=ceph.git osd: add and use operator<< for BackfillInterval Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 848a63a6f274..be9a5489d2bb 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -7685,6 +7685,16 @@ void PG::RecoveryState::end_handle() { orig_ctx = NULL; } +ostream& operator<<(ostream& out, const PG::BackfillInterval& bi) +{ + out << "BackfillInfo(" << bi.begin << "-" << bi.end + << " " << bi.objects.size() << " objects"; + if (!bi.objects.empty()) + out << " " << bi.objects; + out << ")"; + return out; +} + void intrusive_ptr_add_ref(PG *pg) { pg->get("intptr"); } void intrusive_ptr_release(PG *pg) { pg->put("intptr"); } diff --git a/src/osd/PG.h b/src/osd/PG.h index 5df74b07e73e..e907ac7dda62 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -640,7 +640,6 @@ public: set heartbeat_peers; set probe_targets; -protected: /** * BackfillInterval * @@ -717,7 +716,8 @@ protected: f->close_section(); } }; - + +protected: BackfillInterval backfill_info; map peer_backfill_info; bool backfill_reserved; @@ -2295,4 +2295,6 @@ public: ostream& operator<<(ostream& out, const PG& pg); +ostream& operator<<(ostream& out, const PG::BackfillInterval& bi); + #endif diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 8fcecd5af9f2..26d094c15de8 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -9701,10 +9701,7 @@ int ReplicatedPG::recover_backfill( backfill_pos = MIN_HOBJ(backfill_info.begin, earliest_peer_backfill(), get_sort_bitwise()); - dout(20) << " my backfill interval " << backfill_info.begin << "-" << backfill_info.end - << " " << backfill_info.objects.size() << " objects" - << " " << backfill_info.objects - << dendl; + dout(20) << " my backfill interval " << backfill_info << dendl; bool sent_scan = false; for (set::iterator i = backfill_targets.begin(); @@ -9713,8 +9710,7 @@ int ReplicatedPG::recover_backfill( pg_shard_t bt = *i; BackfillInterval& pbi = peer_backfill_info[bt]; - dout(20) << " peer shard " << bt << " backfill " << pbi.begin << "-" - << pbi.end << " " << pbi.objects << dendl; + dout(20) << " peer shard " << bt << " backfill " << pbi << dendl; if (cmp(pbi.begin, backfill_info.begin, get_sort_bitwise()) <= 0 && !pbi.extends_to_end() && pbi.empty()) { dout(10) << " scanning peer osd." << bt << " from " << pbi.end << dendl;