]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: create apply_ctx_stats() helper
authorSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 01:33:25 +0000 (21:33 -0400)
committerSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 01:40:01 +0000 (21:40 -0400)
finish_ctx does a dance to update the pg stats correctly despite
racing scrub or backfill; move this into a helper.

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

index 2c12e72bb2b0df93f1f5b1b13d6500b9f5bcf625..c254ad5881a4977aef3c89ccd6da0cc4134800e8 100644 (file)
@@ -6244,8 +6244,14 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc
     ctx->obc->ssc->snapset = ctx->new_snapset;
   }
 
+  apply_ctx_stats(ctx, scrub_ok);
+}
+
+void ReplicatedPG::apply_ctx_stats(OpContext *ctx, bool scrub_ok)
+{
   info.stats.stats.add(ctx->delta_stats);
 
+  const hobject_t& soid = ctx->obs->oi.soid;
   for (set<pg_shard_t>::iterator i = backfill_targets.begin();
        i != backfill_targets.end();
        ++i) {
index 4517e68730ebb1bdefba691c8cd4119708953fa1..a2802b2ecdef2148991a1d9a9ce64c2dfbc5dd23 100644 (file)
@@ -1157,6 +1157,8 @@ protected:
   void reply_ctx(OpContext *ctx, int err, eversion_t v, version_t uv);
   void make_writeable(OpContext *ctx);
   void log_op_stats(OpContext *ctx);
+  void apply_ctx_stats(OpContext *ctx,
+                      bool scrub_ok=false); ///< true if we should skip scrub stat update
 
   void write_update_size_and_usage(object_stat_sum_t& stats, object_info_t& oi,
                                   interval_set<uint64_t>& modified, uint64_t offset,