RWLock::Context lc(rwlock, RWLock::Context::TakenForWrite);
vector<OSDOp> opv;
- Context *onack = NULL;
Context *oncommit = NULL;
if (info->registered && info->is_watch) {
ldout(cct, 15) << "send_linger " << info->linger_id << " reconnect" << dendl;
}
Op *o = new Op(info->target.base_oid, info->target.base_oloc,
opv, info->target.flags | CEPH_OSD_FLAG_READ,
- onack, oncommit,
+ NULL, NULL,
info->pobjver);
+ o->oncommit_sync = oncommit;
o->snapid = info->snap;
o->snapc = info->snapc;
o->mtime = info->mtime;
C_Linger_Ping *onack = new C_Linger_Ping(this, info);
Op *o = new Op(info->target.base_oid, info->target.base_oloc,
opv, info->target.flags | CEPH_OSD_FLAG_READ,
- onack, NULL, NULL);
+ NULL, NULL, NULL);
+ o->oncommit_sync = onack;
o->target = info->target;
o->should_resend = false;
_send_op_account(o);
int flags = op->target.flags;
flags |= CEPH_OSD_FLAG_KNOWN_REDIR;
- if (op->oncommit)
+ if (op->oncommit || op->oncommit_sync)
flags |= CEPH_OSD_FLAG_ONDISK;
if (op->onack)
flags |= CEPH_OSD_FLAG_ACK;
num_uncommitted.dec();
logger->inc(l_osdc_op_commit);
}
+ if (op->oncommit_sync) {
+ op->oncommit_sync->complete(rc);
+ op->oncommit_sync = NULL;
+ }
/* get it before we call _finish_op() */
Mutex *completion_lock = (op->target.base_oid.name.size() ? s->get_lock(op->target.base_oid) : NULL);
int priority;
Context *onack, *oncommit, *ontimeout;
+ Context *oncommit_sync; // used internally by watch/notify
ceph_tid_t tid;
eversion_t replay_version; // for op replay
con(NULL),
snapid(CEPH_NOSNAP),
outbl(NULL),
- priority(0), onack(ac), oncommit(co),
+ priority(0),
+ onack(ac),
+ oncommit(co),
ontimeout(NULL),
- tid(0), attempts(0),
- objver(ov), reply_epoch(NULL),
+ oncommit_sync(NULL),
+ tid(0),
+ attempts(0),
+ objver(ov),
+ reply_epoch(NULL),
map_dne_bound(0),
budgeted(false),
should_resend(true),