From: Jason Dillaman Date: Thu, 17 Sep 2020 23:43:45 +0000 (-0400) Subject: librbd: drop flush tracker from exclusive lock image dispatch X-Git-Tag: v16.1.0~1032^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c599785b3ce55b2a617d6350d337eaf8c076281e;p=ceph.git librbd: drop flush tracker from exclusive lock image dispatch 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 --- diff --git a/src/librbd/exclusive_lock/ImageDispatch.cc b/src/librbd/exclusive_lock/ImageDispatch.cc index e734cecf22a6..dc276f1e410f 100644 --- a/src/librbd/exclusive_lock/ImageDispatch.cc +++ b/src/librbd/exclusive_lock/ImageDispatch.cc @@ -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::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(image_ctx)) { -} - -template -ImageDispatch::~ImageDispatch() { - delete m_flush_tracker; + this))) { } template @@ -51,8 +44,6 @@ void ImageDispatch::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::read( return true; } - m_flush_tracker->start_io(tid); return false; } @@ -143,7 +133,6 @@ bool ImageDispatch::write( return true; } - m_flush_tracker->start_io(tid); return false; } @@ -161,7 +150,6 @@ bool ImageDispatch::discard( return true; } - m_flush_tracker->start_io(tid); return false; } @@ -179,7 +167,6 @@ bool ImageDispatch::write_same( return true; } - m_flush_tracker->start_io(tid); return false; } @@ -198,7 +185,6 @@ bool ImageDispatch::compare_and_write( return true; } - m_flush_tracker->start_io(tid); return false; } @@ -221,17 +207,7 @@ bool ImageDispatch::flush( return true; } - *dispatch_result = io::DISPATCH_RESULT_CONTINUE; - m_flush_tracker->flush(on_dispatched); - return true; -} - -template -void ImageDispatch::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 diff --git a/src/librbd/exclusive_lock/ImageDispatch.h b/src/librbd/exclusive_lock/ImageDispatch.h index 2a20407f3169..965499c45d43 100644 --- a/src/librbd/exclusive_lock/ImageDispatch.h +++ b/src/librbd/exclusive_lock/ImageDispatch.h @@ -23,7 +23,6 @@ struct ImageCtx; namespace io { struct AioCompletion; -template 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* 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 Contexts; @@ -97,7 +96,6 @@ private: bool m_require_lock_on_read = false; bool m_require_lock_on_write = false; - io::FlushTracker* m_flush_tracker = nullptr; Contexts m_on_dispatches; bool set_require_lock(io::Direction direction, bool enabled);