]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add and use operator<< for BackfillInterval
authorSage Weil <sage@redhat.com>
Thu, 23 Jul 2015 20:28:36 +0000 (16:28 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:05 +0000 (10:16 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc

index 848a63a6f27446a14235a5e71b2be95973d5f9b2..be9a5489d2bba2956f51c2ad2ce91f7c5e5e03f1 100644 (file)
@@ -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"); }
 
index 5df74b07e73e8cb9a216d2a8c09c9c5c7f6e8df7..e907ac7dda6272cc1a6adf5bee40afa3e2f17993 100644 (file)
@@ -640,7 +640,6 @@ public:
   set<int> heartbeat_peers;
   set<int> probe_targets;
 
-protected:
   /**
    * BackfillInterval
    *
@@ -717,7 +716,8 @@ protected:
       f->close_section();
     }
   };
-  
+
+protected:
   BackfillInterval backfill_info;
   map<pg_shard_t, BackfillInterval> 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
index 8fcecd5af9f2952037b8208fc9082f7ceedbb622..26d094c15de8b755cdb786c04eef9d85fd8f23aa 100644 (file)
@@ -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<pg_shard_t>::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;