]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: put PGBackend/RecoveryBackend/PGRecovery and other related 64275/head
authorXuehan Xu <xuxuehan@qianxin.com>
Tue, 1 Jul 2025 09:06:16 +0000 (17:06 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 1 Jul 2025 09:06:16 +0000 (17:06 +0800)
classes into the crimson::osd  namespace

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
14 files changed:
src/crimson/osd/ec_backend.cc
src/crimson/osd/ec_backend.h
src/crimson/osd/pg.h
src/crimson/osd/pg_backend.cc
src/crimson/osd/pg_backend.h
src/crimson/osd/pg_recovery.cc
src/crimson/osd/pg_recovery.h
src/crimson/osd/pg_recovery_listener.h
src/crimson/osd/recovery_backend.cc
src/crimson/osd/recovery_backend.h
src/crimson/osd/replicated_backend.cc
src/crimson/osd/replicated_backend.h
src/crimson/osd/replicated_recovery_backend.cc
src/crimson/osd/replicated_recovery_backend.h

index 8325affa859c0d580f94cbd9900e6b8f11be2852..85bcb51e786a5e76108ce08424ea91d708318c1d 100644 (file)
@@ -2,6 +2,8 @@
 
 #include "crimson/osd/shard_services.h"
 
+namespace crimson::osd {
+
 ECBackend::ECBackend(shard_id_t shard,
                      ECBackend::CollectionRef coll,
                      crimson::osd::ShardServices& shard_services,
@@ -35,3 +37,5 @@ ECBackend::submit_transaction(const std::set<pg_shard_t> &pg_shards,
   // todo
   return make_ready_future<rep_op_ret_t>(seastar::now(), seastar::now());
 }
+
+}
index b14c78c9fc4a093324f1e8a718e55017e4f8a45c..b28f7581bec86c021308c8c91719c4bb5cf5dc8a 100644 (file)
@@ -9,6 +9,8 @@
 #include "osd/osd_types.h"
 #include "pg_backend.h"
 
+namespace crimson::osd {
+
 class ECBackend : public PGBackend
 {
 public:
@@ -39,3 +41,5 @@ private:
     return seastar::now();
   }
 };
+
+}
index 643b9ce58dd38419ff790aefb5a3eef489a52a76..74d431a453d4e95ee49c88e39b7f22b47c72c22d 100644 (file)
@@ -47,8 +47,6 @@
 
 class MQuery;
 class OSDMap;
-class PGBackend;
-class ReplicatedBackend;
 class PGPeeringEvent;
 class osd_op_params_t;
 
@@ -68,6 +66,8 @@ namespace crimson::osd {
 class OpsExecuter;
 class SnapTrimEvent;
 class PglogBasedRecovery;
+class PGBackend;
+class ReplicatedBackend;
 
 class PG : public boost::intrusive_ref_counter<
   PG,
@@ -1014,7 +1014,7 @@ private:
 
 private:
   friend class IOInterruptCondition;
-  friend class ::ReplicatedBackend;
+  friend class ReplicatedBackend;
   struct log_update_t {
     std::set<pg_shard_t> waiting_on;
     seastar::shared_promise<> all_committed;
index 42f5f82420218d97c9ad7ad875aa6d3e1eac1e03..b794d349491bc5613122f11676f8bc6cf6a98991 100644 (file)
@@ -43,6 +43,8 @@ using std::string;
 using std::string_view;
 using crimson::common::local_conf;
 
+namespace crimson::osd {
+
 std::unique_ptr<PGBackend>
 PGBackend::create(pg_t pgid,
                  const pg_shard_t pg_shard,
@@ -1854,3 +1856,4 @@ void PGBackend::clone_for_write(
   txn.rmattr(coll->get_cid(), ghobject_t{to}, SS_ATTR);
 }
 
+}
index 07e4aa8ae567a9e371d5ca103900b02e139be99e..3402d31ff4ae21bd918097c07dcaf37b1da1e31b 100644 (file)
@@ -29,10 +29,9 @@ namespace ceph::os {
 }
 
 namespace crimson::osd {
-  class ShardServices;
-  class PG;
-  class ObjectContextLoader;
-}
+class ShardServices;
+class PG;
+class ObjectContextLoader;
 
 class PGBackend
 {
@@ -517,3 +516,5 @@ private:
 
   friend class RecoveryBackend;
 };
+
+}
index 51f9faf18577c4b7827941b4696647fa9766a5bb..b9b67b4881f05013af6dab582e946fcc77739c37 100644 (file)
@@ -22,7 +22,8 @@ SET_SUBSYS(osd);
 
 using std::map;
 using std::set;
-using PglogBasedRecovery = crimson::osd::PglogBasedRecovery;
+
+namespace crimson::osd {
 
 void PGRecovery::start_pglogbased_recovery()
 {
@@ -711,3 +712,5 @@ void PGRecovery::on_backfill_reserved()
   backfill_state->process_event(
     BackfillState::Triggered{}.intrusive_from_this());
 }
+
+}
index f85709c501d07bca49802682b42987b1ea55091a..7cb476e802f0dc604aadf5bd6df0ee3181e75c3a 100644 (file)
 
 #include "osd/object_state.h"
 
+class MOSDPGBackfillRemove;
+
 namespace crimson::osd {
 class UrgentRecovery;
 class PglogBasedRecovery;
-}
-
-class MOSDPGBackfillRemove;
 class PGBackend;
 
 class PGRecovery : public crimson::osd::BackfillState::BackfillListener {
@@ -148,3 +147,5 @@ private:
   friend crimson::osd::PG;
   // backfill end
 };
+
+}
index ab50b99a639fd0e3aaba6e4e3a7cc4cb96ed0313..a6f7f00f965e623cc50ff6343442bf6c6ad4ecd3 100644 (file)
 #include "osd/osd_types.h"
 
 namespace crimson::osd {
-  class ShardServices;
-  class PglogBasedRecovery;
-};
-
+class ShardServices;
+class PglogBasedRecovery;
 class RecoveryBackend;
 class PGRecovery;
 
@@ -45,3 +43,5 @@ public:
   virtual void reset_pglog_based_recovery_op() = 0;
   virtual void schedule_event_after(PGPeeringEventRef evt, float delay) = 0;
 };
+
+}
index 5c25409a80a4cc42027cdff2b7939765f4484ea5..97be44536e816ac3c8b1f6d6f72938028b0fa642 100644 (file)
@@ -16,6 +16,8 @@
 
 SET_SUBSYS(osd);
 
+namespace crimson::osd {
+
 hobject_t RecoveryBackend::get_temp_recovery_object(
   const hobject_t& target,
   eversion_t version) const
@@ -459,3 +461,5 @@ RecoveryBackend::handle_backfill_op(
                                          (uint16_t)m->get_header().type)));
   }
 }
+
+}
index 6198cb11787c58213fa6ad685bdda18d401dbe28..699b31a0e006159468330286a5a260e8517bc544 100644 (file)
@@ -19,9 +19,8 @@
 #include "osd/recovery_types.h"
 #include "osd/osd_types.h"
 
-namespace crimson::osd{
-  class PG;
-}
+namespace crimson::osd {
+class PG;
 
 class RecoveryBackend {
 public:
@@ -306,3 +305,5 @@ private:
     crimson::net::ConnectionXcoreRef conn);
   interruptible_future<> handle_backfill_remove(MOSDPGBackfillRemove& m);
 };
+
+}
index a62ebaae3dd0665c59fddbf5ccd70034188d38d0..e0cf611f9be55f7f1afc0d6178e2005e50ae48b6 100644 (file)
@@ -15,6 +15,8 @@
 
 SET_SUBSYS(osd);
 
+namespace crimson::osd {
+
 ReplicatedBackend::ReplicatedBackend(pg_t pgid,
                                      pg_shard_t whoami,
                                     crimson::osd::PG& pg,
@@ -355,3 +357,5 @@ void ReplicatedBackend::do_pct(const MOSDPGPCT &m)
   DEBUGDPP("{}", dpp, m);
   pg.peering_state.update_pct(m.pg_committed_to);
 }
+
+}
index 43030bd0609d06e73d192f732ff0deee1367acf5..ebaf665b767269f4c5735b894adeabb205cf6590 100644 (file)
@@ -14,9 +14,8 @@
 #include "pg_backend.h"
 
 namespace crimson::osd {
-  class ShardServices;
-  class PG;
-}
+class ShardServices;
+class PG;
 
 class ReplicatedBackend : public PGBackend
 {
@@ -104,3 +103,5 @@ public:
   /// Handle MOSDPGPCT message
   void do_pct(const MOSDPGPCT &m);
 };
+
+}
index 71a1deef575be8188e616eb235de2f42f1994a69..1d280a7e3a7dcb23ec7449281143a8a56b940313 100644 (file)
@@ -19,6 +19,8 @@ using std::less;
 using std::map;
 using std::string;
 
+namespace crimson::osd {
+
 RecoveryBackend::interruptible_future<>
 ReplicatedRecoveryBackend::recover_object(
   const hobject_t& soid,
@@ -1379,3 +1381,5 @@ ReplicatedRecoveryBackend::get_md_from_push_op(PushOp &push_op)
   }
   return std::make_pair(std::move(oi), std::move(ssc));
 }
+
+}
index b46a99b3d3b28647ff50378c6ff14e9d1623b986..5d80cd9d44ababa3498753b30aadd5e13b5c4172 100644 (file)
@@ -15,6 +15,8 @@
 #include "messages/MOSDPGRecoveryDeleteReply.h"
 #include "os/ObjectStore.h"
 
+namespace crimson::osd {
+
 class ReplicatedRecoveryBackend : public RecoveryBackend {
 public:
   ReplicatedRecoveryBackend(crimson::osd::PG& pg,
@@ -179,3 +181,5 @@ private:
   std::pair<object_info_t, crimson::osd::SnapSetContextRef>
   get_md_from_push_op(PushOp &push_op);
 };
+
+}