]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: drop flush tracker from exclusive lock image dispatch
authorJason Dillaman <dillaman@redhat.com>
Thu, 17 Sep 2020 23:43:45 +0000 (19:43 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Sep 2020 03:52:31 +0000 (23:52 -0400)
We can now pass the flush through the exclusive-lock dispatch layer
to ensure all in-flight IOs have been processed.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/exclusive_lock/ImageDispatch.cc
src/librbd/exclusive_lock/ImageDispatch.h

index e734cecf22a64cc11d87eb9f2ac5bdb388650a9d..dc276f1e410f8e2f306339481576844876a2272c 100644 (file)
@@ -10,7 +10,6 @@
 #include "librbd/Utils.h"
 #include "librbd/exclusive_lock/Policy.h"
 #include "librbd/io/AioCompletion.h"
-#include "librbd/io/FlushTracker.h"
 #include "librbd/io/ImageDispatchSpec.h"
 #include "librbd/io/ImageDispatcherInterface.h"
 
@@ -29,13 +28,7 @@ ImageDispatch<I>::ImageDispatch(I* image_ctx)
   : m_image_ctx(image_ctx),
     m_lock(ceph::make_shared_mutex(
       util::unique_lock_name("librbd::exclusve_lock::ImageDispatch::m_lock",
-                             this))),
-    m_flush_tracker(new io::FlushTracker<I>(image_ctx)) {
-}
-
-template <typename I>
-ImageDispatch<I>::~ImageDispatch() {
-  delete m_flush_tracker;
+                             this))) {
 }
 
 template <typename I>
@@ -51,8 +44,6 @@ void ImageDispatch<I>::shut_down(Context* on_finish) {
     ctx->complete(0);
   }
 
-  // ensure we don't have any pending flushes before deleting layer
-  m_flush_tracker->shut_down();
   on_finish->complete(0);
 }
 
@@ -125,7 +116,6 @@ bool ImageDispatch<I>::read(
     return true;
   }
 
-  m_flush_tracker->start_io(tid);
   return false;
 }
 
@@ -143,7 +133,6 @@ bool ImageDispatch<I>::write(
     return true;
   }
 
-  m_flush_tracker->start_io(tid);
   return false;
 }
 
@@ -161,7 +150,6 @@ bool ImageDispatch<I>::discard(
     return true;
   }
 
-  m_flush_tracker->start_io(tid);
   return false;
 }
 
@@ -179,7 +167,6 @@ bool ImageDispatch<I>::write_same(
     return true;
   }
 
-  m_flush_tracker->start_io(tid);
   return false;
 }
 
@@ -198,7 +185,6 @@ bool ImageDispatch<I>::compare_and_write(
     return true;
   }
 
-  m_flush_tracker->start_io(tid);
   return false;
 }
 
@@ -221,17 +207,7 @@ bool ImageDispatch<I>::flush(
     return true;
   }
 
-  *dispatch_result = io::DISPATCH_RESULT_CONTINUE;
-  m_flush_tracker->flush(on_dispatched);
-  return true;
-}
-
-template <typename I>
-void ImageDispatch<I>::handle_finished(int r, uint64_t tid) {
-  auto cct = m_image_ctx->cct;
-  ldout(cct, 20) << "tid=" << tid << dendl;
-
-  m_flush_tracker->finish_io(tid);
+  return false;
 }
 
 template <typename I>
index 2a20407f3169657942006ef0b366fbe6dbe74e3a..965499c45d433ddb7993fb3f6c9e90d1436dfea8 100644 (file)
@@ -23,7 +23,6 @@ struct ImageCtx;
 
 namespace io {
 struct AioCompletion;
-template <typename> struct FlushTracker;
 }
 
 namespace exclusive_lock {
@@ -39,7 +38,6 @@ public:
   }
 
   ImageDispatch(ImageCtxT* image_ctx);
-  ~ImageDispatch() override;
 
   io::ImageDispatchLayer get_dispatch_layer() const override {
     return io::IMAGE_DISPATCH_LAYER_EXCLUSIVE_LOCK;
@@ -85,7 +83,8 @@ public:
       std::atomic<uint32_t>* image_dispatch_flags,
       io::DispatchResult* dispatch_result, Context* on_dispatched) override;
 
-  void handle_finished(int r, uint64_t tid) override;
+  void handle_finished(int r, uint64_t tid) override {
+  }
 
 private:
   typedef std::list<Context*> Contexts;
@@ -97,7 +96,6 @@ private:
   bool m_require_lock_on_read = false;
   bool m_require_lock_on_write = false;
 
-  io::FlushTracker<ImageCtxT>* m_flush_tracker = nullptr;
   Contexts m_on_dispatches;
 
   bool set_require_lock(io::Direction direction, bool enabled);