]> 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>
Mon, 4 May 2026 16:27:10 +0000 (16:27 +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>
(cherry picked from commit e952b0c9fd240ad0318c744091bf32201e4ee76c)

src/blk/BlockDevice.h
src/blk/kernel/KernelDevice.cc
src/blk/kernel/KernelDevice.h

index 30dfe0187a25445ea1815654dd5ba7ab53d518c3..484ce9a6b0e7a4ea0af65272164908237b3f13a7 100644 (file)
@@ -150,7 +150,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 f6b4f1432350adb251ef9b2d30f786e79c1a5dc6..a9b63b165b6fee2419b03a4b7365cf9bebefe861 100644 (file)
@@ -894,6 +894,11 @@ bool KernelDevice::try_discard(interval_set<uint64_t> &to_release, bool async)
   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 485eced97233dc87fb741048b1c5f2e14fb88417..6ab1b073d525b32e4cd180d67c050b9bc8c389ec 100644 (file)
@@ -98,6 +98,8 @@ private:
   bool _queue_discard(interval_set<uint64_t> &to_release);
   bool try_discard(interval_set<uint64_t> &to_release, bool async = true) override;
 
+  void collect_alerts(osd_alert_list_t& alerts, const std::string& device_name) override;
+
   int _aio_start();
   void _aio_stop();