]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
blk: Expand collect_alerts to allow specialization
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 14 Apr 2026 17:57:42 +0000 (17:57 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 22 Apr 2026 14:22:18 +0000 (14:22 +0000)
Previously we had BlockDevice::collect_alerts that had fixed
implementation.
Expanded BlockDevice::collect_alerts into virtual, so KernelDevice can
override it.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/blk/BlockDevice.h
src/blk/kernel/KernelDevice.cc
src/blk/kernel/KernelDevice.h

index 0ea7804088e9209038267677275c1819d940a230..13d78efe870f1b57d92c7000ca3f178fc4174522 100644 (file)
@@ -151,7 +151,7 @@ class BlockDevice {
 public:
   CephContext* cct;
   typedef void (*aio_callback_t)(void *handle, void *aio);
-  void collect_alerts(osd_alert_list_t& alerts, const std::string& device_name);
+  virtual void collect_alerts(osd_alert_list_t& alerts, const std::string& device_name);
 
 private:
   ceph::mutex ioc_reap_lock = ceph::make_mutex("BlockDevice::ioc_reap_lock");
index b34ad11dd7cd82be71ca2687e80ceb721b972046..e7193c19ea6e04556d06cd350e01c928ed952698 100644 (file)
@@ -922,6 +922,11 @@ bool KernelDevice::try_discard(interval_set<uint64_t> &to_release,
   return false;
 }
 
+void KernelDevice::collect_alerts(osd_alert_list_t& alerts, const std::string& device_name)
+{
+  BlockDevice::collect_alerts(alerts, device_name);
+}
+
 void KernelDevice::_aio_log_start(
   IOContext *ioc,
   uint64_t offset,
index fb206f6ba2dedcf48cb19c68c93cc81007740830..52b93395da3804d1ccbe702e4c4e275e451dacf7 100644 (file)
@@ -101,6 +101,8 @@ private:
                    bool async = true,
                    bool force = false) override;
 
+  void collect_alerts(osd_alert_list_t& alerts, const std::string& device_name) override;
+
   int _aio_start();
   void _aio_stop();