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>
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();
#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,
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);