]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/io/ImageRequestWQ.cc
import ceph nautilus 14.2.2
[ceph.git] / ceph / src / librbd / io / ImageRequestWQ.cc
index 2b38bf3b8d40ce6f87f669e251a5fce5e1fb830a..70e6aae9c91c389fc7c90b69fb2a484642d5a21b 100644 (file)
@@ -661,7 +661,7 @@ void ImageRequestWQ<I>::handle_throttle_ready(int r, ImageDispatchSpec<I> *item,
   ceph_assert(m_io_throttled.load() > 0);
   item->set_throttled(flag);
   if (item->were_all_throttled()) {
-    this->requeue(item);
+    this->requeue_back(item);
     --m_io_throttled;
     this->signal();
   }
@@ -685,9 +685,8 @@ bool ImageRequestWQ<I>::needs_throttle(ImageDispatchSpec<I> *item) {
     }
 
     throttle = t.second;
-    tokens = item->tokens_requested(flag);
-
-    if (throttle->get<ImageRequestWQ<I>, ImageDispatchSpec<I>,
+    if (item->tokens_requested(flag, &tokens) &&
+        throttle->get<ImageRequestWQ<I>, ImageDispatchSpec<I>,
              &ImageRequestWQ<I>::handle_throttle_ready>(
                tokens, this, item, flag)) {
       blocked = true;
@@ -911,7 +910,7 @@ void ImageRequestWQ<I>::handle_acquire_lock(
   } else {
     // since IO was stalled for acquire -- original IO order is preserved
     // if we requeue this op for work queue processing
-    this->requeue(req);
+    this->requeue_front(req);
   }
 
   ceph_assert(m_io_blockers.load() > 0);
@@ -930,7 +929,7 @@ void ImageRequestWQ<I>::handle_refreshed(
   } else {
     // since IO was stalled for refresh -- original IO order is preserved
     // if we requeue this op for work queue processing
-    this->requeue(req);
+    this->requeue_front(req);
   }
 
   ceph_assert(m_io_blockers.load() > 0);