Skip to content

Commit 8e9b08e

Browse files
committed
librbd/ConfigWatcher: replace obsolete get_tracked_conf_keys()
.. with get_tracked_keys(). Following ceph#61394, all uses of the deprecated interface will be updated, and that old interface will be removed. Signed-off-by: Ronen Friedman <[email protected]>
1 parent 3290433 commit 8e9b08e

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/librbd/ConfigWatcher.cc

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,28 @@ template <typename I>
2626
struct ConfigWatcher<I>::Observer : public md_config_obs_t {
2727
ConfigWatcher<I>* m_config_watcher;
2828

29-
std::deque<std::string> m_config_key_strs;
30-
mutable std::vector<const char*> m_config_keys;
29+
std::vector<std::string> m_config_key_strs;
3130

3231
Observer(CephContext* cct, ConfigWatcher<I>* config_watcher)
3332
: m_config_watcher(config_watcher) {
34-
const std::string rbd_key_prefix("rbd_");
33+
static const std::string rbd_key_prefix("rbd_");
3534
auto& schema = cct->_conf.get_schema();
3635
for (auto& pair : schema) {
3736
// watch all "rbd_" keys for simplicity
38-
if (!boost::starts_with(pair.first, rbd_key_prefix)) {
37+
if (!pair.first.starts_with(rbd_key_prefix)) {
3938
continue;
4039
}
4140

4241
m_config_key_strs.emplace_back(pair.first);
4342
}
44-
45-
m_config_keys.reserve(m_config_key_strs.size());
46-
for (auto& key : m_config_key_strs) {
47-
m_config_keys.emplace_back(key.c_str());
48-
}
49-
m_config_keys.emplace_back(nullptr);
5043
}
5144

52-
const char** get_tracked_conf_keys() const override {
53-
ceph_assert(!m_config_keys.empty());
54-
return &m_config_keys[0];
45+
std::vector<std::string> get_tracked_keys() const noexcept {
46+
return m_config_key_strs;
5547
}
5648

5749
void handle_conf_change(const ConfigProxy& conf,
58-
const std::set <std::string> &changed) override {
50+
const std::set<std::string> &changed) override {
5951
m_config_watcher->handle_global_config_change(changed);
6052
}
6153
};

0 commit comments

Comments
 (0)