]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd/throttler: replace obsolete get_tracked_conf_keys()
authorRonen Friedman <rfriedma@redhat.com>
Sun, 9 Mar 2025 16:57:40 +0000 (11:57 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 9 Mar 2025 17:43:42 +0000 (12:43 -0500)
.. with get_tracked_keys().

Following https://github.com/ceph/ceph/pull/61394,
all uses of the deprecated interface will be updated,
and that old interface will be removed.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/tools/rbd_mirror/Throttler.cc
src/tools/rbd_mirror/Throttler.h

index 07d6e397ec66dbe5e4331648c29d09586a5a7d9a..690f95c9f019ab64db198dbd660bae3764ab380c 100644 (file)
@@ -30,7 +30,6 @@ namespace mirror {
 template <typename I>
 Throttler<I>::Throttler(CephContext *cct, const std::string &config_key)
   : m_cct(cct), m_config_key(config_key),
-    m_config_keys{m_config_key.c_str(), nullptr},
     m_lock(ceph::make_mutex(
       librbd::util::unique_lock_name("rbd::mirror::Throttler", this))),
     m_max_concurrent_ops(cct->_conf.get_val<uint64_t>(m_config_key)) {
@@ -221,11 +220,6 @@ void Throttler<I>::print_status(ceph::Formatter *f) {
   f->dump_int("waiting_requests", m_queue.size());
 }
 
-template <typename I>
-const char** Throttler<I>::get_tracked_conf_keys() const {  
-  return m_config_keys;
-}
-
 template <typename I>
 void Throttler<I>::handle_conf_change(const ConfigProxy& conf,
                                       const std::set<std::string> &changed) {
index 32080238aea22a45459750c97ed9ef9c9f415b83..85cc2aab780c9525602e5ed8a7f4069f740af9a2 100644 (file)
@@ -53,7 +53,6 @@ private:
 
   CephContext *m_cct;
   const std::string m_config_key;
-  mutable const char* m_config_keys[2];
 
   ceph::mutex m_lock;
   uint32_t m_max_concurrent_ops;
@@ -61,7 +60,9 @@ private:
   std::map<Id, Context *> m_queued_ops;
   std::set<Id> m_inflight_ops;
 
-  const char **get_tracked_conf_keys() const override;
+  std::vector<std::string> get_tracked_keys() const noexcept override {
+    return std::vector<std::string>{m_config_key};
+  }
   void handle_conf_change(const ConfigProxy& conf,
                           const std::set<std::string> &changed) override;
 };