<< "dst_snaps=" << dst_snap_ids << dendl;
librados::ObjectWriteOperation op;
- if (!m_dst_image_ctx->migration_info.empty()) {
+
+ bool migration = ((m_flags & OBJECT_COPY_REQUEST_FLAG_MIGRATION) != 0);
+ if (migration) {
ldout(m_cct, 20) << "assert_snapc_seq=" << dst_snap_seq << dendl;
cls_client::assert_snapc_seq(&op, dst_snap_seq,
cls::rbd::ASSERT_SNAPC_SEQ_GT_SNAPSET_SEQ);
}
}
- if (op.size() == (m_dst_image_ctx->migration_info.empty() ? 0 : 1)) {
+ if (op.size() == (migration ? 1 : 0)) {
handle_write_object(0);
return;
}
namespace deep_copy {
enum {
- OBJECT_COPY_REQUEST_FLAG_FLATTEN = 1U << 0,
+ OBJECT_COPY_REQUEST_FLAG_FLATTEN = 1U << 0,
+ OBJECT_COPY_REQUEST_FLAG_MIGRATION = 1U << 1,
};
typedef std::vector<librados::snap_t> SnapIds;
ldout(cct, 20) << "flatten=" << m_flatten << dendl;
- uint32_t flags = 0;
+ uint32_t flags = deep_copy::OBJECT_COPY_REQUEST_FLAG_MIGRATION;
if (m_flatten) {
flags |= deep_copy::OBJECT_COPY_REQUEST_FLAG_FLATTEN;
}
} else {
ceph_assert(image_ctx.parent != nullptr);
- uint32_t flags = 0;
+ uint32_t flags = deep_copy::OBJECT_COPY_REQUEST_FLAG_MIGRATION;
if (image_ctx.migration_info.flatten) {
flags |= deep_copy::OBJECT_COPY_REQUEST_FLAG_FLATTEN;
}