All the users of rbd_ctx_cb() do this separately right now, but
there's no reason to keep the completion around after the nested
completion has been called. Also declare rbd_ctx_cb() in the header
so it can be used before its definition.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Context *ctx = reinterpret_cast<Context *>(arg);
AioCompletion *comp = reinterpret_cast<AioCompletion *>(cb);
ctx->complete(comp->get_return_value());
+ comp->release();
}
int64_t read_iterate(ImageCtx *ictx, uint64_t off, uint64_t len,
cond.Wait(mylock);
mylock.Unlock();
- c->release();
if (ret < 0)
return ret;
cond.Wait(mylock);
mylock.Unlock();
- c->release();
return ret;
}
cond.Wait(mylock);
mylock.Unlock();
- c->release();
if (ret < 0)
return ret;
cond.Wait(mylock);
mylock.Unlock();
- c->release();
if (ret < 0)
return ret;
void rados_req_cb(rados_completion_t cb, void *arg);
void rados_ctx_cb(rados_completion_t cb, void *arg);
void rbd_req_cb(completion_t cb, void *arg);
+ void rbd_ctx_cb(completion_t cb, void *arg);
}
#endif