From: Haomai Wang Date: Sun, 21 Feb 2016 12:36:25 +0000 (+0800) Subject: NVMEDevice: use wakeup instead of direct call X-Git-Tag: v10.1.0~262^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8513e001332933bf8e4f206322d97bc72d29f4f0;p=ceph.git NVMEDevice: use wakeup instead of direct call Signed-off-by: Haomai Wang --- diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index 355d38955ead..ed849e69ae59 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -534,10 +534,7 @@ void io_complete(void *t, const struct spdk_nvme_cpl *completion) // check waiting count before doing callback (which may // destroy this ioc). if (!--ctx->num_running) { - if (ctx->num_waiting.load()) { - std::unique_lock l(ctx->lock); - ctx->cond.notify_all(); - } + ctx->aio_wake(); if (task->device->aio_callback && ctx->priv) { task->device->aio_callback(task->device->aio_callback_priv, ctx->priv); } @@ -795,6 +792,7 @@ int NVMEDevice::aio_zero( t->offset = off; t->len = len; t->device = this; + t->buf = nullptr; t->ctx = ioc; Task *first = static_cast(ioc->nvme_task_first);