]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: drop pg_pool_t from OpsExecuter ctor
authorAmnon Hanuhov <amnonswe@gmail.com>
Wed, 11 Aug 2021 16:34:55 +0000 (19:34 +0300)
committerAmnon Hanuhov <AmnonSWE@gmail.com>
Fri, 14 Jan 2022 12:13:13 +0000 (14:13 +0200)
OpsExecuter now holds a Ref<PG> so the pool info can be extracted from it
using get_pool().info

Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/crimson/osd/ops_executer.cc
src/crimson/osd/ops_executer.h
src/crimson/osd/pg.cc

index e5f801a99b123e03d1ab6bf15ce65cc802be551c..f947a4fab44b3dcc703271a8d93b948e37ac7774 100644 (file)
@@ -616,6 +616,11 @@ OpsExecuter::execute_op(OSDOp& osd_op)
   }
 }
 
+// Defined here because there is a circular dependency between OpsExecuter and PG
+uint32_t OpsExecuter::get_pool_stripe_width() const {
+  return pg->get_pool().info.get_stripe_width();
+}
+
 static inline std::unique_ptr<const PGLSFilter> get_pgls_filter(
   const std::string& type,
   bufferlist::const_iterator& iter)
index d84d43ad712b85c202f53d2651697e7a3eb39510..d3317d150e27e97d5b1ae009c4a24bd6c513edc2 100644 (file)
@@ -154,7 +154,6 @@ private:
   Ref<PG> pg; // for the sake of object class
   ObjectContextRef obc;
   const OpInfo& op_info;
-  const pg_pool_t& pool_info;  // for the sake of the ObjClass API
   PGBackend& backend;
   ceph::static_ptr<ExecutableMessage,
                    sizeof(ExecutableMessagePimpl<void>)> msg;
@@ -240,13 +239,11 @@ public:
   OpsExecuter(Ref<PG> pg,
               ObjectContextRef obc,
               const OpInfo& op_info,
-              const pg_pool_t& pool_info,
               PGBackend& backend,
               const MsgT& msg)
     : pg(std::move(pg)),
       obc(std::move(obc)),
       op_info(op_info),
-      pool_info(pool_info),
       backend(backend),
       msg(std::in_place_type_t<ExecutableMessagePimpl<MsgT>>{}, &msg) {
   }
@@ -279,9 +276,7 @@ public:
     return num_read + num_write;
   }
 
-  uint32_t get_pool_stripe_width() const {
-    return pool_info.get_stripe_width();
-  }
+  uint32_t get_pool_stripe_width() const;
 
   bool has_seen_write() const {
     return num_write > 0;
index 7fd940f1e76a5733b1fab1a48e4e2f8bd123a601..2e4b0a5300e7a019fe520d463e6b1693ae06a5bb 100644 (file)
@@ -750,7 +750,7 @@ PG::do_osd_ops(
   }
   return do_osd_ops_execute<MURef<MOSDOpReply>>(
     seastar::make_lw_shared<OpsExecuter>(
-      Ref<PG>{this}, std::move(obc), op_info, *m),
+      Ref<PG>{this}, std::move(obc), op_info, get_backend(), *m),
     m->ops,
     op_info,
     [this, m, rvec = op_info.allows_returnvec()] {
@@ -794,7 +794,7 @@ PG::do_osd_ops(
 {
   return do_osd_ops_execute<void>(
     seastar::make_lw_shared<OpsExecuter>(
-      Ref<PG>{this}, std::move(obc), op_info, msg_params),
+      Ref<PG>{this}, std::move(obc), op_info, get_backend(), msg_params),
     ops,
     std::as_const(op_info),
     std::move(success_func),