]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd:pg_map: rename create or remove pg
authorMatan Breizman <mbreizma@redhat.com>
Wed, 24 Jan 2024 10:22:00 +0000 (10:22 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 24 Jan 2024 10:58:26 +0000 (10:58 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/pg_map.cc
src/crimson/osd/pg_map.h
src/crimson/osd/pg_shard_manager.cc
src/crimson/osd/pg_shard_manager.h
src/crimson/osd/shard_services.h

index 5c99b82dc9dc1e3f5a4b5b93247eb37f42ebeae0..a9f1ef12230d56e9ff9406b0e5caa8a86f181c1b 100644 (file)
@@ -16,7 +16,7 @@ using std::make_pair;
 
 namespace crimson::osd {
 
-seastar::future<core_id_t> PGShardMapping::maybe_create_pg(
+seastar::future<core_id_t> PGShardMapping::get_or_create_pg_mapping(
   spg_t pgid,
   core_id_t core)
 {
@@ -61,7 +61,7 @@ seastar::future<core_id_t> PGShardMapping::maybe_create_pg(
   }
 }
 
-seastar::future<> PGShardMapping::remove_pg(spg_t pgid) {
+seastar::future<> PGShardMapping::remove_pg_mapping(spg_t pgid) {
   return container().invoke_on(0, [pgid](auto &primary_mapping) {
     auto iter = primary_mapping.pg_to_core.find(pgid);
     ceph_assert_always(iter != primary_mapping.pg_to_core.end());
index a4a0a6dfb72684635bf4e25f99241310c8d51152..2ea3f239b9b66ea7da60760acf7369d219d74ec5 100644 (file)
@@ -23,7 +23,7 @@ class PG;
  *
  * Maintains a mapping from spg_t to the core containing that PG.  Internally, each
  * core has a local copy of the mapping to enable core-local lookups.  Updates
- * are proxied to core 0, and the back out to all other cores -- see maybe_create_pg.
+ * are proxied to core 0, and the back out to all other cores -- see get_or_create_pg_mapping.
  */
 class PGShardMapping : public seastar::peering_sharded_service<PGShardMapping> {
 public:
@@ -35,12 +35,12 @@ public:
   }
 
   /// Returns mapping for pgid, creates new one if it doesn't already exist
-  seastar::future<core_id_t> maybe_create_pg(
+  seastar::future<core_id_t> get_or_create_pg_mapping(
     spg_t pgid,
     core_id_t core = NULL_CORE);
 
-  /// Remove pgid
-  seastar::future<> remove_pg(spg_t pgid);
+  /// Remove pgid mapping
+  seastar::future<> remove_pg_mapping(spg_t pgid);
 
   size_t get_num_pgs() const { return pg_to_core.size(); }
 
index 1980b36271c2db4b89115a682b021f30dbb483be..a32a1581adcdfbc737ac026e3a11a180f46efba4 100644 (file)
@@ -23,7 +23,7 @@ seastar::future<> PGShardManager::load_pgs(crimson::os::FuturizedStore& store)
         auto[coll, shard_core] = coll_core;
        spg_t pgid;
        if (coll.is_pg(&pgid)) {
-          return get_pg_to_shard_mapping().maybe_create_pg(
+          return get_pg_to_shard_mapping().get_or_create_pg_mapping(
             pgid, shard_core
           ).then([this, pgid] (auto core) {
             return this->template with_remote_shard_state(
index 1559dde0cb1b3519291b20e0aeb4ca4f51014a26..a3f0c8b7cc57eb05c111324e1c6b6d0424c3c168 100644 (file)
@@ -373,7 +373,7 @@ public:
       return opref.template enter_stage<>(
        opref.get_connection_pipeline().get_pg_mapping);
     }).then([this, &opref] {
-      return get_pg_to_shard_mapping().maybe_create_pg(opref.get_pgid());
+      return get_pg_to_shard_mapping().get_or_create_pg_mapping(opref.get_pgid());
     }).then_wrapped([this, &logger, op=std::move(op)](auto fut) mutable {
       if (unlikely(fut.failed())) {
         logger.error("{}: failed before with_pg", *op);
index fbfe0e55c001f1d160ea8eb36e07e5dfac22e41d..57dff9d2ee3e59dd2836367122f2e9ed5349f0b6 100644 (file)
@@ -404,7 +404,7 @@ public:
 
   auto remove_pg(spg_t pgid) {
     local_state.pg_map.remove_pg(pgid);
-    return pg_to_shard_mapping.remove_pg(pgid);
+    return pg_to_shard_mapping.remove_pg_mapping(pgid);
   }
 
   crimson::common::CephContext *get_cct() {