From 345911ef2ba65f7f277dd6c33016d86a33539134 Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Thu, 27 Mar 2025 11:36:44 -0500 Subject: [PATCH] sd/scrub: preemption_data_t needs not keep a PG ref Removing the PG* from PgScrubber::preemption_data_t. Mainly - to simplify the creation of unit-tests for the PgScrubber class. Signed-off-by: Ronen Friedman --- src/osd/scrubber/pg_scrubber.cc | 2 +- src/osd/scrubber/pg_scrubber.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index 0a218098f88..8d150b2c9d4 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -2795,7 +2795,7 @@ void PgScrubber::update_scrub_stats(ceph::coarse_real_clock::time_point now_is) // ///////////////////// preemption_data_t ////////////////////////////////// -PgScrubber::preemption_data_t::preemption_data_t(PG* pg) : m_pg{pg}, +PgScrubber::preemption_data_t::preemption_data_t(PG* pg) : osd_scrub_max_preemptions{pg->cct->_conf, "osd_scrub_max_preemptions"} { m_left = *osd_scrub_max_preemptions; diff --git a/src/osd/scrubber/pg_scrubber.h b/src/osd/scrubber/pg_scrubber.h index 4073203d841..d6c686e3ac4 100644 --- a/src/osd/scrubber/pg_scrubber.h +++ b/src/osd/scrubber/pg_scrubber.h @@ -1005,7 +1005,6 @@ class PgScrubber : public ScrubPgIF, } private: - PG* m_pg; mutable ceph::mutex m_preemption_lock = ceph::make_mutex("preemption_lock"); bool m_preemptable{false}; bool m_preempted{false}; -- 2.39.5