CephContext *cct = reinterpret_cast<CephContext *>(io_ctx.cct());
ldout(cct, 20) << dendl;
- std::string local_namespace = io_ctx.get_namespace();
-
- if (local_namespace.empty() && !remote_namespace.empty()) {
- lderr(cct) << "cannot mirror the default namespace to a "
- << "non-default namespace." << dendl;
- return -EINVAL;
- }
-
- if (!local_namespace.empty() && remote_namespace.empty()) {
- lderr(cct) << "cannot mirror a non-default namespace to the default "
- << "namespace." << dendl;
- return -EINVAL;
- }
-
int r = cls_client::mirror_remote_namespace_set(&io_ctx, remote_namespace);
if (r < 0) {
lderr(cct) << "failed to set remote mirror namespace: "
auto it = m_entities.find(entity);
if (it != m_entities.end()) {
m_entities.erase(entity);
+ m_entities.insert({entity, id});
}
- m_entities.insert({entity, id});
}
m_pending_removed_entities.clear();