diff options
author | Matan Breizman <mbreizma@redhat.com> | 2024-01-24 11:22:00 +0100 |
---|---|---|
committer | Matan Breizman <mbreizma@redhat.com> | 2024-01-24 11:58:26 +0100 |
commit | 384f6532d3a9052b26b79763cd7a0f14ea9030c1 (patch) | |
tree | ded36e98f01dd47a8066b412ec96e5b3fe1698e5 | |
parent | crimson/osd/pg_map: move maybe_create_pg and remove pg form header (diff) | |
download | ceph-384f6532d3a9052b26b79763cd7a0f14ea9030c1.tar.xz ceph-384f6532d3a9052b26b79763cd7a0f14ea9030c1.zip |
crimson/osd:pg_map: rename create or remove pg
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
-rw-r--r-- | src/crimson/osd/pg_map.cc | 4 | ||||
-rw-r--r-- | src/crimson/osd/pg_map.h | 8 | ||||
-rw-r--r-- | src/crimson/osd/pg_shard_manager.cc | 2 | ||||
-rw-r--r-- | src/crimson/osd/pg_shard_manager.h | 2 | ||||
-rw-r--r-- | src/crimson/osd/shard_services.h | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/crimson/osd/pg_map.cc b/src/crimson/osd/pg_map.cc index 5c99b82dc9d..a9f1ef12230 100644 --- a/src/crimson/osd/pg_map.cc +++ b/src/crimson/osd/pg_map.cc @@ -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()); diff --git a/src/crimson/osd/pg_map.h b/src/crimson/osd/pg_map.h index a4a0a6dfb72..2ea3f239b9b 100644 --- a/src/crimson/osd/pg_map.h +++ b/src/crimson/osd/pg_map.h @@ -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(); } diff --git a/src/crimson/osd/pg_shard_manager.cc b/src/crimson/osd/pg_shard_manager.cc index 1980b36271c..a32a1581adc 100644 --- a/src/crimson/osd/pg_shard_manager.cc +++ b/src/crimson/osd/pg_shard_manager.cc @@ -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( diff --git a/src/crimson/osd/pg_shard_manager.h b/src/crimson/osd/pg_shard_manager.h index 1559dde0cb1..a3f0c8b7cc5 100644 --- a/src/crimson/osd/pg_shard_manager.h +++ b/src/crimson/osd/pg_shard_manager.h @@ -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); diff --git a/src/crimson/osd/shard_services.h b/src/crimson/osd/shard_services.h index fbfe0e55c00..57dff9d2ee3 100644 --- a/src/crimson/osd/shard_services.h +++ b/src/crimson/osd/shard_services.h @@ -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() { |