]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: complete ImageDispatchSpec upon AioCompletion finalization
authorJason Dillaman <dillaman@redhat.com>
Wed, 6 May 2020 14:52:58 +0000 (10:52 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 14 May 2020 15:56:45 +0000 (11:56 -0400)
This will allow ImageDispatchSpec to invoke any necessary finalizers
for the different dispatch layers and allows in-flight IO to be tracked
since the image dispatch layer finalizers won't be invoked until after
the AioCompletion fires.

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

index afd4a30d76883180e1269d231b70ee0dbdbd60ce..9ebb334a2b153ed8969a7a6bddf8032a64da00ac 100644 (file)
@@ -116,6 +116,10 @@ void AioCompletion::complete() {
     cond.notify_all();
   }
 
+  if (image_dispatcher_ctx != nullptr) {
+    image_dispatcher_ctx->complete(rval);
+  }
+
   // note: possible for image to be closed after op marked finished
   if (async_op.started()) {
     async_op.finish_op();
index 9df547cd2413c8ef5fe9e71c40ecdcf17ee79fd1..43ef32465977877c2dd1a2c3967ab162fbd2a6ac 100644 (file)
 #include <condition_variable>
 #include <mutex>
 
+struct Context;
 
 namespace librbd {
 namespace io {
 
-
 /**
  * AioCompletion is the overall completion for a single
  * rbd I/O request. It may be composed of many AioObjectRequests,
@@ -72,6 +72,8 @@ struct AioCompletion {
   bool was_armed = false;
   bool external_callback = false;
 
+  Context* image_dispatcher_ctx = nullptr;
+
   template <typename T, void (T::*MF)(int)>
   static void callback_adapter(completion_t cb, void *arg) {
     AioCompletion *comp = reinterpret_cast<AioCompletion *>(cb);