From 42acd76579d057b353c8c25194e55a295c782308 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 12 Feb 2020 16:12:38 +0800 Subject: [PATCH] crimson/common: correct type of callback func `md_config_obs_t` is defined as ``` using md_config_obs_t = ceph::md_config_obs_impl; ``` in `common/config_obs.h`. it takes advantage of a fact that somebody exposes the correct version of `ConfigProxy` to the global namespace. this is intended to fulfill the needs of other components which expects `md_config_obs_t`. otherwise we need to specify `ceph::md_config_obs_impl` or `ceph::md_config_obs_impl` depending on if we are programming crimson or not. but in this case, we are actually defining `crimson::common::ConfigProxy`, so it'd be better to define `md_config_obs_t` explicitly instead relying on "somebody" which exposes `ConfigProxy`. and `ConfigObserver` is defined using the current `ConfigProxy`, so it's more correct and more readable than using `md_config_obs_t` defined in `common/config_obs.h`. Signed-off-by: Kefu Chai --- src/crimson/common/config_proxy.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/crimson/common/config_proxy.h b/src/crimson/common/config_proxy.h index 0f78e42e6fe..ba2c6ec0115 100644 --- a/src/crimson/common/config_proxy.h +++ b/src/crimson/common/config_proxy.h @@ -67,10 +67,9 @@ class ConfigProxy : public seastar::peering_sharded_service ObserverMgr::rev_obs_map rev_obs; proxy.obs_mgr.for_each_change(proxy.values->changed, proxy, - [&rev_obs](md_config_obs_t *obs, - const std::string &key) { - rev_obs[obs].insert(key); - }, nullptr); + [&rev_obs](ConfigObserver *obs, const std::string& key) { + rev_obs[obs].insert(key); + }, nullptr); for (auto& obs_keys : rev_obs) { obs_keys.first->handle_conf_change(proxy, obs_keys.second); } -- 2.39.5