From: Samuel Just Date: Tue, 14 Feb 2023 05:30:58 +0000 (-0800) Subject: osd/scrubber: add whoami, cct, clog to ScrubMachineListener X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d57bf59968e40e47cab3e11684b2f76dbc4d43c6;p=ceph.git osd/scrubber: add whoami, cct, clog to ScrubMachineListener Signed-off-by: Samuel Just (cherry picked from commit 61ee26df552706919f0981f8918a0b66b9735520) --- diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index dbfbce7c3426..1c27cc15e1cf 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -683,6 +683,16 @@ void PgScrubber::cancel_callback(scrubber_callback_cancel_token_t token) m_osds->sleep_timer.cancel_event(token); } +LogChannelRef &PgScrubber::get_clog() const +{ + return m_osds->clog; +} + +int PgScrubber::get_whoami() const +{ + return m_osds->whoami; +} + /* * The selected range is set directly into 'm_start' and 'm_end' * setting: diff --git a/src/osd/scrubber/pg_scrubber.h b/src/osd/scrubber/pg_scrubber.h index a3d25fd34390..47295969d581 100644 --- a/src/osd/scrubber/pg_scrubber.h +++ b/src/osd/scrubber/pg_scrubber.h @@ -498,6 +498,11 @@ class PgScrubber : public ScrubPgIF, // the I/F used by the state-machine (i.e. the implementation of // ScrubMachineListener) + CephContext* get_cct() const final { return m_pg->cct; } + LogChannelRef &get_clog() const final; + int get_whoami() const final; + spg_t get_spgid() const final { return m_pg->get_pgid(); } + scrubber_callback_cancel_token_t schedule_callback_after( ceph::timespan duration, scrubber_callback_t &&cb); diff --git a/src/osd/scrubber/scrub_machine_lstnr.h b/src/osd/scrubber/scrub_machine_lstnr.h index 542d9f52b6f4..ff0f2fd36ba7 100644 --- a/src/osd/scrubber/scrub_machine_lstnr.h +++ b/src/osd/scrubber/scrub_machine_lstnr.h @@ -72,6 +72,11 @@ using BlockedRangeWarning = std::unique_ptr; } // namespace Scrub struct ScrubMachineListener { + virtual CephContext *get_cct() const = 0; + virtual LogChannelRef &get_clog() const = 0; + virtual int get_whoami() const = 0; + virtual spg_t get_spgid() const = 0; + using scrubber_callback_t = std::function; using scrubber_callback_cancel_token_t = Context*;