]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kernel/KernelDevice: replace obsolete get_tracked_conf_keys() 62185/head
authorRonen Friedman <rfriedma@redhat.com>
Sun, 9 Mar 2025 14:53:32 +0000 (09:53 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 10 Mar 2025 13:50:11 +0000 (08:50 -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/blk/kernel/KernelDevice.cc
src/blk/kernel/KernelDevice.h

index cc9b34c899328f277cdd4652e9485f891de5512e..0f75eccca42d5db297b5f5534fea8b95028fc4a8 100644 (file)
@@ -52,6 +52,7 @@ using std::list;
 using std::map;
 using std::string;
 using std::vector;
+using namespace std::literals;
 
 using ceph::bufferlist;
 using ceph::bufferptr;
@@ -1562,14 +1563,13 @@ int KernelDevice::invalidate_cache(uint64_t off, uint64_t len)
   return r;
 }
 
-const char** KernelDevice::get_tracked_conf_keys() const
+std::vector<std::string> KernelDevice::get_tracked_keys()
+    const noexcept
 {
-  static const char* KEYS[] = {
-    "bdev_async_discard_threads",
-    "bdev_enable_discard",
-    NULL
+  return {
+    "bdev_async_discard_threads"s,
+    "bdev_enable_discard"s
   };
-  return KEYS;
 }
 
 void KernelDevice::handle_conf_change(const ConfigProxy& conf,
index 1444bfa54bbd72be9362b4304fbe6dac3bae8cdb..b285802c8656a37fc6b149960cd1d3aad1ca9a70 100644 (file)
@@ -166,7 +166,7 @@ public:
   void close() override;
 
   // config observer bits
-  const char** get_tracked_conf_keys() const override;
+  std::vector<std::string> get_tracked_keys() const noexcept override;
   void handle_conf_change(const ConfigProxy& conf,
                           const std::set <std::string> &changed) override;
 };