return -EEXIST;
}
- if (m_image_ctx.test_features(RBD_FEATURE_JOURNALING)) {
- r = invoke_async_request("rename",
- exclusive_lock::OPERATION_REQUEST_TYPE_GENERAL,
- true,
- boost::bind(&Operations<I>::execute_rename, this,
- dstname, _1),
- boost::bind(&ImageWatcher<I>::notify_rename,
- m_image_ctx.image_watcher, dstname,
- _1));
- if (r < 0 && r != -EEXIST) {
- return r;
- }
- } else {
- C_SaferCond cond_ctx;
- {
- std::shared_lock owner_lock{m_image_ctx.owner_lock};
- execute_rename(dstname, &cond_ctx);
- }
-
- r = cond_ctx.wait();
- if (r < 0) {
- return r;
- }
+ r = invoke_async_request("rename",
+ exclusive_lock::OPERATION_REQUEST_TYPE_GENERAL,
+ true,
+ boost::bind(&Operations<I>::execute_rename, this,
+ dstname, _1),
+ boost::bind(&ImageWatcher<I>::notify_rename,
+ m_image_ctx.image_watcher, dstname,
+ _1));
+ if (r < 0 && r != -EEXIST) {
+ return r;
}
m_image_ctx.set_image_name(dstname);