]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: Moving shard_services to PGBackend 46217/head
authorMatan Breizman <mbreizma@redhat.com>
Tue, 10 May 2022 11:11:48 +0000 (11:11 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 10 May 2022 14:16:05 +0000 (14:16 +0000)
ec and replicated backends are derived from PGBackend,
shard_services should be a member of the base class.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/ec_backend.cc
src/crimson/osd/pg_backend.cc
src/crimson/osd/pg_backend.h
src/crimson/osd/replicated_backend.cc
src/crimson/osd/replicated_backend.h

index 9ea0d1e6564a16ffe426dd7010d9de04773ebe9c..88411096f077cec10ed30d686ae8ef3823982f3c 100644 (file)
@@ -7,7 +7,7 @@ ECBackend::ECBackend(shard_id_t shard,
                      crimson::osd::ShardServices& shard_services,
                      const ec_profile_t&,
                      uint64_t)
-  : PGBackend{shard, coll, &shard_services.get_store()}
+  : PGBackend{shard, coll, shard_services}
 {
   // todo
 }
index 5dd3ec2caa26c3cf9c1bd89e0b3d59dc406f1851..829b8ea07c93027b3e6879cac8d8536e46ef3d7a 100644 (file)
@@ -61,10 +61,11 @@ PGBackend::create(pg_t pgid,
 
 PGBackend::PGBackend(shard_id_t shard,
                      CollectionRef coll,
-                     crimson::os::FuturizedStore* store)
+                     crimson::osd::ShardServices &shard_services)
   : shard{shard},
     coll{coll},
-    store{store}
+    shard_services{shard_services},
+    store{&shard_services.get_store()}
 {}
 
 PGBackend::load_metadata_iertr::future
index 8bd9526e6d29bed9828a78b89875fcc482e8ff3e..40a1d4cdb66aca5e2723f9fe0f55612f38270a79 100644 (file)
@@ -63,7 +63,8 @@ public:
   using rep_op_fut_t =
     std::tuple<interruptible_future<>,
               interruptible_future<crimson::osd::acked_peers_t>>;
-  PGBackend(shard_id_t shard, CollectionRef coll, crimson::os::FuturizedStore* store);
+  PGBackend(shard_id_t shard, CollectionRef coll,
+            crimson::osd::ShardServices &shard_services);
   virtual ~PGBackend() = default;
   static std::unique_ptr<PGBackend> create(pg_t pgid,
                                           const pg_shard_t pg_shard,
@@ -337,6 +338,7 @@ public:
 protected:
   const shard_id_t shard;
   CollectionRef coll;
+  crimson::osd::ShardServices &shard_services;
   crimson::os::FuturizedStore* store;
   bool stopping = false;
   std::optional<peering_info_t> peering;
index 7cc0a6c8eb5ae5570c00cf2b20566b804dfc1f46..0802ec5abc4715ab8a93f7c1c3d341c0a8c9a43d 100644 (file)
@@ -21,10 +21,9 @@ ReplicatedBackend::ReplicatedBackend(pg_t pgid,
                                      pg_shard_t whoami,
                                      ReplicatedBackend::CollectionRef coll,
                                      crimson::osd::ShardServices& shard_services)
-  : PGBackend{whoami.shard, coll, &shard_services.get_store()},
+  : PGBackend{whoami.shard, coll, shard_services},
     pgid{pgid},
-    whoami{whoami},
-    shard_services{shard_services}
+    whoami{whoami}
 {}
 
 ReplicatedBackend::ll_read_ierrorator::future<ceph::bufferlist>
index b768fed717b7db1534320ec41e94d5e78e161538..fce98fbd0c62a6516954c422f78a0a914ab56120 100644 (file)
@@ -37,7 +37,6 @@ private:
     std::vector<pg_log_entry_t>&& log_entries) final;
   const pg_t pgid;
   const pg_shard_t whoami;
-  crimson::osd::ShardServices& shard_services;
   ceph_tid_t next_txn_id = 0;
   class pending_on_t : public seastar::weakly_referencable<pending_on_t> {
   public: