: "not-queued";
}
+ /**
+ * access the 'state' directly, for when a distinction between 'registered'
+ * and 'unregistering' is needed (both have in_queues() == true)
+ */
+ bool is_state_registered() const { return state == qu_state_t::registered; }
+
/**
* a text description of the "scheduling intentions" of this PG:
* are we already scheduled for a scrub/deep scrub? when?
// ///////////////////////////////////////////////////////////////////// //
// scrub-op registration handling
-void PgScrubber::unregister_from_osd()
-{
- if (m_scrub_job) {
- dout(15) << __func__ << " prev. state: " << registration_state() << dendl;
- m_osds->get_scrub_services().remove_from_osd_queue(m_scrub_job);
- }
-}
bool PgScrubber::is_scrub_registered() const
{
void PgScrubber::rm_from_osd_scrubbing()
{
- // make sure the OSD won't try to scrub this one just now
- unregister_from_osd();
+ if (m_scrub_job && m_scrub_job->is_state_registered()) {
+ dout(15) << fmt::format(
+ "{}: prev. state: {}", __func__, registration_state())
+ << dendl;
+ m_osds->get_scrub_services().remove_from_osd_queue(m_scrub_job);
+ }
}
void PgScrubber::on_primary_change(