version_t uv)
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
- assert(m->get_header().type == CEPH_MSG_OSD_OP);
+ assert(m->get_type() == CEPH_MSG_OSD_OP);
int flags;
flags = m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK);
void OSDService::handle_misdirected_op(PG *pg, OpRequestRef op)
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
- assert(m->get_header().type == CEPH_MSG_OSD_OP);
+ assert(m->get_type() == CEPH_MSG_OSD_OP);
assert(m->get_map_epoch() >= pg->info.history.same_primary_since);
epoch_t replica_op_required_epoch(OpRequestRef op)
{
T *m = static_cast<T *>(op->get_req());
- assert(m->get_header().type == MSGTYPE);
+ assert(m->get_type() == MSGTYPE);
return m->map_epoch;
}
void OSD::handle_pg_create(OpRequestRef op)
{
MOSDPGCreate *m = (MOSDPGCreate*)op->get_req();
- assert(m->get_header().type == MSG_OSD_PG_CREATE);
+ assert(m->get_type() == MSG_OSD_PG_CREATE);
dout(10) << "handle_pg_create " << *m << dendl;
void OSD::handle_pg_notify(OpRequestRef op)
{
MOSDPGNotify *m = (MOSDPGNotify*)op->get_req();
- assert(m->get_header().type == MSG_OSD_PG_NOTIFY);
+ assert(m->get_type() == MSG_OSD_PG_NOTIFY);
dout(7) << "handle_pg_notify from " << m->get_source() << dendl;
int from = m->get_source().num();
void OSD::handle_pg_log(OpRequestRef op)
{
MOSDPGLog *m = (MOSDPGLog*) op->get_req();
- assert(m->get_header().type == MSG_OSD_PG_LOG);
+ assert(m->get_type() == MSG_OSD_PG_LOG);
dout(7) << "handle_pg_log " << *m << " from " << m->get_source() << dendl;
if (!require_osd_peer(op))
void OSD::handle_pg_info(OpRequestRef op)
{
MOSDPGInfo *m = static_cast<MOSDPGInfo *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_INFO);
+ assert(m->get_type() == MSG_OSD_PG_INFO);
dout(7) << "handle_pg_info " << *m << " from " << m->get_source() << dendl;
if (!require_osd_peer(op))
void OSD::handle_pg_trim(OpRequestRef op)
{
MOSDPGTrim *m = (MOSDPGTrim *)op->get_req();
- assert(m->get_header().type == MSG_OSD_PG_TRIM);
+ assert(m->get_type() == MSG_OSD_PG_TRIM);
dout(7) << "handle_pg_trim " << *m << " from " << m->get_source() << dendl;
void OSD::handle_pg_backfill_reserve(OpRequestRef op)
{
MBackfillReserve *m = static_cast<MBackfillReserve*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_BACKFILL_RESERVE);
+ assert(m->get_type() == MSG_OSD_BACKFILL_RESERVE);
if (!require_osd_peer(op))
return;
void OSD::handle_pg_recovery_reserve(OpRequestRef op)
{
MRecoveryReserve *m = static_cast<MRecoveryReserve*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_RECOVERY_RESERVE);
+ assert(m->get_type() == MSG_OSD_RECOVERY_RESERVE);
if (!require_osd_peer(op))
return;
assert(osd_lock.is_locked());
MOSDPGQuery *m = (MOSDPGQuery*)op->get_req();
- assert(m->get_header().type == MSG_OSD_PG_QUERY);
+ assert(m->get_type() == MSG_OSD_PG_QUERY);
if (!require_osd_peer(op))
return;
void OSD::handle_pg_remove(OpRequestRef op)
{
MOSDPGRemove *m = (MOSDPGRemove *)op->get_req();
- assert(m->get_header().type == MSG_OSD_PG_REMOVE);
+ assert(m->get_type() == MSG_OSD_PG_REMOVE);
assert(osd_lock.is_locked());
if (!require_osd_peer(op))
void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
- assert(m->get_header().type == CEPH_MSG_OSD_OP);
+ assert(m->get_type() == CEPH_MSG_OSD_OP);
if (op_is_discardable(m)) {
dout(10) << " discardable " << *m << dendl;
return;
void OSD::handle_replica_op(OpRequestRef& op, OSDMapRef& osdmap)
{
T *m = static_cast<T *>(op->get_req());
- assert(m->get_header().type == MSGTYPE);
+ assert(m->get_type() == MSGTYPE);
dout(10) << __func__ << " " << *m << " epoch " << m->map_epoch << dendl;
epoch_t up_epoch = service.get_up_epoch();
void PG::sub_op_scrub_map(OpRequestRef op)
{
MOSDSubOp *m = static_cast<MOSDSubOp *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
dout(7) << "sub_op_scrub_map" << dendl;
if (m->map_epoch < info.history.same_interval_since) {
void PG::sub_op_scrub_reserve(OpRequestRef op)
{
MOSDSubOp *m = static_cast<MOSDSubOp*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
dout(7) << "sub_op_scrub_reserve" << dendl;
if (scrubber.reserved) {
void PG::sub_op_scrub_reserve_reply(OpRequestRef op)
{
MOSDSubOpReply *reply = static_cast<MOSDSubOpReply*>(op->get_req());
- assert(reply->get_header().type == MSG_OSD_SUBOPREPLY);
+ assert(reply->get_type() == MSG_OSD_SUBOPREPLY);
dout(7) << "sub_op_scrub_reserve_reply" << dendl;
if (!scrubber.reserved) {
void PG::sub_op_scrub_unreserve(OpRequestRef op)
{
- assert(op->get_req()->get_header().type == MSG_OSD_SUBOP);
+ assert(op->get_req()->get_type() == MSG_OSD_SUBOP);
dout(7) << "sub_op_scrub_unreserve" << dendl;
op->mark_started();
op->mark_started();
MOSDSubOp *m = static_cast<MOSDSubOp*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
dout(7) << "sub_op_scrub_stop" << dendl;
// see comment in sub_op_scrub_reserve
bool PG::can_discard_replica_op(OpRequestRef& op)
{
T *m = static_cast<T *>(op->get_req());
- assert(m->get_header().type == MSGTYPE);
+ assert(m->get_type() == MSGTYPE);
/* Mostly, this overlaps with the old_peering_msg
* condition. An important exception is pushes
bool PG::can_discard_scan(OpRequestRef op)
{
MOSDPGScan *m = static_cast<MOSDPGScan *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_SCAN);
+ assert(m->get_type() == MSG_OSD_PG_SCAN);
if (old_peering_msg(m->map_epoch, m->query_epoch)) {
dout(10) << " got old scan, ignoring" << dendl;
bool PG::can_discard_backfill(OpRequestRef op)
{
MOSDPGBackfill *m = static_cast<MOSDPGBackfill *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_BACKFILL);
+ assert(m->get_type() == MSG_OSD_PG_BACKFILL);
if (old_peering_msg(m->map_epoch, m->query_epoch)) {
dout(10) << " got old backfill, ignoring" << dendl;
void ReplicatedBackend::sub_op_modify_reply(OpRequestRef op)
{
MOSDSubOpReply *r = static_cast<MOSDSubOpReply*>(op->get_req());
- assert(r->get_header().type == MSG_OSD_SUBOPREPLY);
+ assert(r->get_type() == MSG_OSD_SUBOPREPLY);
op->mark_started();
void ReplicatedPG::do_pg_op(OpRequestRef op)
{
MOSDOp *m = static_cast<MOSDOp *>(op->get_req());
- assert(m->get_header().type == CEPH_MSG_OSD_OP);
+ assert(m->get_type() == CEPH_MSG_OSD_OP);
dout(10) << "do_pg_op " << *m << dendl;
op->mark_started();
void ReplicatedPG::do_op(OpRequestRef& op)
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
- assert(m->get_header().type == CEPH_MSG_OSD_OP);
+ assert(m->get_type() == CEPH_MSG_OSD_OP);
if (op->includes_pg_op()) {
if (pg_op_must_wait(m)) {
wait_for_all_missing(op);
{
MOSDSubOp *m = static_cast<MOSDSubOp*>(op->get_req());
assert(have_same_or_newer_map(m->map_epoch));
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
dout(15) << "do_sub_op " << *op->get_req() << dendl;
OSDOp *first = NULL;
void ReplicatedPG::do_sub_op_reply(OpRequestRef op)
{
MOSDSubOpReply *r = static_cast<MOSDSubOpReply *>(op->get_req());
- assert(r->get_header().type == MSG_OSD_SUBOPREPLY);
+ assert(r->get_type() == MSG_OSD_SUBOPREPLY);
if (r->ops.size() >= 1) {
OSDOp& first = r->ops[0];
switch (first.op.op) {
ThreadPool::TPHandle &handle)
{
MOSDPGScan *m = static_cast<MOSDPGScan*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_SCAN);
+ assert(m->get_type() == MSG_OSD_PG_SCAN);
dout(10) << "do_scan " << *m << dendl;
op->mark_started();
void ReplicatedBackend::_do_push(OpRequestRef op)
{
MOSDPGPush *m = static_cast<MOSDPGPush *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_PUSH);
+ assert(m->get_type() == MSG_OSD_PG_PUSH);
pg_shard_t from = m->from;
vector<PushReplyOp> replies;
void ReplicatedBackend::_do_pull_response(OpRequestRef op)
{
MOSDPGPush *m = static_cast<MOSDPGPush *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_PUSH);
+ assert(m->get_type() == MSG_OSD_PG_PUSH);
pg_shard_t from = m->from;
vector<PullOp> replies(1);
void ReplicatedBackend::do_pull(OpRequestRef op)
{
MOSDPGPull *m = static_cast<MOSDPGPull *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_PULL);
+ assert(m->get_type() == MSG_OSD_PG_PULL);
pg_shard_t from = m->from;
map<pg_shard_t, vector<PushOp> > replies;
void ReplicatedBackend::do_push_reply(OpRequestRef op)
{
MOSDPGPushReply *m = static_cast<MOSDPGPushReply *>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_PUSH_REPLY);
+ assert(m->get_type() == MSG_OSD_PG_PUSH_REPLY);
pg_shard_t from = m->from;
vector<PushOp> replies(1);
void ReplicatedPG::do_backfill(OpRequestRef op)
{
MOSDPGBackfill *m = static_cast<MOSDPGBackfill*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_PG_BACKFILL);
+ assert(m->get_type() == MSG_OSD_PG_BACKFILL);
dout(10) << "do_backfill " << *m << dendl;
op->mark_started();
void ReplicatedBackend::sub_op_modify(OpRequestRef op)
{
MOSDSubOp *m = static_cast<MOSDSubOp*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
const hobject_t& soid = m->poid;
dout(10) << "sub_op_modify_applied on " << rm << " op "
<< *rm->op->get_req() << dendl;
MOSDSubOp *m = static_cast<MOSDSubOp*>(rm->op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
if (!rm->committed) {
// send ack to acker only if we haven't sent a commit already
{
MOSDSubOpReply *reply = static_cast<MOSDSubOpReply*>(op->get_req());
const hobject_t& soid = reply->get_poid();
- assert(reply->get_header().type == MSG_OSD_SUBOPREPLY);
+ assert(reply->get_type() == MSG_OSD_SUBOPREPLY);
dout(10) << "sub_op_push_reply from " << reply->get_source() << " " << *reply << dendl;
pg_shard_t peer = reply->from;
void ReplicatedBackend::sub_op_pull(OpRequestRef op)
{
MOSDSubOp *m = static_cast<MOSDSubOp*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
op->mark_started();
void ReplicatedPG::sub_op_remove(OpRequestRef op)
{
MOSDSubOp *m = static_cast<MOSDSubOp*>(op->get_req());
- assert(m->get_header().type == MSG_OSD_SUBOP);
+ assert(m->get_type() == MSG_OSD_SUBOP);
dout(7) << "sub_op_remove " << m->poid << dendl;
op->mark_started();