if (!session_locked) {
s->lock.get_write();
}
- _finish_op(op);
+ _finish_op(op, 0);
if (!session_locked) {
s->lock.unlock();
}
op->oncommit_sync = NULL;
}
_op_cancel_map_check(op);
- _finish_op(op);
+ _finish_op(op, r);
s->lock.unlock();
return 0;
num_uncommitted.dec();
}
- _finish_op(op);
+ _finish_op(op, 0);
}
-void Objecter::_finish_op(Op *op)
+void Objecter::_finish_op(Op *op, int r)
{
ldout(cct, 15) << "finish_op " << op->tid << dendl;
if (!op->ctx_budgeted && op->budgeted)
put_op_budget(op);
- if (op->ontimeout) {
+ if (op->ontimeout && r != -ETIMEDOUT) {
Mutex::Locker l(timer_lock);
timer.cancel_event(op->ontimeout);
}
Op *op = iter->second;
- _finish_op(op);
+ _finish_op(op, 0);
}
MOSDOp *Objecter::_prepare_osd_op(Op *op)
// done with this tid?
if (!op->onack && !op->oncommit && !op->oncommit_sync) {
ldout(cct, 15) << "handle_osd_op_reply completed tid " << tid << dendl;
- _finish_op(op);
+ _finish_op(op, 0);
}
ldout(cct, 5) << num_unacked.read() << " unacked, " << num_uncommitted.read() << " uncommitted" << dendl;
}
iter = pool_ops.find(tid);
if (iter != pool_ops.end()) {
- _finish_pool_op(op);
+ _finish_pool_op(op, 0);
}
} else {
ldout(cct, 10) << "unknown request " << tid << dendl;
if (op->onfinish)
op->onfinish->complete(r);
- _finish_pool_op(op);
+ _finish_pool_op(op, r);
return 0;
}
-void Objecter::_finish_pool_op(PoolOp *op)
+void Objecter::_finish_pool_op(PoolOp *op, int r)
{
assert(rwlock.is_wlocked());
pool_ops.erase(op->tid);
logger->set(l_osdc_poolop_active, pool_ops.size());
- if (op->ontimeout) {
+ if (op->ontimeout && r != -ETIMEDOUT) {
Mutex::Locker l(timer_lock);
timer.cancel_event(op->ontimeout);
}
last_seen_pgmap_version = m->version;
}
op->onfinish->complete(0);
- _finish_pool_stat_op(op);
+ _finish_pool_stat_op(op, 0);
} else {
ldout(cct, 10) << "unknown request " << tid << dendl;
}
PoolStatOp *op = it->second;
if (op->onfinish)
op->onfinish->complete(r);
- _finish_pool_stat_op(op);
+ _finish_pool_stat_op(op, r);
return 0;
}
-void Objecter::_finish_pool_stat_op(PoolStatOp *op)
+void Objecter::_finish_pool_stat_op(PoolStatOp *op, int r)
{
assert(rwlock.is_wlocked());
poolstat_ops.erase(op->tid);
logger->set(l_osdc_poolstat_active, poolstat_ops.size());
- if (op->ontimeout) {
+ if (op->ontimeout && r != -ETIMEDOUT) {
Mutex::Locker l(timer_lock);
timer.cancel_event(op->ontimeout);
}
if (m->h.version > last_seen_pgmap_version)
last_seen_pgmap_version = m->h.version;
op->onfinish->complete(0);
- _finish_statfs_op(op);
+ _finish_statfs_op(op, 0);
} else {
ldout(cct, 10) << "unknown request " << tid << dendl;
}
StatfsOp *op = it->second;
if (op->onfinish)
op->onfinish->complete(r);
- _finish_statfs_op(op);
+ _finish_statfs_op(op, r);
return 0;
}
-void Objecter::_finish_statfs_op(StatfsOp *op)
+void Objecter::_finish_statfs_op(StatfsOp *op, int r)
{
assert(rwlock.is_wlocked());
statfs_ops.erase(op->tid);
logger->set(l_osdc_statfs_active, statfs_ops.size());
- if (op->ontimeout) {
+ if (op->ontimeout && r != -ETIMEDOUT) {
Mutex::Locker l(timer_lock);
timer.cancel_event(op->ontimeout);
}
CommandOp *op = it->second;
_command_cancel_map_check(op);
- _finish_command(op, -ETIMEDOUT, "");
+ _finish_command(op, r, "");
return 0;
}
if (c->onfinish)
c->onfinish->complete(r);
- if (c->ontimeout) {
+ if (c->ontimeout && r != -ETIMEDOUT) {
Mutex::Locker l(timer_lock);
timer.cancel_event(c->ontimeout);
}
void _send_op_account(Op *op);
void _cancel_linger_op(Op *op);
void finish_op(OSDSession *session, ceph_tid_t tid);
- void _finish_op(Op *op);
+ void _finish_op(Op *op, int r);
static bool is_pg_changed(
int oldprimary,
const vector<int>& oldacting,
private:
void pool_op_submit(PoolOp *op);
void _pool_op_submit(PoolOp *op);
- void _finish_pool_op(PoolOp *op);
+ void _finish_pool_op(PoolOp *op, int r);
void _do_delete_pool(int64_t pool, Context *onfinish);
public:
int create_pool_snap(int64_t pool, string& snapName, Context *onfinish);
void get_pool_stats(list<string>& pools, map<string,pool_stat_t> *result,
Context *onfinish);
int pool_stat_op_cancel(ceph_tid_t tid, int r);
- void _finish_pool_stat_op(PoolStatOp *op);
+ void _finish_pool_stat_op(PoolStatOp *op, int r);
// ---------------------------
// df stats
void handle_fs_stats_reply(MStatfsReply *m);
void get_fs_stats(struct ceph_statfs& result, Context *onfinish);
int statfs_op_cancel(ceph_tid_t tid, int r);
- void _finish_statfs_op(StatfsOp *op);
+ void _finish_statfs_op(StatfsOp *op, int r);
// ---------------------------
// some scatter/gather hackery