From: Sage Weil Date: Tue, 24 Sep 2019 18:28:05 +0000 (-0500) Subject: osd/PrimaryLogPG: do_pg_ops make MOSDOp const, fix comment X-Git-Tag: v15.1.0~1384^2~14 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=89d7418d905b82ff1356bbf60302bdb24dcf9d11;p=ceph-ci.git osd/PrimaryLogPG: do_pg_ops make MOSDOp const, fix comment Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 3f4222277c7..44c6f3a9533 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -985,9 +985,7 @@ int PrimaryLogPG::do_command( void PrimaryLogPG::do_pg_op(OpRequestRef op) { - // NOTE: this is non-const because we modify the OSDOp.outdata in - // place - MOSDOp *m = static_cast(op->get_nonconst_req()); + const MOSDOp *m = static_cast(op->get_req()); ceph_assert(m->get_type() == CEPH_MSG_OSD_OP); dout(10) << "do_pg_op " << *m << dendl; @@ -1376,7 +1374,7 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op) osd->send_message_osd_client(reply, m->get_connection()); } -int PrimaryLogPG::do_scrub_ls(MOSDOp *m, OSDOp *osd_op) +int PrimaryLogPG::do_scrub_ls(const MOSDOp *m, OSDOp *osd_op) { if (m->get_pg() != info.pgid.pgid) { dout(10) << " scrubls pg=" << m->get_pg() << " != " << info.pgid << dendl; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index c5d05615092..b0e111d9378 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -1526,7 +1526,7 @@ public: void do_osd_op_effects(OpContext *ctx, const ConnectionRef& conn); private: - int do_scrub_ls(MOSDOp *op, OSDOp *osd_op); + int do_scrub_ls(const MOSDOp *op, OSDOp *osd_op); hobject_t earliest_backfill() const; bool check_src_targ(const hobject_t& soid, const hobject_t& toid) const;