]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: remove special case for starting AioCompletion ops 28773/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 29 Apr 2019 15:37:37 +0000 (11:37 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 27 Jun 2019 20:48:26 +0000 (16:48 -0400)
All ops can be immediately started now that flush ops won't
accidentally block themselves.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit b5fc7ecaf7a3741d227ab5a9108392813dd03495)

Conflicts:
src/librbd/api/DiffIterate.cc: dropped changes
src/librbd/image/CloseRequest.cc: dropped changes
src/librbd/image/RefreshRequest.cc: dropped changes
src/librbd/io/AioCompletion.cc: assert/ceph_assert conflicts
src/librbd/io/ImageRequest.cc:: assert/ceph_assert conflicts
src/librbd/io/ImageRequestWQ.cc: trivial resolution
src/librbd/operation/ResizeRequest.cc: dropped changes
src/test/librbd/journal/test_Replay.cc: dropped changes
src/test/rbd_mirror/test_ImageSync.cc: dropped changes

src/librbd/io/AioCompletion.cc
src/librbd/io/AioCompletion.h
src/librbd/io/ImageRequest.cc
src/librbd/io/ImageRequestWQ.cc

index 82ed60faa932325c903c787139c16f4df0746ada..e28df5e334c90f8823e21b98f1a287cf06a39329 100644 (file)
@@ -127,20 +127,17 @@ void AioCompletion::init_time(ImageCtx *i, aio_type_t t) {
   }
 }
 
-void AioCompletion::start_op(bool ignore_type) {
+void AioCompletion::start_op() {
   Mutex::Locker locker(lock);
   assert(ictx != nullptr);
-  assert(!async_op.started());
 
   if (aio_type == AIO_TYPE_OPEN || aio_type == AIO_TYPE_CLOSE) {
     // no need to track async open/close operations
     return;
   }
 
-  if (state == AIO_STATE_PENDING &&
-      (ignore_type || aio_type != AIO_TYPE_FLUSH)) {
-    async_op.start_op(*ictx);
-  }
+  assert(!async_op.started());
+  async_op.start_op(*ictx);
 }
 
 void AioCompletion::fail(int r)
index 6673b66c70f31c3acb1b3513c9a5242dd097c2c5..a6e422e7ba4a41cea949f958ab344f72ae95aa5f 100644 (file)
@@ -123,7 +123,7 @@ struct AioCompletion {
   }
 
   void init_time(ImageCtx *i, aio_type_t t);
-  void start_op(bool ignore_type = false);
+  void start_op();
   void fail(int r);
 
   void complete();
index cff22f7c016fd66b4444e5ae4839515f54616937..0e56346c2ddc318e7d2b08d9a9308ccd09f68474 100644 (file)
@@ -222,7 +222,7 @@ template <typename I>
 void ImageRequest<I>::send() {
   I &image_ctx = this->m_image_ctx;
   assert(m_aio_comp->is_initialized(get_aio_type()));
-  assert(m_aio_comp->is_started() ^ (get_aio_type() == AIO_TYPE_FLUSH));
+  assert(m_aio_comp->is_started());
 
   CephContext *cct = image_ctx.cct;
   AioCompletion *aio_comp = this->m_aio_comp;
@@ -715,7 +715,6 @@ void ImageFlushRequest<I>::send_request() {
   }
 
   // ensure all in-flight IOs are settled if non-user flush request
-  aio_comp->start_op(true);
   aio_comp->async_op.flush(ctx);
   aio_comp->put();
 
index fe2a39bd7fb1a78c3c06df6efd12c1168a68f93a..39af765be7dc205d709652bae99677104c675063 100644 (file)
@@ -335,6 +335,7 @@ void ImageRequestWQ<I>::aio_flush(AioCompletion *c, bool native_async) {
   if (m_image_ctx.non_blocking_aio || writes_blocked() || !writes_empty()) {
     queue(ImageRequest<I>::create_flush_request(m_image_ctx, c, trace));
   } else {
+    c->start_op();
     ImageRequest<I>::aio_flush(&m_image_ctx, c, trace);
     finish_in_flight_io();
   }