]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrubber: add whoami, cct, clog to ScrubMachineListener
authorSamuel Just <sjust@redhat.com>
Tue, 14 Feb 2023 05:30:58 +0000 (21:30 -0800)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 26 Mar 2025 14:30:58 +0000 (14:30 +0000)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 61ee26df552706919f0981f8918a0b66b9735520)

src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_machine_lstnr.h

index dbfbce7c34262dd75d37bdb075000e65d373c048..1c27cc15e1cf8a4058cbec755beee095029cff7e 100644 (file)
@@ -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:
index a3d25fd3439002e1472f3654cda20c2672f58bd8..47295969d581b2b3f457d3827fbd818859543128 100644 (file)
@@ -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);
 
index 542d9f52b6f44101e6296f5cf565cd554234dd4e..ff0f2fd36ba7dd2d36959088dd33135e6cae0439 100644 (file)
@@ -72,6 +72,11 @@ using BlockedRangeWarning = std::unique_ptr<blocked_range_t>;
 }  // 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<void(void)>;
   using scrubber_callback_cancel_token_t = Context*;