]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PeeringState: rearrange and fix remaining pg->gen_prefix call
authorSamuel Just <sjust@redhat.com>
Tue, 2 Apr 2019 23:43:31 +0000 (16:43 -0700)
committersjust@redhat.com <sjust@redhat.com>
Wed, 1 May 2019 18:22:23 +0000 (11:22 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PeeringState.cc

index f6bae3585a21318e1e238a2802504638e26c52f5..b466443d71417581084f77ee6e98ef5a154c3667 100644 (file)
@@ -135,6 +135,55 @@ PeeringState::PeeringState(
   machine.initiate();
 }
 
+void PeeringState::start_handle(PeeringCtx *new_ctx) {
+  ceph_assert(!rctx);
+  ceph_assert(!orig_ctx);
+  orig_ctx = new_ctx;
+  if (new_ctx) {
+    if (messages_pending_flush) {
+      rctx = PeeringCtx(*messages_pending_flush, *new_ctx);
+    } else {
+      rctx = *new_ctx;
+    }
+    rctx->start_time = ceph_clock_now();
+  }
+}
+
+void PeeringState::begin_block_outgoing() {
+  ceph_assert(!messages_pending_flush);
+  ceph_assert(orig_ctx);
+  ceph_assert(rctx);
+  messages_pending_flush = BufferedRecoveryMessages();
+  rctx = PeeringCtx(*messages_pending_flush, *orig_ctx);
+}
+
+void PeeringState::clear_blocked_outgoing() {
+  ceph_assert(orig_ctx);
+  ceph_assert(rctx);
+  messages_pending_flush = boost::optional<BufferedRecoveryMessages>();
+}
+
+void PeeringState::end_block_outgoing() {
+  ceph_assert(messages_pending_flush);
+  ceph_assert(orig_ctx);
+  ceph_assert(rctx);
+
+  rctx = PeeringCtx(*orig_ctx);
+  rctx->accept_buffered_messages(*messages_pending_flush);
+  messages_pending_flush = boost::optional<BufferedRecoveryMessages>();
+}
+
+void PeeringState::end_handle() {
+  if (rctx) {
+    utime_t dur = ceph_clock_now() - rctx->start_time;
+    machine.event_time += dur;
+  }
+
+  machine.event_count++;
+  rctx = boost::optional<PeeringCtx>();
+  orig_ctx = NULL;
+}
+
 void PeeringState::check_recovery_sources(const OSDMapRef& osdmap)
 {
   /*
@@ -5171,7 +5220,7 @@ void PeeringState::WaitUpThru::exit()
 
 /*----PeeringState::PeeringMachine Methods-----*/
 #undef dout_prefix
-#define dout_prefix pg->gen_prefix(*_dout)
+#define dout_prefix dpp->gen_prefix(*_dout)
 
 void PeeringState::PeeringMachine::log_enter(const char *state_name)
 {
@@ -5191,56 +5240,3 @@ void PeeringState::PeeringMachine::log_exit(const char *state_name, utime_t ente
   event_time = utime_t();
 }
 
-
-/*---------------------------------------------------*/
-#undef dout_prefix
-#define dout_prefix ((debug_pg ? debug_pg->gen_prefix(*_dout) : *_dout) << " PriorSet: ")
-
-void PeeringState::start_handle(PeeringCtx *new_ctx) {
-  ceph_assert(!rctx);
-  ceph_assert(!orig_ctx);
-  orig_ctx = new_ctx;
-  if (new_ctx) {
-    if (messages_pending_flush) {
-      rctx = PeeringCtx(*messages_pending_flush, *new_ctx);
-    } else {
-      rctx = *new_ctx;
-    }
-    rctx->start_time = ceph_clock_now();
-  }
-}
-
-void PeeringState::begin_block_outgoing() {
-  ceph_assert(!messages_pending_flush);
-  ceph_assert(orig_ctx);
-  ceph_assert(rctx);
-  messages_pending_flush = BufferedRecoveryMessages();
-  rctx = PeeringCtx(*messages_pending_flush, *orig_ctx);
-}
-
-void PeeringState::clear_blocked_outgoing() {
-  ceph_assert(orig_ctx);
-  ceph_assert(rctx);
-  messages_pending_flush = boost::optional<BufferedRecoveryMessages>();
-}
-
-void PeeringState::end_block_outgoing() {
-  ceph_assert(messages_pending_flush);
-  ceph_assert(orig_ctx);
-  ceph_assert(rctx);
-
-  rctx = PeeringCtx(*orig_ctx);
-  rctx->accept_buffered_messages(*messages_pending_flush);
-  messages_pending_flush = boost::optional<BufferedRecoveryMessages>();
-}
-
-void PeeringState::end_handle() {
-  if (rctx) {
-    utime_t dur = ceph_clock_now() - rctx->start_time;
-    machine.event_time += dur;
-  }
-
-  machine.event_count++;
-  rctx = boost::optional<PeeringCtx>();
-  orig_ctx = NULL;
-}