Codify that these are exclusive. This means we don't waste time on
aio_wake in the common case of ioc's with callbacks.
Signed-off-by: Sage Weil <sage@redhat.com>
// destroy this ioc). and avoid ref to ioc after aio_wake()
// in case that triggers destruction.
void *priv = ioc->priv;
- ioc->aio_wake();
if (priv) {
aio_callback(aio_callback_priv, priv);
+ } else {
+ ioc->aio_wake();
}
}
}
// check waiting count before doing callback (which may
// destroy this ioc).
if (!--ctx->num_running) {
- ctx->aio_wake();
if (task->device->aio_callback && ctx->priv) {
task->device->aio_callback(task->device->aio_callback_priv, ctx->priv);
+ } else {
+ ctx->aio_wake();
}
}
task->release_segs(queue);
// read submitted by AIO
if(!task->return_code) {
if (!--ctx->num_running) {
- ctx->aio_wake();
if (task->device->aio_callback && ctx->priv) {
task->device->aio_callback(task->device->aio_callback_priv, ctx->priv);
- }
+ } else {
+ ctx->aio_wake();
+ }
}
delete task;
} else {