From: Adam Kupczyk Date: Tue, 14 Apr 2026 17:57:42 +0000 (+0000) Subject: blk: Expand collect_alerts to allow specialization X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e952b0c9fd240ad0318c744091bf32201e4ee76c;p=ceph.git blk: Expand collect_alerts to allow specialization 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 --- diff --git a/src/blk/BlockDevice.h b/src/blk/BlockDevice.h index 0ea7804088e9..13d78efe870f 100644 --- a/src/blk/BlockDevice.h +++ b/src/blk/BlockDevice.h @@ -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"); diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc index b34ad11dd7cd..e7193c19ea6e 100644 --- a/src/blk/kernel/KernelDevice.cc +++ b/src/blk/kernel/KernelDevice.cc @@ -922,6 +922,11 @@ bool KernelDevice::try_discard(interval_set &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, diff --git a/src/blk/kernel/KernelDevice.h b/src/blk/kernel/KernelDevice.h index fb206f6ba2de..52b93395da38 100644 --- a/src/blk/kernel/KernelDevice.h +++ b/src/blk/kernel/KernelDevice.h @@ -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();