From: Kefu Chai Date: Wed, 12 Feb 2020 08:12:38 +0000 (+0800) Subject: crimson/common: correct type of callback func X-Git-Tag: v15.1.1~456^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=42acd76579d057b353c8c25194e55a295c782308;p=ceph.git 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 --- diff --git a/src/crimson/common/config_proxy.h b/src/crimson/common/config_proxy.h index 0f78e42e6fe6..ba2c6ec01153 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); }