void Objecter::_unregister_linger(uint64_t linger_id)
{
+ assert(rwlock.is_wlocked());
+
map<uint64_t, LingerOp*>::iterator iter = linger_ops.find(linger_id);
if (iter != linger_ops.end()) {
LingerOp *info = iter->second;
op->map_dne_bound = latest;
objecter->_check_op_pool_dne(op, false);
+
+ op->put();
}
int Objecter::pool_snap_by_name(int64_t poolid, const char *snap_name, snapid_t *snap)
assert(rwlock.is_wlocked());
// ask the monitor
if (check_latest_map_ops.count(op->tid) == 0) {
+ op->get();
check_latest_map_ops[op->tid] = op;
C_Op_Map_Latest *c = new C_Op_Map_Latest(this, op->tid);
monc->get_version("osdmap", &c->latest, NULL, c);
map<ceph_tid_t, Op*>::iterator iter =
check_latest_map_ops.find(op->tid);
if (iter != check_latest_map_ops.end()) {
+ Op *op = iter->second;
+ op->put();
check_latest_map_ops.erase(iter);
}
}
r = _calc_target(&op->target);
check_for_latest_map = (r == RECALC_OP_TARGET_POOL_DNE);
if (_get_session(op->target.osd, &s, lc) == -EAGAIN ||
- check_for_latest_map) {
+ (check_for_latest_map && lc.is_rlocked())) {
lc.promote();
continue;
}
{
ldout(cct, 15) << "finish_op " << op->tid << dendl;
+ assert(op->session->lock.is_wlocked());
+
if (op->budgeted)
put_op_budget(op);
- assert(op->session->lock.is_wlocked());
-
op->session->ops.erase(op->tid);
logger->dec(l_osdc_op_active);
inflight_ops.dec();
- delete op;
+ op->put();
}
void Objecter::finish_op(OSDSession *session, ceph_tid_t tid)
void dump(Formatter *f) const;
};
- struct Op {
+ struct Op : public RefCountedObject {
OSDSession *session;
int incarnation;
if (target.base_oloc.key == o)
target.base_oloc.key.clear();
}
+
+ bool operator<(const Op& other) const {
+ return tid < other.tid;
+ }
+
+ private:
~Op() {
while (!out_handler.empty()) {
delete out_handler.back();
out_handler.pop_back();
}
}
-
- bool operator<(const Op& other) const {
- return tid < other.tid;
- }
};
struct C_Op_Map_Latest : public Context {