From: Mykola Golub Date: Sun, 29 Jan 2017 21:07:53 +0000 (+0100) Subject: librbd: add create_async_context_callback helper X-Git-Tag: v12.0.0~38^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f89857967ec45e115d8ecaec829425ed5d9a70b9;p=ceph.git librbd: add create_async_context_callback helper Signed-off-by: Mykola Golub --- diff --git a/src/librbd/Utils.h b/src/librbd/Utils.h index d03da840726..c7cf89e9734 100644 --- a/src/librbd/Utils.h +++ b/src/librbd/Utils.h @@ -156,6 +156,12 @@ Context *create_async_context_callback(I &image_ctx, Context *on_finish) { image_ctx.op_work_queue, on_finish); } +template +Context *create_async_context_callback(WQ *work_queue, Context *on_finish) { + // use async callback to acquire a clean lock context + return new detail::C_AsyncCallback(work_queue, on_finish); +} + // TODO: temporary until AioCompletion supports templated ImageCtx inline ImageCtx *get_image_ctx(ImageCtx *image_ctx) { return image_ctx;