From: Radoslaw Zarzynski Date: Wed, 31 Mar 2021 17:40:26 +0000 (+0000) Subject: crimson/osd: PG::get_oid() doesn't depend on MOSDOp anymore. X-Git-Tag: v17.1.0~1984^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35b03463dc46620f4f86eb54844347bd7b9580bf;p=ceph.git crimson/osd: PG::get_oid() doesn't depend on MOSDOp anymore. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index be22c72c398..69e5e4b838e 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -848,11 +848,9 @@ PG::interruptible_future> PG::do_pg_ops(Ref m) }); } -hobject_t PG::get_oid(const MOSDOp &m) +hobject_t PG::get_oid(const hobject_t& hobj) { - return (m.get_snapid() == CEPH_SNAPDIR ? - m.get_hobj().get_head() : - m.get_hobj()); + return hobj.snap == CEPH_SNAPDIR ? hobj.get_head() : hobj; } RWState::State PG::get_lock_type(const OpInfo &op_info) @@ -1060,7 +1058,7 @@ PG::with_locked_obc(Ref &m, const OpInfo &op_info, if (__builtin_expect(stopping, false)) { throw crimson::common::system_shutdown_exception(); } - const hobject_t oid = get_oid(*m); + const hobject_t oid = get_oid(m->get_hobj()); switch (get_lock_type(op_info)) { case RWState::RWREAD: if (oid.is_head()) { diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index d7f9b2a88e5..2af1619690d 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -477,7 +477,7 @@ public: void handle_activate_map(PeeringCtx &rctx); void handle_initialize(PeeringCtx &rctx); - static hobject_t get_oid(const MOSDOp &m); + static hobject_t get_oid(const hobject_t& hobj); static RWState::State get_lock_type(const OpInfo &op_info); static std::optional resolve_oid( const SnapSet &snapset,