bool permit_snapshot;
boost::function<void(Context*)> local;
boost::function<void(Context*)> remote;
- std::set<int> filter_error_codes;
Context *on_finish;
bool request_lock = false;
bool permit_snapshot,
const boost::function<void(Context*)>& local,
const boost::function<void(Context*)>& remote,
- const std::set<int> &filter_error_codes,
Context *on_finish)
: image_ctx(image_ctx), operation(operation), request_type(request_type),
permit_snapshot(permit_snapshot), local(local), remote(remote),
- filter_error_codes(filter_error_codes), on_finish(on_finish) {
+ on_finish(on_finish) {
}
void send() {
}
void finish(int r) override {
- if (filter_error_codes.count(r) != 0) {
- r = 0;
- }
on_finish->complete(r);
}
};
m_image_ctx.image_watcher, request_id,
boost::ref(prog_ctx), _1));
- if (r < 0 && r != -EINVAL) {
- return r;
- }
ldout(cct, 20) << "flatten finished" << dendl;
- return 0;
+ return r;
}
template <typename I>
boost::ref(prog_ctx), _1));
ldout(cct, 10) << "rebuild object map finished" << dendl;
- if (r < 0) {
- return r;
- }
- return 0;
+ return r;
}
template <typename I>
boost::bind(&ImageWatcher<I>::notify_rename,
m_image_ctx.image_watcher, request_id,
dstname, _1));
- if (r < 0 && r != -EEXIST) {
- return r;
- }
m_image_ctx.set_image_name(dstname);
- return 0;
+ return r;
}
template <typename I>
boost::bind(&ImageWatcher<I>::notify_snap_create, m_image_ctx.image_watcher,
request_id, snap_namespace, snap_name, flags,
boost::ref(prog_ctx), _1),
- {-EEXIST}, on_finish);
+ on_finish);
req->send();
}
boost::bind(&ImageWatcher<I>::notify_snap_remove,
m_image_ctx.image_watcher, request_id, snap_namespace,
snap_name, _1),
- {-ENOENT}, on_finish);
+ on_finish);
req->send();
} else {
std::shared_lock owner_lock{m_image_ctx.owner_lock};
boost::bind(&ImageWatcher<I>::notify_snap_rename,
m_image_ctx.image_watcher, request_id,
snap_id, dstname, _1));
- if (r < 0 && r != -EEXIST) {
- return r;
- }
} else {
C_SaferCond cond_ctx;
{
}
r = cond_ctx.wait();
- if (r < 0) {
- return r;
- }
}
m_image_ctx.perfcounter->inc(l_librbd_snap_rename);
- return 0;
+ return r;
}
template <typename I>
boost::bind(&ImageWatcher<I>::notify_snap_protect,
m_image_ctx.image_watcher, request_id,
snap_namespace, snap_name, _1));
- if (r < 0 && r != -EBUSY) {
- return r;
- }
} else {
C_SaferCond cond_ctx;
{
}
r = cond_ctx.wait();
- if (r < 0) {
- return r;
- }
}
- return 0;
+
+ return r;
}
template <typename I>
boost::bind(&ImageWatcher<I>::notify_snap_unprotect,
m_image_ctx.image_watcher, request_id,
snap_namespace, snap_name, _1));
- if (r < 0 && r != -EINVAL) {
- return r;
- }
} else {
C_SaferCond cond_ctx;
{
}
r = cond_ctx.wait();
- if (r < 0) {
- return r;
- }
}
- return 0;
+
+ return r;
}
template <typename I>
boost::bind(&ImageWatcher<I>::notify_metadata_remove,
m_image_ctx.image_watcher, request_id,
key, _1));
- if (r == -ENOENT) {
- r = 0;
- }
std::string config_key;
if (util::is_metadata_config_override(key, &config_key) && r >= 0) {
m_image_ctx.image_watcher, request_id,
boost::ref(prog_ctx), _1));
- if (r < 0 && r != -EINVAL) {
- return r;
- }
ldout(cct, 20) << "migrate finished" << dendl;
- return 0;
+ return r;
}
template <typename I>
m_image_ctx.image_watcher,
request_id, sparse_size,
boost::ref(prog_ctx), _1));
- if (r < 0 && r != -EINVAL) {
- return r;
- }
+
ldout(cct, 20) << "resparsify finished" << dendl;
- return 0;
+ return r;
}
template <typename I>
permit_snapshot,
local_request,
remote_request,
- {}, &ctx);
+ &ctx);
req->send();
return ctx.wait();
}