void PrimaryLogPG::do_pg_op(OpRequestRef op)
{
- MOSDOp *m = static_cast<MOSDOp *>(op->get_req());
+ // NOTE: this is non-const because we modify the OSDOp.outdata in
+ // place
+ MOSDOp *m = static_cast<MOSDOp *>(op->get_nonconst_req());
assert(m->get_type() == CEPH_MSG_OSD_OP);
dout(10) << "do_pg_op " << *m << dendl;
void PrimaryLogPG::do_op(OpRequestRef& op)
{
FUNCTRACE();
- MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
+ // NOTE: take a non-const pointer here; we must be careful not to
+ // change anything that will break other reads on m (operator<<).
+ MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
assert(m->get_type() == CEPH_MSG_OSD_OP);
-
if (m->finish_decode()) {
op->reset_desc(); // for TrackedOp
+ m->clear_payload();
}
- m->clear_payload();
dout(20) << __func__ << ": op " << *m << dendl;
void PrimaryLogPG::do_proxy_read(OpRequestRef op)
{
- MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
+ // NOTE: non-const here because the ProxyReadOp needs mutable refs to
+ // stash the result in the request's OSDOp vector
+ MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
object_locator_t oloc(m->get_object_locator());
oloc.pool = pool.info.tier_of;
void PrimaryLogPG::do_proxy_write(OpRequestRef op, const hobject_t& missing_oid)
{
- MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
+ // NOTE: non-const because ProxyWriteOp takes a mutable ref
+ MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
object_locator_t oloc(m->get_object_locator());
oloc.pool = pool.info.tier_of;
SnapContext snapc(m->get_snap_seq(), m->get_snaps());
void PrimaryLogPG::fill_in_copy_get_noent(OpRequestRef& op, hobject_t oid,
OSDOp& osd_op, bool classic)
{
- MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
+ // NOTE: we take non-const ref here for claim_op_out_data below; we must
+ // be careful not to modify anything else that will upset a racing
+ // operator<<
+ MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
uint64_t features = m->get_features();
object_copy_data_t reply_obj;