]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: PG::get_oid() doesn't depend on MOSDOp anymore.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 31 Mar 2021 17:40:26 +0000 (17:40 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 10 May 2021 16:03:55 +0000 (18:03 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index be22c72c398d5d11bd2c1745b85f77b842a2c07e..69e5e4b838ee07fb80775596446e5e8aef3cda9d 100644 (file)
@@ -848,11 +848,9 @@ PG::interruptible_future<Ref<MOSDOpReply>> PG::do_pg_ops(Ref<MOSDOp> 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<MOSDOp> &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()) {
index d7f9b2a88e5298bcd46b3e4935c3f1cc13adf482..2af1619690d164446203703303f2a9ae583e43cf 100644 (file)
@@ -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<hobject_t> resolve_oid(
     const SnapSet &snapset,