bool is_chunky_scrub_active() const { return state != INACTIVE; }
+ // classic (non chunk) scrubs block all writes
+ // chunky scrubs only block writes to a range
+ bool write_blocked_by_scrub(const hobject_t &soid) {
+ if (!block_writes)
+ return false;
+
+ if (!is_chunky)
+ return true;
+
+ if (soid >= start && soid < end)
+ return true;
+
+ return false;
+ }
+
// clear all state
void reset() {
finalizing = false;
CEPH_NOSNAP, m->get_pg().ps(),
info.pgid.pool());
- if (scrubber.block_writes && m->may_write()) {
- // classic (non chunk) scrubs block all writes
- // chunky scrubs only block writes to a range
- if (!scrubber.is_chunky || (head >= scrubber.start && head < scrubber.end)) {
- dout(20) << __func__ << ": waiting for scrub" << dendl;
- waiting_for_active.push_back(op);
- op->mark_delayed();
- return;
- }
+ if (m->may_write() && scrubber.write_blocked_by_scrub(head)) {
+ dout(20) << __func__ << ": waiting for scrub" << dendl;
+ waiting_for_active.push_back(op);
+ op->mark_delayed();
+ return;
}
// missing object?