]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: fix write_blocked_by_scrub
authorSage Weil <sage@redhat.com>
Wed, 8 Feb 2017 21:46:10 +0000 (16:46 -0500)
committerSage Weil <sage@redhat.com>
Sat, 11 Feb 2017 15:45:16 +0000 (10:45 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.h
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 019a9b66000c075a31bb96025a2049da5140c1cd..807efc56c5fed5bc1f6dc735f242c5d191ff5f9c 100644 (file)
@@ -1197,12 +1197,8 @@ public:
 
     // classic (non chunk) scrubs block all writes
     // chunky scrubs only block writes to a range
-    bool write_blocked_by_scrub(const hobject_t &soid, bool sort_bitwise) {
-      if (soid >= start &&
-         soid < end)
-       return true;
-
-      return false;
+    bool write_blocked_by_scrub(const hobject_t &soid) {
+      return (soid >= start && soid < end);
     }
 
     // clear all state
index f703664f36b1011b77bee4e9fed15d8d358923ec..30e718b1b07be2902d19987bb72e063797ede595 100644 (file)
@@ -1964,7 +1964,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
   }
 
   if (write_ordered &&
-      scrubber.write_blocked_by_scrub(head, get_sort_bitwise())) {
+      scrubber.write_blocked_by_scrub(head)) {
     dout(20) << __func__ << ": waiting for scrub" << dendl;
     waiting_for_scrub.push_back(op);
     op->mark_delayed("waiting for scrub");
@@ -2972,7 +2972,7 @@ void PrimaryLogPG::promote_object(ObjectContextRef obc,
 {
   hobject_t hoid = obc ? obc->obs.oi.soid : missing_oid;
   assert(hoid != hobject_t());
-  if (scrubber.write_blocked_by_scrub(hoid, get_sort_bitwise())) {
+  if (scrubber.write_blocked_by_scrub(hoid)) {
     dout(10) << __func__ << " " << hoid
             << " blocked by scrub" << dendl;
     if (op) {
@@ -8174,7 +8174,7 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop)
   }
 
   if (!fop->blocking &&
-      scrubber.write_blocked_by_scrub(oid, get_sort_bitwise())) {
+      scrubber.write_blocked_by_scrub(oid)) {
     if (fop->op) {
       dout(10) << __func__ << " blocked by scrub" << dendl;
       requeue_op(fop->op);
@@ -8889,7 +8889,7 @@ void PrimaryLogPG::handle_watch_timeout(WatchRef watch)
     return;
   }
 
-  if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid, get_sort_bitwise())) {
+  if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid)) {
     dout(10) << "handle_watch_timeout waiting for scrub on obj "
             << obc->obs.oi.soid
             << dendl;
@@ -11529,7 +11529,7 @@ void PrimaryLogPG::hit_set_remove_all()
     // Once we hit a degraded object just skip
     if (is_degraded_or_backfilling_object(aoid))
       return;
-    if (scrubber.write_blocked_by_scrub(aoid, get_sort_bitwise()))
+    if (scrubber.write_blocked_by_scrub(aoid))
       return;
   }
 
@@ -11648,7 +11648,7 @@ void PrimaryLogPG::hit_set_persist()
     // Once we hit a degraded object just skip further trim
     if (is_degraded_or_backfilling_object(aoid))
       return;
-    if (scrubber.write_blocked_by_scrub(aoid, get_sort_bitwise()))
+    if (scrubber.write_blocked_by_scrub(aoid))
       return;
   }
 
@@ -11682,7 +11682,7 @@ void PrimaryLogPG::hit_set_persist()
     new_hset.using_gmt);
 
   // If the current object is degraded we skip this persist request
-  if (scrubber.write_blocked_by_scrub(oid, get_sort_bitwise()))
+  if (scrubber.write_blocked_by_scrub(oid))
     return;
 
   hit_set->seal();
@@ -11926,7 +11926,7 @@ bool PrimaryLogPG::agent_work(int start_max, int agent_flush_quota)
       osd->logger->inc(l_osd_agent_skip);
       continue;
     }
-    if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid, get_sort_bitwise())) {
+    if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid)) {
       dout(20) << __func__ << " skip (scrubbing) " << obc->obs.oi << dendl;
       osd->logger->inc(l_osd_agent_skip);
       continue;
index 3553b4d59f08d6fd95223800a337f9f158407082..ff147da30086b83a63c7972ce8a7453ece849c92 100644 (file)
@@ -821,9 +821,7 @@ protected:
     if (!to_req.empty()) {
       // requeue at front of scrub blocking queue if we are blocked by scrub
       for (auto &&p: to_req) {
-       if (scrubber.write_blocked_by_scrub(
-             p.first.get_head(),
-             get_sort_bitwise())) {
+       if (scrubber.write_blocked_by_scrub(p.first.get_head())) {
          waiting_for_scrub.splice(
            waiting_for_scrub.begin(),
            p.second,