From: Jason Dillaman Date: Wed, 27 May 2020 20:51:10 +0000 (-0400) Subject: librbd: switch the block_writes API calls to new write block layer X-Git-Tag: wip-pdonnell-testing-20200918.022351~1089^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=382953a659d84634464939bb1c4e1e65865c54be;p=ceph-ci.git librbd: switch the block_writes API calls to new write block layer This layer is located after all other layers that might block writes and therefore hang waiting for IO to complete. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/ImageDispatcher.cc b/src/librbd/io/ImageDispatcher.cc index 090cddb3186..99e4e62d604 100644 --- a/src/librbd/io/ImageDispatcher.cc +++ b/src/librbd/io/ImageDispatcher.cc @@ -15,6 +15,7 @@ #include "librbd/io/QueueImageDispatch.h" #include "librbd/io/QosImageDispatch.h" #include "librbd/io/RefreshImageDispatch.h" +#include "librbd/io/WriteBlockImageDispatch.h" #include #define dout_subsys ceph_subsys_rbd @@ -108,14 +109,17 @@ ImageDispatcher::ImageDispatcher(I* image_ctx) auto image_dispatch = new ImageDispatch(image_ctx); this->register_dispatch(image_dispatch); - m_queue_image_dispatch = new QueueImageDispatch(image_ctx); - this->register_dispatch(m_queue_image_dispatch); + auto queue_image_dispatch = new QueueImageDispatch(image_ctx); + this->register_dispatch(queue_image_dispatch); m_qos_image_dispatch = new QosImageDispatch(image_ctx); this->register_dispatch(m_qos_image_dispatch); auto refresh_image_dispatch = new RefreshImageDispatch(image_ctx); this->register_dispatch(refresh_image_dispatch); + + m_write_block_dispatch = new WriteBlockImageDispatch(image_ctx); + this->register_dispatch(m_write_block_dispatch); } template @@ -150,27 +154,27 @@ void ImageDispatcher::apply_qos_limit(uint64_t flag, uint64_t limit, template bool ImageDispatcher::writes_blocked() const { - return m_queue_image_dispatch->writes_blocked(); + return m_write_block_dispatch->writes_blocked(); } template int ImageDispatcher::block_writes() { - return m_queue_image_dispatch->block_writes(); + return m_write_block_dispatch->block_writes(); } template void ImageDispatcher::block_writes(Context *on_blocked) { - m_queue_image_dispatch->block_writes(on_blocked); + m_write_block_dispatch->block_writes(on_blocked); } template void ImageDispatcher::unblock_writes() { - m_queue_image_dispatch->unblock_writes(); + m_write_block_dispatch->unblock_writes(); } template void ImageDispatcher::wait_on_writes_unblocked(Context *on_unblocked) { - m_queue_image_dispatch->wait_on_writes_unblocked(on_unblocked); + m_write_block_dispatch->wait_on_writes_unblocked(on_unblocked); } template diff --git a/src/librbd/io/ImageDispatcher.h b/src/librbd/io/ImageDispatcher.h index 1b6afdb2776..03df2e4c74a 100644 --- a/src/librbd/io/ImageDispatcher.h +++ b/src/librbd/io/ImageDispatcher.h @@ -22,8 +22,8 @@ struct ImageCtx; namespace io { -template struct QueueImageDispatch; template struct QosImageDispatch; +template struct WriteBlockImageDispatch; template class ImageDispatcher : public Dispatcher { @@ -55,8 +55,8 @@ private: std::atomic m_next_tid{0}; - QueueImageDispatch* m_queue_image_dispatch = nullptr; QosImageDispatch* m_qos_image_dispatch = nullptr; + WriteBlockImageDispatch* m_write_block_dispatch = nullptr; };