return 1;
}
-bs::error_code Objecter::handle_osd_op_reply2(Op *op, vector<OSDOp> &out_ops) {
+bs::error_code Objecter::process_op_reply_handlers(Op *op, vector<OSDOp> &out_ops) {
ceph_assert(op->ops.size() == op->out_bl.size());
ceph_assert(op->ops.size() == op->out_rval.size());
// have, but that is better than doing callbacks out of order.
}
- decltype(op->onfinish) onfinish;
-
int rc = m->get_result();
if (m->is_redirect_reply()) {
<< " != request ops " << op->ops
<< " from " << m->get_source_inst() << dendl;
- bs::error_code handler_error = handle_osd_op_reply2(op, out_ops);
+ bs::error_code handler_error = process_op_reply_handlers(op, out_ops);
+
+ logger->inc(l_osdc_op_reply);
+ logger->tinc(l_osdc_op_latency, ceph::coarse_mono_time::clock::now() - op->stamp);
+ logger->set(l_osdc_op_inflight, num_in_flight);
+
+ // This function unlocks sl.
+ complete_op_reply(op, handler_error, s, sl, rc);
+ m->put();
+}
+
+void Objecter::complete_op_reply(Op *op, bs::error_code handler_error, OSDSession *s, unique_lock<std::shared_mutex> &sl, int rc) {
// NOTE: we assume that since we only request ONDISK ever we will
// only ever get back one (type of) ack ever.
-
+ decltype(op->onfinish) onfinish;
if (op->has_completion()) {
num_in_flight--;
onfinish = std::move(op->onfinish);
op->onfinish = nullptr;
}
- logger->inc(l_osdc_op_reply);
- logger->tinc(l_osdc_op_latency, ceph::coarse_mono_time::clock::now() - op->stamp);
- logger->set(l_osdc_op_inflight, num_in_flight);
-
/* get it before we call _finish_op() */
auto completion_lock = s->get_lock(op->target.base_oid);
- ldout(cct, 15) << "handle_osd_op_reply completed tid " << tid << dendl;
+ ldout(cct, 15) << "handle_osd_op_reply completed tid " << op->tid << dendl;
_finish_op(op, 0);
ldout(cct, 5) << num_in_flight << " in flight" << dendl;
if (completion_lock.mutex()) {
completion_lock.unlock();
}
-
- m->put();
}
void Objecter::handle_osd_backoff(MOSDBackoff *m)
void _send_op_account(Op *op);
void _cancel_linger_op(Op *op);
void _finish_op(Op *op, int r);
+ boost::system::error_code process_op_reply_handlers(Op *op, std::vector<OSDOp> &out_ops);
+ void complete_op_reply(Op *op, boost::system::error_code handler_error, OSDSession *s, std::unique_lock<std::shared_mutex> &sl, int rc);
static bool is_pg_changed(
int oldprimary,
const std::vector<int>& oldacting,
}
void handle_osd_op_reply(class MOSDOpReply *m);
- boost::system::error_code handle_osd_op_reply2(Op *op, std::vector<OSDOp> &out_ops);
void handle_osd_backoff(class MOSDBackoff *m);
void handle_watch_notify(class MWatchNotify *m);
void handle_osd_map(class MOSDMap *m);