assert(m->get_header().type == MSG_OSD_SUBOP);
dout(15) << "do_sub_op " << *op->request << dendl;
+ OSDOp *first = NULL;
if (m->ops.size() >= 1) {
- OSDOp& first = m->ops[0];
- switch (first.op.op) {
+ first = &m->ops[0];
+ switch (first->op.op) {
case CEPH_OSD_OP_PULL:
sub_op_pull(op);
return;
+ }
+ }
+
+ if (!is_active()) {
+ waiting_for_active.push_back(op);
+ return;
+ }
+
+ if (first) {
+ switch (first->op.op) {
case CEPH_OSD_OP_PUSH:
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_push(op);
+ sub_op_push(op);
return;
case CEPH_OSD_OP_DELETE:
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_remove(op);
+ sub_op_remove(op);
return;
case CEPH_OSD_OP_SCRUB_RESERVE:
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_scrub_reserve(op);
+ sub_op_scrub_reserve(op);
return;
case CEPH_OSD_OP_SCRUB_UNRESERVE:
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_scrub_unreserve(op);
+ sub_op_scrub_unreserve(op);
return;
case CEPH_OSD_OP_SCRUB_STOP:
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_scrub_stop(op);
+ sub_op_scrub_stop(op);
return;
case CEPH_OSD_OP_SCRUB_MAP:
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_scrub_map(op);
+ sub_op_scrub_map(op);
return;
}
}
- if (!is_active())
- waiting_for_active.push_back(op);
- else
- sub_op_modify(op);
+ sub_op_modify(op);
}
void ReplicatedPG::do_sub_op_reply(OpRequestRef op)