C_SaferCond* on_finish = new C_SaferCond;
- image_ctx->state->open(false, on_finish);
+ image_ctx->state->open(0, on_finish);
ictxs.push_back(image_ctx);
on_finishes.push_back(on_finish);
auto ctx = create_context_callback<
DetachChildRequest<I>,
&DetachChildRequest<I>::handle_clone_v2_open_parent>(this);
- m_parent_image_ctx->state->open(true, ctx);
+ m_parent_image_ctx->state->open(OPEN_FLAG_SKIP_OPEN_PARENT, ctx);
}
template<typename I>
Context *ctx = create_context_callback<klass, &klass::handle_open_image>(
this);
- m_image_ctx->state->open(true, ctx);
+ m_image_ctx->state->open(OPEN_FLAG_SKIP_OPEN_PARENT, ctx);
}
template<typename I>
*ictx = new librbd::ImageCtx(image_name.c_str(), "", nullptr, m_ioctx, false);
m_ictxs.insert(*ictx);
- return (*ictx)->state->open(false);
+ return (*ictx)->state->open(0);
}
int TestFixture::snap_create(librbd::ImageCtx &ictx,
close_image(ictx);
ictx = new librbd::ImageCtx("", id, nullptr, m_ioctx, true);
- ASSERT_EQ(0, ictx->state->open(false));
+ ASSERT_EQ(0, ictx->state->open(0));
ASSERT_EQ(ictx->name, m_image_name);
close_image(ictx);
}
ASSERT_EQ(0, open_image(m_image_name, &ictx));
ictx = new librbd::ImageCtx(m_image_name, "", "unknown_snap", m_ioctx, true);
- ASSERT_EQ(-ENOENT, ictx->state->open(true));
+ ASSERT_EQ(-ENOENT, ictx->state->open(librbd::OPEN_FLAG_SKIP_OPEN_PARENT));
}
TEST_F(TestInternal, IsExclusiveLockOwner) {
if (!ictx) {
ictx = new ImageCtx("", m_local_image_id, "", m_local_io_ctx,
false);
- r = ictx->state->open(false);
+ r = ictx->state->open(0);
close = (r == 0);
}
if (!ictx) {
ictx = new ImageCtx("", m_local_image_id, "", m_local_io_ctx,
false);
- EXPECT_EQ(0, ictx->state->open(false));
+ EXPECT_EQ(0, ictx->state->open(0));
close = true;
}
void create_snapshot(std::string snap_name="snap1", bool protect=false) {
ImageCtx *ictx = new ImageCtx("", m_local_image_id, "", m_local_io_ctx,
false);
- EXPECT_EQ(0, ictx->state->open(false));
+ EXPECT_EQ(0, ictx->state->open(0));
{
RWLock::WLocker snap_locker(ictx->snap_lock);
ictx->set_journal_policy(new librbd::journal::DisabledPolicy());
std::string create_clone() {
ImageCtx *ictx = new ImageCtx("", m_local_image_id, "", m_local_io_ctx,
false);
- EXPECT_EQ(0, ictx->state->open(false));
+ EXPECT_EQ(0, ictx->state->open(0));
{
RWLock::WLocker snap_locker(ictx->snap_lock);
ictx->set_journal_policy(new librbd::journal::DisabledPolicy());
void check_image_deleted() {
ImageCtx *ictx = new ImageCtx("", m_local_image_id, "", m_local_io_ctx,
false);
- EXPECT_EQ(-ENOENT, ictx->state->open(false));
+ EXPECT_EQ(-ENOENT, ictx->state->open(0));
cls::rbd::MirrorImage mirror_image;
EXPECT_EQ(-ENOENT, cls_client::mirror_image_get(&m_local_io_ctx,
{
librbd::ImageCtx *ictx = new librbd::ImageCtx(image_name.c_str(),
"", "", ioctx, readonly);
- EXPECT_EQ(0, ictx->state->open(false));
+ EXPECT_EQ(0, ictx->state->open(0));
*ictxp = ictx;
}
{
librbd::ImageCtx *ictx = new librbd::ImageCtx(parent_image_name.c_str(),
"", "", pioctx, false);
- ictx->state->open(false);
+ ictx->state->open(0);
EXPECT_EQ(0, ictx->operations->snap_create(cls::rbd::UserSnapshotNamespace(),
snap_name.c_str()));
EXPECT_EQ(0, ictx->operations->snap_protect(cls::rbd::UserSnapshotNamespace(),
*image_ctx = new librbd::ImageCtx(image_name.c_str(), "", nullptr, io_ctx,
false);
m_image_ctxs.insert(*image_ctx);
- return (*image_ctx)->state->open(false);
+ return (*image_ctx)->state->open(0);
}
int TestFixture::create_snap(librbd::ImageCtx *image_ctx, const char* snap_name,
Context *ctx = create_context_callback<
TrashMoveRequest<I>, &TrashMoveRequest<I>::handle_open_image>(this);
- m_image_ctx->state->open(true, ctx);
+ m_image_ctx->state->open(librbd::OPEN_FLAG_SKIP_OPEN_PARENT, ctx);
}
template <typename I>