]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: use apply_ctx_stats() everywhere 5725/head
authorSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 01:39:55 +0000 (21:39 -0400)
committerSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 01:40:02 +0000 (21:40 -0400)
We were open-coding the stats update in several places, and
getting it wrong in most of them.  Use a single helper to do it.
Note that any repop must *either* call apply_ctx_stats() or
finish_ctx() (which calls it for you).

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc

index c254ad5881a4977aef3c89ccd6da0cc4134800e8..09a5bf4068b59d93fcf319f139991c88269476ca 100644 (file)
@@ -8154,6 +8154,8 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch)
     ctx->log.back().mod_desc.mark_unrollbackable();
   }
 
+  // no ctx->delta_stats
+
   // obc ref swallowed by repop!
   simple_repop_submit(repop);
 
@@ -10702,7 +10704,7 @@ void ReplicatedPG::hit_set_remove_all()
     utime_t now = ceph_clock_now(cct);
     ctx->mtime = now;
     hit_set_trim(repop, 0);
-    info.stats.stats.add(ctx->delta_stats);
+    apply_ctx_stats(ctx);
     simple_repop_submit(repop);
   }
 
@@ -10923,12 +10925,7 @@ void ReplicatedPG::hit_set_persist()
 
   hit_set_trim(repop, max);
 
-  info.stats.stats.add(ctx->delta_stats);
-  if (scrubber.active) {
-    if (cmp(oid, scrubber.start, get_sort_bitwise()) < 0)
-      scrub_cstat.add(ctx->delta_stats);
-  }
-
+  apply_ctx_stats(ctx);
   simple_repop_submit(repop);
 }
 
@@ -12167,13 +12164,14 @@ boost::statechart::result ReplicatedPG::TrimmingObjects::react(const SnapTrim&)
     assert(repop);
     repop->queue_snap_trimmer = true;
 
-    info.stats.stats.add(ctx->delta_stats);
+    pg->apply_ctx_stats(repop->ctx);
 
     repops.insert(repop->get());
     pg->simple_repop_submit(repop);
   }
   return discard_event();
 }
+
 /* WaitingOnReplicasObjects */
 ReplicatedPG::WaitingOnReplicas::WaitingOnReplicas(my_context ctx)
   : my_base(ctx),