]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: correct type of callback func 33233/head
authorKefu Chai <kchai@redhat.com>
Wed, 12 Feb 2020 08:12:38 +0000 (16:12 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 12 Feb 2020 08:33:22 +0000 (16:33 +0800)
`md_config_obs_t` is defined as
```
using md_config_obs_t = ceph::md_config_obs_impl<ConfigProxy>;
```
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<ceph::ConfigProxy>` or
`ceph::md_config_obs_impl<crimson::common::ConfigProxy>` 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 <kchai@redhat.com>
src/crimson/common/config_proxy.h

index 0f78e42e6fe68679f0eb4240dcb588eecf662bdc..ba2c6ec01153abd9f67bb2999161ed857e784c16 100644 (file)
@@ -67,10 +67,9 @@ class ConfigProxy : public seastar::peering_sharded_service<ConfigProxy>
 
             ObserverMgr<ConfigObserver>::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);
             }