template <typename I>
ExclusiveLock<I>::ExclusiveLock(I &image_ctx)
: RefCountedObject(image_ctx.cct),
- ML<I>(image_ctx.md_ctx, image_ctx.op_work_queue, image_ctx.header_oid,
+ ML<I>(image_ctx.md_ctx, *image_ctx.asio_engine, image_ctx.header_oid,
image_ctx.image_watcher, managed_lock::EXCLUSIVE,
image_ctx.config.template get_val<bool>("rbd_blacklist_on_break_lock"),
image_ctx.config.template get_val<uint64_t>("rbd_blacklist_expire_seconds")),
// vim: ts=8 sw=2 smarttab
#include "librbd/ManagedLock.h"
+#include "librbd/AsioEngine.h"
+#include "librbd/ImageCtx.h"
+#include "librbd/Watcher.h"
#include "librbd/asio/ContextWQ.h"
#include "librbd/managed_lock/AcquireRequest.h"
#include "librbd/managed_lock/BreakRequest.h"
#include "librbd/managed_lock/ReacquireRequest.h"
#include "librbd/managed_lock/Types.h"
#include "librbd/managed_lock/Utils.h"
-#include "librbd/Watcher.h"
-#include "librbd/ImageCtx.h"
#include "cls/lock/cls_lock_client.h"
#include "common/dout.h"
#include "common/errno.h"
using managed_lock::util::encode_lock_cookie;
template <typename I>
-ManagedLock<I>::ManagedLock(librados::IoCtx &ioctx, asio::ContextWQ *work_queue,
+ManagedLock<I>::ManagedLock(librados::IoCtx &ioctx, AsioEngine& asio_engine,
const string& oid, Watcher *watcher, Mode mode,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
: m_lock(ceph::make_mutex(unique_lock_name("librbd::ManagedLock<I>::m_lock", this))),
m_ioctx(ioctx), m_cct(reinterpret_cast<CephContext *>(ioctx.cct())),
- m_work_queue(work_queue),
+ m_asio_engine(asio_engine),
+ m_work_queue(asio_engine.get_work_queue()),
m_oid(oid),
m_watcher(watcher),
m_mode(mode),
} else {
on_finish = new C_Tracked(m_async_op_tracker, on_finish);
auto req = managed_lock::BreakRequest<I>::create(
- m_ioctx, m_work_queue, m_oid, locker, m_mode == EXCLUSIVE,
+ m_ioctx, m_asio_engine, m_oid, locker, m_mode == EXCLUSIVE,
m_blacklist_on_break_lock, m_blacklist_expire_seconds, force_break_lock,
on_finish);
req->send();
using managed_lock::AcquireRequest;
AcquireRequest<I>* req = AcquireRequest<I>::create(
- m_ioctx, m_watcher, m_work_queue, m_oid, m_cookie, m_mode == EXCLUSIVE,
+ m_ioctx, m_watcher, m_asio_engine, m_oid, m_cookie, m_mode == EXCLUSIVE,
m_blacklist_on_break_lock, m_blacklist_expire_seconds,
create_context_callback<
ManagedLock<I>, &ManagedLock<I>::handle_acquire_lock>(this));
namespace librbd {
+struct AsioEngine;
struct ImageCtx;
-
namespace asio { struct ContextWQ; }
namespace managed_lock { struct Locker; }
public:
static ManagedLock *create(librados::IoCtx& ioctx,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid, Watcher *watcher,
managed_lock::Mode mode,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds) {
- return new ManagedLock(ioctx, work_queue, oid, watcher, mode,
+ return new ManagedLock(ioctx, asio_engine, oid, watcher, mode,
blacklist_on_break_lock, blacklist_expire_seconds);
}
void destroy() {
delete this;
}
- ManagedLock(librados::IoCtx& ioctx, asio::ContextWQ *work_queue,
+ ManagedLock(librados::IoCtx& ioctx, AsioEngine& asio_engine,
const std::string& oid, Watcher *watcher,
managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds);
librados::IoCtx& m_ioctx;
CephContext *m_cct;
- asio::ContextWQ *m_work_queue;
+ AsioEngine& m_asio_engine;
+ asio::ContextWQ* m_work_queue;
std::string m_oid;
Watcher *m_watcher;
managed_lock::Mode m_mode;
#include "common/dout.h"
#include "common/errno.h"
#include "include/stringify.h"
+#include "librbd/AsioEngine.h"
#include "librbd/ImageCtx.h"
#include "librbd/Utils.h"
#include "librbd/asio/ContextWQ.h"
template <typename I>
AcquireRequest<I>* AcquireRequest<I>::create(librados::IoCtx& ioctx,
Watcher *watcher,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const string& oid,
const string& cookie,
bool exclusive,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds,
Context *on_finish) {
- return new AcquireRequest(ioctx, watcher, work_queue, oid, cookie,
+ return new AcquireRequest(ioctx, watcher, asio_engine, oid, cookie,
exclusive, blacklist_on_break_lock,
blacklist_expire_seconds, on_finish);
}
template <typename I>
AcquireRequest<I>::AcquireRequest(librados::IoCtx& ioctx, Watcher *watcher,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const string& oid,
const string& cookie, bool exclusive,
bool blacklist_on_break_lock,
Context *on_finish)
: m_ioctx(ioctx), m_watcher(watcher),
m_cct(reinterpret_cast<CephContext *>(m_ioctx.cct())),
- m_work_queue(work_queue), m_oid(oid), m_cookie(cookie),
+ m_asio_engine(asio_engine), m_oid(oid), m_cookie(cookie),
m_exclusive(exclusive),
m_blacklist_on_break_lock(blacklist_on_break_lock),
m_blacklist_expire_seconds(blacklist_expire_seconds),
- m_on_finish(new C_AsyncCallback<asio::ContextWQ>(work_queue, on_finish)) {
+ m_on_finish(new C_AsyncCallback<asio::ContextWQ>(
+ asio_engine.get_work_queue(), on_finish)) {
}
template <typename I>
Context *ctx = create_context_callback<
AcquireRequest<I>, &AcquireRequest<I>::handle_break_lock>(this);
auto req = BreakRequest<I>::create(
- m_ioctx, m_work_queue, m_oid, m_locker, m_exclusive,
+ m_ioctx, m_asio_engine, m_oid, m_locker, m_exclusive,
m_blacklist_on_break_lock, m_blacklist_expire_seconds, false, ctx);
req->send();
}
namespace librbd {
+class AsioEngine;
class Watcher;
-namespace asio { struct ContextWQ; }
namespace managed_lock {
public:
static AcquireRequest* create(librados::IoCtx& ioctx, Watcher *watcher,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid,
const std::string& cookie,
bool exclusive,
*/
AcquireRequest(librados::IoCtx& ioctx, Watcher *watcher,
- asio::ContextWQ *work_queue, const std::string& oid,
+ AsioEngine& asio_engine, const std::string& oid,
const std::string& cookie, bool exclusive,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds, Context *on_finish);
librados::IoCtx& m_ioctx;
Watcher *m_watcher;
CephContext *m_cct;
- asio::ContextWQ *m_work_queue;
+ AsioEngine& m_asio_engine;
std::string m_oid;
std::string m_cookie;
bool m_exclusive;
#include "librbd/managed_lock/BreakRequest.h"
#include "common/dout.h"
#include "common/errno.h"
+#include "include/neorados/RADOS.hpp"
#include "include/stringify.h"
#include "cls/lock/cls_lock_client.h"
#include "cls/lock/cls_lock_types.h"
+#include "librbd/AsioEngine.h"
#include "librbd/ImageCtx.h"
#include "librbd/Utils.h"
#include "librbd/asio/ContextWQ.h"
template <typename I>
BreakRequest<I>::BreakRequest(librados::IoCtx& ioctx,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
bool force_break_lock, Context *on_finish)
: m_ioctx(ioctx), m_cct(reinterpret_cast<CephContext *>(m_ioctx.cct())),
- m_work_queue(work_queue), m_oid(oid), m_locker(locker),
+ m_asio_engine(asio_engine), m_oid(oid), m_locker(locker),
m_exclusive(exclusive), m_blacklist_locker(blacklist_locker),
m_blacklist_expire_seconds(blacklist_expire_seconds),
m_force_break_lock(force_break_lock), m_on_finish(on_finish) {
using klass = BreakRequest<I>;
Context *ctx = create_context_callback<klass, &klass::handle_blacklist>(
this);
- m_work_queue->queue(new C_BlacklistClient(m_ioctx, m_locker.address,
- m_blacklist_expire_seconds, ctx),
- 0);
+ m_asio_engine.get_work_queue()->queue(
+ new C_BlacklistClient(m_ioctx, m_locker.address,
+ m_blacklist_expire_seconds, ctx), 0);
}
template <typename I>
namespace librbd {
+class AsioEngine;
class ImageCtx;
template <typename> class Journal;
namespace asio { struct ContextWQ; }
class BreakRequest {
public:
static BreakRequest* create(librados::IoCtx& ioctx,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
bool force_break_lock, Context *on_finish) {
- return new BreakRequest(ioctx, work_queue, oid, locker, exclusive,
+ return new BreakRequest(ioctx, asio_engine, oid, locker, exclusive,
blacklist_locker, blacklist_expire_seconds,
force_break_lock, on_finish);
}
librados::IoCtx &m_ioctx;
CephContext *m_cct;
- asio::ContextWQ *m_work_queue;
+ AsioEngine& m_asio_engine;
std::string m_oid;
Locker m_locker;
bool m_exclusive;
Locker m_refreshed_locker;
- BreakRequest(librados::IoCtx& ioctx, asio::ContextWQ *work_queue,
+ BreakRequest(librados::IoCtx& ioctx, AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds, bool force_break_lock,
Context *on_finish = nullptr;
static BreakRequest *s_instance;
static BreakRequest* create(librados::IoCtx& ioctx,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
C_SaferCond ctx;
MockAcquireRequest *req = MockAcquireRequest::create(mock_image_ctx.md_ctx,
- mock_image_ctx.image_watcher, ictx->op_work_queue, mock_image_ctx.header_oid,
- TEST_COOKIE, true, true, 0, &ctx);
+ mock_image_ctx.image_watcher, *ictx->asio_engine, mock_image_ctx.header_oid,
+ TEST_COOKIE, true, true, 0, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
}
C_SaferCond ctx;
MockAcquireRequest *req = MockAcquireRequest::create(mock_image_ctx.md_ctx,
- mock_image_ctx.image_watcher, ictx->op_work_queue, mock_image_ctx.header_oid,
- TEST_COOKIE, false, true, 0, &ctx);
+ mock_image_ctx.image_watcher, *ictx->asio_engine, mock_image_ctx.header_oid,
+ TEST_COOKIE, false, true, 0, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
}
C_SaferCond ctx;
MockAcquireRequest *req = MockAcquireRequest::create(mock_image_ctx.md_ctx,
- mock_image_ctx.image_watcher, ictx->op_work_queue, mock_image_ctx.header_oid,
- TEST_COOKIE, true, true, 0, &ctx);
+ mock_image_ctx.image_watcher, *ictx->asio_engine, mock_image_ctx.header_oid,
+ TEST_COOKIE, true, true, 0, &ctx);
req->send();
ASSERT_EQ(-ENOENT, ctx.wait());
}
C_SaferCond ctx;
MockAcquireRequest *req = MockAcquireRequest::create(mock_image_ctx.md_ctx,
- mock_image_ctx.image_watcher, ictx->op_work_queue, mock_image_ctx.header_oid,
- TEST_COOKIE, true, true, 0, &ctx);
+ mock_image_ctx.image_watcher, *ictx->asio_engine, mock_image_ctx.header_oid,
+ TEST_COOKIE, true, true, 0, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
C_SaferCond ctx;
MockAcquireRequest *req = MockAcquireRequest::create(mock_image_ctx.md_ctx,
- mock_image_ctx.image_watcher, ictx->op_work_queue, mock_image_ctx.header_oid,
- TEST_COOKIE, true, true, 0, &ctx);
+ mock_image_ctx.image_watcher, *ictx->asio_engine, mock_image_ctx.header_oid,
+ TEST_COOKIE, true, true, 0, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
C_SaferCond ctx;
MockAcquireRequest *req = MockAcquireRequest::create(mock_image_ctx.md_ctx,
- mock_image_ctx.image_watcher, ictx->op_work_queue, mock_image_ctx.header_oid,
- TEST_COOKIE, true, true, 0, &ctx);
+ mock_image_ctx.image_watcher, *ictx->asio_engine, mock_image_ctx.header_oid,
+ TEST_COOKIE, true, true, 0, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, true, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(-EAGAIN, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, false, 0, false, &ctx);
req->send();
ASSERT_EQ(-EAGAIN, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, false, 0, false, &ctx);
req->send();
ASSERT_EQ(-EAGAIN, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, false, 0, false, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, false, 0, false, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, false, 0, false, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(456), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
MockBreakRequest *req = MockBreakRequest::create(
- mock_image_ctx.md_ctx, ictx->op_work_queue, mock_image_ctx.header_oid,
+ mock_image_ctx.md_ctx, *ictx->asio_engine, mock_image_ctx.header_oid,
locker, true, true, 0, false, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
template <>
struct ManagedLock<MockExclusiveLockImageCtx> {
- ManagedLock(librados::IoCtx& ioctx, asio::ContextWQ *work_queue,
+ ManagedLock(librados::IoCtx& ioctx, AsioEngine& asio_engine,
const std::string& oid, librbd::MockImageWatcher *watcher,
managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
}
struct MockMockManagedLock : public ManagedLock<MockManagedLockImageCtx> {
- MockMockManagedLock(librados::IoCtx& ioctx, asio::ContextWQ *work_queue,
+ MockMockManagedLock(librados::IoCtx& ioctx, AsioEngine& asio_engine,
const std::string& oid, librbd::MockImageWatcher *watcher,
- managed_lock::Mode mode, bool blacklist_on_break_lock,
+ managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
- : ManagedLock<MockManagedLockImageCtx>(ioctx, work_queue, oid, watcher,
+ : ManagedLock<MockManagedLockImageCtx>(ioctx, asio_engine, oid, watcher,
librbd::managed_lock::EXCLUSIVE, true, 0) {
};
virtual ~MockMockManagedLock() = default;
Context *on_finish = nullptr;
static T* create(librados::IoCtx& ioctx, MockImageWatcher *watcher,
- asio::ContextWQ *work_queue, const std::string& oid,
- const std::string& cookie, Context *on_finish) {
+ const std::string& oid, const std::string& cookie,
+ Context *on_finish) {
ceph_assert(!s_requests.empty());
T* req = s_requests.front();
req->on_finish = on_finish;
std::list<T *> BaseRequest<T>::s_requests;
template <>
-struct AcquireRequest<MockManagedLockImageCtx> : public BaseRequest<AcquireRequest<MockManagedLockImageCtx> > {
+struct AcquireRequest<MockManagedLockImageCtx>
+ : public BaseRequest<AcquireRequest<MockManagedLockImageCtx> > {
static AcquireRequest* create(librados::IoCtx& ioctx,
MockImageWatcher *watcher,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid,
const std::string& cookie,
bool exclusive, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds,
Context *on_finish) {
- return BaseRequest::create(ioctx, watcher, work_queue, oid, cookie, on_finish);
+ return BaseRequest::create(ioctx, watcher, oid, cookie, on_finish);
}
MOCK_METHOD0(send, void());
static ReacquireRequest* create(librados::IoCtx &ioctx, const std::string& oid,
const string& old_cookie, const std::string& new_cookie,
bool exclusive, Context *on_finish) {
- return BaseRequest::create(ioctx, nullptr, nullptr, oid, new_cookie,
+ return BaseRequest::create(ioctx, nullptr, oid, new_cookie,
on_finish);
}
asio::ContextWQ *work_queue,
const std::string& oid,
const std::string& cookie, Context *on_finish) {
- return BaseRequest::create(ioctx, watcher, work_queue, oid, cookie,
- on_finish);
+ return BaseRequest::create(ioctx, watcher, oid, cookie, on_finish);
}
MOCK_METHOD0(send, void());
};
template <>
struct BreakRequest<MockManagedLockImageCtx> {
static BreakRequest* create(librados::IoCtx& ioctx,
- asio::ContextWQ *work_queue,
+ AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
.WillOnce(CompleteContext(0, (asio::ContextWQ *)nullptr));
}
- void expect_post_reacquired_lock_handler(MockImageWatcher& watcher,
+ void expect_post_reacquired_lock_handler(MockImageWatcher& watcher,
MockMockManagedLock &managed_lock, uint64_t &client_id) {
expect_get_watch_handle(watcher);
EXPECT_CALL(managed_lock, post_reacquire_lock_handler(_, _))
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockMockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockMockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockMockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockMockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockManagedLockImageCtx mock_image_ctx(*ictx);
- MockMockManagedLock managed_lock(ictx->md_ctx, ictx->op_work_queue,
+ MockMockManagedLock managed_lock(ictx->md_ctx, *ictx->asio_engine,
ictx->header_oid, mock_image_ctx.image_watcher,
librbd::managed_lock::EXCLUSIVE, true, 0);
cct, "rbd_mirror_concurrent_image_syncs"));
m_instance_watcher = InstanceWatcher<>::create(
- m_local_ioctx, m_threads->work_queue, nullptr,
+ m_local_ioctx, *m_threads->asio_engine, nullptr,
m_image_sync_throttler.get());
m_instance_watcher->handle_acquire_leader();
cct, "rbd_mirror_concurrent_image_syncs");
m_instance_watcher = rbd::mirror::InstanceWatcher<>::create(
- m_local_io_ctx, m_threads->work_queue, nullptr, m_image_sync_throttler);
+ m_local_io_ctx, *m_threads->asio_engine, nullptr, m_image_sync_throttler);
m_instance_watcher->handle_acquire_leader();
ContextWQ* context_wq;
TEST_F(TestInstanceWatcher, InitShutdown)
{
- InstanceWatcher<> instance_watcher(m_local_io_ctx, m_threads->work_queue,
+ InstanceWatcher<> instance_watcher(m_local_io_ctx, *m_threads->asio_engine,
nullptr, nullptr, m_instance_id);
std::vector<std::string> instance_ids;
get_instances(&instance_ids);
librados::IoCtx io_ctx;
ASSERT_EQ("", connect_cluster_pp(cluster));
ASSERT_EQ(0, cluster.ioctx_create(_local_pool_name.c_str(), io_ctx));
- InstanceWatcher<> instance_watcher(m_local_io_ctx, m_threads->work_queue,
+ InstanceWatcher<> instance_watcher(m_local_io_ctx, *m_threads->asio_engine,
nullptr, nullptr, "instance_id");
// Init
ASSERT_EQ(0, instance_watcher.init());
// Remove
C_SaferCond on_remove;
- InstanceWatcher<>::remove_instance(m_local_io_ctx, m_threads->work_queue,
+ InstanceWatcher<>::remove_instance(m_local_io_ctx, *m_threads->asio_engine,
"instance_id", &on_remove);
ASSERT_EQ(0, on_remove.wait());
// Remove NOENT
C_SaferCond on_remove_noent;
- InstanceWatcher<>::remove_instance(m_local_io_ctx, m_threads->work_queue,
+ InstanceWatcher<>::remove_instance(m_local_io_ctx, *m_threads->asio_engine,
instance_id, &on_remove_noent);
ASSERT_EQ(0, on_remove_noent.wait());
}
static ManagedLock* s_instance;
static ManagedLock *create(librados::IoCtx& ioctx,
- librbd::asio::ContextWQ *work_queue,
+ librbd::AsioEngine& asio_engine,
const std::string& oid, librbd::Watcher *watcher,
managed_lock::Mode mode,
bool blacklist_on_break_lock,
ceph::mutex &timer_lock;
SafeTimer *timer;
librbd::asio::ContextWQ *work_queue;
+ librbd::AsioEngine* asio_engine;
Threads(Threads<librbd::ImageCtx> *threads)
: timer_lock(threads->timer_lock), timer(threads->timer),
- work_queue(threads->work_queue) {
+ work_queue(threads->work_queue), asio_engine(threads->asio_engine) {
}
};
librados::MockTestMemIoCtxImpl &mock_io_ctx(get_mock_io_ctx(m_local_io_ctx));
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, nullptr, nullptr,
+ m_local_io_ctx, *m_mock_threads->asio_engine, nullptr, nullptr,
m_instance_id);
InSequence seq;
librados::MockTestMemIoCtxImpl &mock_io_ctx(get_mock_io_ctx(m_local_io_ctx));
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, nullptr, nullptr,
+ m_local_io_ctx, *m_mock_threads->asio_engine, nullptr, nullptr,
m_instance_id);
InSequence seq;
librados::MockTestMemIoCtxImpl &mock_io_ctx(get_mock_io_ctx(m_local_io_ctx));
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, nullptr, nullptr,
+ m_local_io_ctx, *m_mock_threads->asio_engine, nullptr, nullptr,
m_instance_id);
InSequence seq;
C_SaferCond on_remove;
MockInstanceWatcher::remove_instance(m_local_io_ctx,
- m_mock_threads->work_queue,
+ *m_mock_threads->asio_engine,
"instance_id", &on_remove);
ASSERT_EQ(0, on_remove.wait());
ASSERT_EQ(0, on_destroy.wait());
C_SaferCond on_remove;
MockInstanceWatcher::remove_instance(m_local_io_ctx,
- m_mock_threads->work_queue,
+ *m_mock_threads->asio_engine,
"instance_id", &on_remove);
ASSERT_EQ(0, on_remove.wait());
ASSERT_EQ(0, on_destroy.wait());
librados::MockTestMemIoCtxImpl &mock_io_ctx1(get_mock_io_ctx(io_ctx1));
MockInstanceReplayer mock_instance_replayer1;
auto instance_watcher1 = MockInstanceWatcher::create(
- io_ctx1, m_mock_threads->work_queue, &mock_instance_replayer1, nullptr);
+ io_ctx1, *m_mock_threads->asio_engine, &mock_instance_replayer1, nullptr);
librados::Rados cluster;
librados::IoCtx io_ctx2;
librados::MockTestMemIoCtxImpl &mock_io_ctx2(get_mock_io_ctx(io_ctx2));
MockInstanceReplayer mock_instance_replayer2;
auto instance_watcher2 = MockInstanceWatcher::create(
- io_ctx2, m_mock_threads->work_queue, &mock_instance_replayer2, nullptr);
+ io_ctx2, *m_mock_threads->asio_engine, &mock_instance_replayer2, nullptr);
InSequence seq;
librados::MockTestMemIoCtxImpl &mock_io_ctx1(get_mock_io_ctx(io_ctx1));
MockInstanceReplayer mock_instance_replayer1;
auto instance_watcher1 = MockInstanceWatcher::create(
- io_ctx1, m_mock_threads->work_queue, &mock_instance_replayer1, nullptr);
+ io_ctx1, *m_mock_threads->asio_engine, &mock_instance_replayer1, nullptr);
librados::Rados cluster;
librados::IoCtx io_ctx2;
librados::MockTestMemIoCtxImpl &mock_io_ctx2(get_mock_io_ctx(io_ctx2));
MockInstanceReplayer mock_instance_replayer2;
auto instance_watcher2 = MockInstanceWatcher::create(
- io_ctx2, m_mock_threads->work_queue, &mock_instance_replayer2, nullptr);
+ io_ctx2, *m_mock_threads->asio_engine, &mock_instance_replayer2, nullptr);
InSequence seq;
librados::MockTestMemIoCtxImpl &mock_io_ctx(get_mock_io_ctx(m_local_io_ctx));
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, nullptr, nullptr,
+ m_local_io_ctx, *m_mock_threads->asio_engine, nullptr, nullptr,
m_instance_id);
InSequence seq;
MockInstanceReplayer mock_instance_replayer;
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, &mock_instance_replayer,
+ m_local_io_ctx, *m_mock_threads->asio_engine, &mock_instance_replayer,
nullptr, m_instance_id);
InSequence seq;
MockInstanceReplayer mock_instance_replayer;
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, &mock_instance_replayer,
+ m_local_io_ctx, *m_mock_threads->asio_engine, &mock_instance_replayer,
nullptr, m_instance_id);
InSequence seq;
librados::MockTestMemIoCtxImpl &mock_io_ctx(get_mock_io_ctx(m_local_io_ctx));
auto instance_watcher = new MockInstanceWatcher(
- m_local_io_ctx, m_mock_threads->work_queue, nullptr, nullptr,
+ m_local_io_ctx, *m_mock_threads->asio_engine, nullptr, nullptr,
m_instance_id);
InSequence seq;
librados::IoCtx& io_ctx1 = m_local_io_ctx;
librados::MockTestMemIoCtxImpl &mock_io_ctx1(get_mock_io_ctx(io_ctx1));
instance_watcher1 = MockInstanceWatcher::create(io_ctx1,
- m_mock_threads->work_queue,
+ *m_mock_threads->asio_engine,
nullptr,
&mock_image_sync_throttler);
EXPECT_EQ("", connect_cluster_pp(cluster));
instance_id2 = stringify(io_ctx2.get_instance_id());
librados::MockTestMemIoCtxImpl &mock_io_ctx2(get_mock_io_ctx(io_ctx2));
instance_watcher2 = MockInstanceWatcher::create(io_ctx2,
- m_mock_threads->work_queue,
+ *m_mock_threads->asio_engine,
nullptr,
&mock_image_sync_throttler);
InSequence seq;
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
+#include "librbd/AsioEngine.h"
#include "librbd/Utils.h"
#include "test/librbd/mock/MockImageCtx.h"
#include "test/rbd_mirror/test_mock_fixture.h"
template <>
struct ManagedLock<MockTestImageCtx> {
- ManagedLock(librados::IoCtx& ioctx, librbd::asio::ContextWQ *work_queue,
+ ManagedLock(librados::IoCtx& ioctx, librbd::AsioEngine& asio_engine,
const std::string& oid, librbd::Watcher *watcher,
managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
- : m_work_queue(work_queue) {
+ : m_work_queue(asio_engine.get_work_queue()) {
MockManagedLock::get_instance().construct();
}
ceph::mutex &timer_lock;
SafeTimer *timer;
librbd::asio::ContextWQ *work_queue;
+ librbd::AsioEngine* asio_engine;
Threads(Threads<librbd::ImageCtx> *threads)
: timer_lock(threads->timer_lock), timer(threads->timer),
- work_queue(threads->work_queue) {
+ work_queue(threads->work_queue), asio_engine(threads->asio_engine) {
}
};
static InstanceWatcher* s_instance;
static InstanceWatcher* create(
- librados::IoCtx &ioctx, librbd::asio::ContextWQ* work_queue,
+ librados::IoCtx &ioctx, librbd::AsioEngine& asio_engine,
InstanceReplayer<librbd::MockTestImageCtx>* instance_replayer,
Throttler<librbd::MockTestImageCtx> *image_sync_throttler) {
ceph_assert(s_instance != nullptr);
ceph::mutex &timer_lock;
SafeTimer *timer;
librbd::asio::ContextWQ *work_queue;
+ librbd::AsioEngine* asio_engine;
Threads(Threads<librbd::ImageCtx> *threads)
: timer_lock(threads->timer_lock), timer(threads->timer),
- work_queue(threads->work_queue) {
+ work_queue(threads->work_queue), asio_engine(threads->asio_engine) {
}
};
#include "common/debug.h"
#include "common/errno.h"
#include "cls/rbd/cls_rbd_client.h"
+#include "librbd/AsioEngine.h"
#include "librbd/ManagedLock.h"
#include "librbd/Utils.h"
#include "librbd/asio/ContextWQ.h"
Context *on_finish;
C_RemoveInstanceRequest(librados::IoCtx &io_ctx,
- librbd::asio::ContextWQ *work_queue,
+ librbd::AsioEngine& asio_engine,
const std::string &instance_id, Context *on_finish)
- : instance_watcher(io_ctx, work_queue, nullptr, nullptr, instance_id),
+ : instance_watcher(io_ctx, asio_engine, nullptr, nullptr, instance_id),
on_finish(on_finish) {
}
template <typename I>
void InstanceWatcher<I>::remove_instance(librados::IoCtx &io_ctx,
- librbd::asio::ContextWQ *work_queue,
+ librbd::AsioEngine& asio_engine,
const std::string &instance_id,
Context *on_finish) {
- auto req = new C_RemoveInstanceRequest<I>(io_ctx, work_queue, instance_id,
+ auto req = new C_RemoveInstanceRequest<I>(io_ctx, asio_engine, instance_id,
on_finish);
req->send();
}
template <typename I>
InstanceWatcher<I> *InstanceWatcher<I>::create(
- librados::IoCtx &io_ctx, librbd::asio::ContextWQ *work_queue,
+ librados::IoCtx &io_ctx, librbd::AsioEngine& asio_engine,
InstanceReplayer<I> *instance_replayer,
Throttler<I> *image_sync_throttler) {
- return new InstanceWatcher<I>(io_ctx, work_queue, instance_replayer,
+ return new InstanceWatcher<I>(io_ctx, asio_engine, instance_replayer,
image_sync_throttler,
stringify(io_ctx.get_instance_id()));
}
template <typename I>
InstanceWatcher<I>::InstanceWatcher(librados::IoCtx &io_ctx,
- librbd::asio::ContextWQ *work_queue,
+ librbd::AsioEngine& asio_engine,
InstanceReplayer<I> *instance_replayer,
Throttler<I> *image_sync_throttler,
const std::string &instance_id)
- : Watcher(io_ctx, work_queue, RBD_MIRROR_INSTANCE_PREFIX + instance_id),
+ : Watcher(io_ctx, asio_engine.get_work_queue(),
+ RBD_MIRROR_INSTANCE_PREFIX + instance_id),
m_instance_replayer(instance_replayer),
m_image_sync_throttler(image_sync_throttler), m_instance_id(instance_id),
m_lock(ceph::make_mutex(
unique_lock_name("rbd::mirror::InstanceWatcher::m_lock", this))),
m_instance_lock(librbd::ManagedLock<I>::create(
- m_ioctx, m_work_queue, m_oid, this, librbd::managed_lock::EXCLUSIVE, true,
+ m_ioctx, asio_engine, m_oid, this, librbd::managed_lock::EXCLUSIVE, true,
m_cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"))) {
}
namespace librbd {
+class AsioEngine;
class ImageCtx;
template <typename> class ManagedLock;
-namespace asio { struct ContextWQ; }
} // namespace librbd
std::vector<std::string> *instance_ids,
Context *on_finish);
static void remove_instance(librados::IoCtx &io_ctx,
- librbd::asio::ContextWQ *work_queue,
+ librbd::AsioEngine& asio_engine,
const std::string &instance_id,
Context *on_finish);
static InstanceWatcher *create(
- librados::IoCtx &io_ctx, librbd::asio::ContextWQ *work_queue,
+ librados::IoCtx &io_ctx, librbd::AsioEngine& asio_engine,
InstanceReplayer<ImageCtxT> *instance_replayer,
Throttler<ImageCtxT> *image_sync_throttler);
void destroy() {
delete this;
}
- InstanceWatcher(librados::IoCtx &io_ctx, librbd::asio::ContextWQ *work_queue,
+ InstanceWatcher(librados::IoCtx &io_ctx, librbd::AsioEngine& asio_engine,
InstanceReplayer<ImageCtxT> *instance_replayer,
Throttler<ImageCtxT> *image_sync_throttler,
const std::string &instance_id);
auto gather_ctx = new C_Gather(m_cct, ctx);
for (auto& instance_id : instance_ids) {
- InstanceWatcher<I>::remove_instance(m_ioctx, m_threads->work_queue,
+ InstanceWatcher<I>::remove_instance(m_ioctx, *m_threads->asio_engine,
instance_id, gather_ctx->new_sub());
}
io_ctx.get_pool_name())),
m_notifier_id(librados::Rados(io_ctx).get_instance_id()),
m_instance_id(stringify(m_notifier_id)),
- m_leader_lock(new LeaderLock(m_ioctx, m_work_queue, m_oid, this, true,
- m_cct->_conf.get_val<uint64_t>(
+ m_leader_lock(new LeaderLock(m_ioctx, *m_threads->asio_engine, m_oid, this,
+ true, m_cct->_conf.get_val<uint64_t>(
"rbd_blacklist_expire_seconds"))) {
}
public:
typedef librbd::ManagedLock<ImageCtxT> Parent;
- LeaderLock(librados::IoCtx& ioctx, librbd::asio::ContextWQ *work_queue,
+ LeaderLock(librados::IoCtx& ioctx, librbd::AsioEngine& asio_engine,
const std::string& oid, LeaderWatcher *watcher,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
- : Parent(ioctx, work_queue, oid, watcher, librbd::managed_lock::EXCLUSIVE,
- blacklist_on_break_lock, blacklist_expire_seconds),
+ : Parent(ioctx, asio_engine, oid, watcher,
+ librbd::managed_lock::EXCLUSIVE, blacklist_on_break_lock,
+ blacklist_expire_seconds),
watcher(watcher) {
}
ceph_assert(!m_instance_watcher);
m_instance_watcher.reset(InstanceWatcher<I>::create(
- m_local_io_ctx, m_threads->work_queue, m_instance_replayer.get(),
+ m_local_io_ctx, *m_threads->asio_engine, m_instance_replayer.get(),
m_image_sync_throttler));
auto ctx = create_context_callback<NamespaceReplayer<I>,
&NamespaceReplayer<I>::handle_init_instance_watcher>(this);
template <typename ImageCtxT = librbd::ImageCtx>
class Threads {
-private:
- librbd::AsioEngine* asio_engine = nullptr;
-
public:
+ librbd::AsioEngine* asio_engine = nullptr;
librbd::asio::ContextWQ* work_queue = nullptr;
SafeTimer *timer = nullptr;