if (op->oncommit) {
op->oncommit->complete(-ENOENT);
}
+ if (op->oncommit_sync) {
+ op->oncommit_sync->complete(-ENOENT);
+ }
OSDSession *s = op->session;
assert(s != NULL);
op->oncommit->complete(r);
op->oncommit = NULL;
}
+ if (op->oncommit_sync) {
+ op->oncommit_sync->complete(r);
+ op->oncommit_sync = NULL;
+ }
_op_cancel_map_check(op);
_finish_op(op);
s->lock.unlock();
assert(!op->should_resend);
delete op->onack;
delete op->oncommit;
+ delete op->oncommit_sync;
_finish_op(op);
}
num_unacked.dec();
logger->inc(l_osdc_op_ack);
}
- if (op->oncommit && (m->is_ondisk() || rc)) {
- ldout(cct, 15) << "handle_osd_op_reply safe" << dendl;
- oncommit = op->oncommit;
- op->oncommit = 0;
- num_uncommitted.dec();
- logger->inc(l_osdc_op_commit);
- }
- if (op->oncommit_sync) {
- op->oncommit_sync->complete(rc);
- op->oncommit_sync = NULL;
- num_uncommitted.dec();
- logger->inc(l_osdc_op_commit);
+ if (m->is_ondisk() || rc) {
+ if (op->oncommit) {
+ ldout(cct, 15) << "handle_osd_op_reply safe" << dendl;
+ oncommit = op->oncommit;
+ op->oncommit = NULL;
+ num_uncommitted.dec();
+ logger->inc(l_osdc_op_commit);
+ }
+ if (op->oncommit_sync) {
+ ldout(cct, 15) << "handle_osd_op_reply safe (sync)" << dendl;
+ op->oncommit_sync->complete(rc);
+ op->oncommit_sync = NULL;
+ num_uncommitted.dec();
+ logger->inc(l_osdc_op_commit);
+ }
}
/* get it before we call _finish_op() */
Mutex *completion_lock = (op->target.base_oid.name.size() ? s->get_lock(op->target.base_oid) : NULL);
// done with this tid?
- if (!op->onack && !op->oncommit) {
+ if (!op->onack && !op->oncommit && !op->oncommit_sync) {
ldout(cct, 15) << "handle_osd_op_reply completed tid " << tid << dendl;
_finish_op(op);
}