]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
core: avoid get_epoch()-driven refcounting on OSDMap in PrimaryLogPG.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 24 Oct 2018 19:08:40 +0000 (21:08 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 24 Oct 2018 19:14:48 +0000 (21:14 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/osd/PG.h
src/osd/PrimaryLogPG.cc

index 35d92c53aa79d32ca78a9a2d422fe580c40af9c7..c4207ed578858c816f326de2da8be90c2d667b95 100644 (file)
@@ -2974,7 +2974,7 @@ protected:
     return e <= cur_epoch;
   }
   bool have_same_or_newer_map(epoch_t e) {
-    return e <= get_osdmap()->get_epoch();
+    return e <= get_osdmap_epoch();
   }
 
   bool op_has_sufficient_caps(OpRequestRef& op);
index 5a2968c791e898d57b1fb23f9a29c0af48dc57dd..e47b711a1c8742d9b124ac5b84123d4f15e0e769 100644 (file)
@@ -134,7 +134,7 @@ public:
 GenContext<ThreadPool::TPHandle&> *PrimaryLogPG::bless_gencontext(
   GenContext<ThreadPool::TPHandle&> *c) {
   return new BlessedGenContext<ThreadPool::TPHandle&>(
-    this, c, get_osdmap()->get_epoch());
+    this, c, get_osdmap_epoch());
 }
 
 template <typename T>
@@ -161,7 +161,7 @@ public:
 GenContext<ThreadPool::TPHandle&> *PrimaryLogPG::bless_unlocked_gencontext(
   GenContext<ThreadPool::TPHandle&> *c) {
   return new UnlockedBlessedGenContext<ThreadPool::TPHandle&>(
-    this, c, get_osdmap()->get_epoch());
+    this, c, get_osdmap_epoch());
 }
 
 class PrimaryLogPG::BlessedContext : public Context {
@@ -187,7 +187,7 @@ public:
 };
 
 Context *PrimaryLogPG::bless_context(Context *c) {
-  return new BlessedContext(this, c, get_osdmap()->get_epoch());
+  return new BlessedContext(this, c, get_osdmap_epoch());
 }
 
 class PrimaryLogPG::C_PG_ObjectContext : public Context {
@@ -3940,7 +3940,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
 
   bool successful_write = !ctx->op_t->empty() && op->may_write() && result >= 0;
   // prepare the reply
-  ctx->reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(), 0,
+  ctx->reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0,
                               successful_write);
 
   // Write operations aren't allowed to return a data payload because
@@ -4028,7 +4028,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
        if (reply)
          ctx->reply = nullptr;
        else {
-         reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(), 0, true);
+         reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, true);
          reply->set_reply_versions(ctx->at_version,
                                    ctx->user_at_version);
        }