Context* register_ctx = new FunctionContext([this, cct, on_finish](int ret) {
if (ret < 0) {
lderr(cct) << "Parent cache fail to register client." << dendl;
- handle_register_client(false);
- on_finish->complete(-1);
- return;
+ } else {
+ ceph_assert(m_cache_client->is_session_work());
}
- ceph_assert(m_cache_client->is_session_work());
-
- handle_register_client(true);
- on_finish->complete(0);
+ handle_register_client(ret < 0 ? false : true);
+ on_finish->complete(ret);
});
Context* connect_ctx = new FunctionContext(
bool startup_lookupobject_testing(std::string pool_nspace, std::string object_id) {
bool hit;
- //auto ctx = new LambdaGenContext<std::function<void(ObjectCacheRequest*)>,
- // ObjectCacheRequest*>([this, &hit](ObjectCacheRequest* ack){
auto ctx = make_gen_lambda_context<ObjectCacheRequest*, std::function<void(ObjectCacheRequest*)>>
([this, &hit](ObjectCacheRequest* ack){
hit = ack->type == RBDSC_READ_REPLY;