From: Samuel Just Date: Fri, 30 Sep 2022 18:12:31 +0000 (-0700) Subject: crimson/osd/pg_shard_manager: introduce invoke_on_each_shard_seq X-Git-Tag: v18.1.0~1068^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c01f8b0ef567f211e8e6bd198c8244b3bde1202;p=ceph.git crimson/osd/pg_shard_manager: introduce invoke_on_each_shard_seq Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/pg_shard_manager.h b/src/crimson/osd/pg_shard_manager.h index 37b98795a8ec..c552356cdc65 100644 --- a/src/crimson/osd/pg_shard_manager.h +++ b/src/crimson/osd/pg_shard_manager.h @@ -227,6 +227,23 @@ public: seastar::future> get_pg_stats() const; + /** + * invoke_method_on_each_shard_seq + * + * Invokes shard_services method on each shard sequentially. + */ + template + seastar::future<> invoke_on_each_shard_seq( + F &&f) const { + return sharded_map_seq( + shard_services, + [f=std::forward(f)](const ShardServices &shard_services) mutable { + return std::invoke( + f, + shard_services); + }); + } + /** * for_each_pg * @@ -235,8 +252,7 @@ public: */ template seastar::future<> for_each_pg(F &&f) const { - return sharded_map_seq( - shard_services, + return invoke_on_each_shard_seq( [f=std::move(f)](const auto &local_service) mutable { for (auto &pg: local_service.local_state.pg_map.get_pgs()) { std::apply(f, pg);