From: Radoslaw Zarzynski Date: Wed, 24 Oct 2018 19:08:40 +0000 (+0200) Subject: core: avoid get_epoch()-driven refcounting on OSDMap in PrimaryLogPG. X-Git-Tag: 3.2-0~80^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf1d99bbdcac2eac13050e657dd92d9f7bcdd17f;p=ceph-ci.git core: avoid get_epoch()-driven refcounting on OSDMap in PrimaryLogPG. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 35d92c53aa7..c4207ed5788 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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); diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 5a2968c791e..e47b711a1c8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -134,7 +134,7 @@ public: GenContext *PrimaryLogPG::bless_gencontext( GenContext *c) { return new BlessedGenContext( - this, c, get_osdmap()->get_epoch()); + this, c, get_osdmap_epoch()); } template @@ -161,7 +161,7 @@ public: GenContext *PrimaryLogPG::bless_unlocked_gencontext( GenContext *c) { return new UnlockedBlessedGenContext( - 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); }