]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/AsyncOperation.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #ifndef LIBRBD_ASYNC_OPERATION_H
4 #define LIBRBD_ASYNC_OPERATION_H
6 #include "include/assert.h"
7 #include "include/xlist.h"
16 class AsyncOperation
{
20 : m_image_ctx(NULL
), m_xlist_item(this)
26 assert(!m_xlist_item
.is_on_list());
29 inline bool started() const {
30 return m_xlist_item
.is_on_list();
33 void start_op(ImageCtx
&image_ctx
);
36 void add_flush_context(Context
*on_finish
);
40 ImageCtx
*m_image_ctx
;
41 xlist
<AsyncOperation
*>::item m_xlist_item
;
42 std::list
<Context
*> m_flush_contexts
;
48 #endif // LIBRBD_ASYNC_OPERATION_H