From: Greg Farnum Date: Tue, 15 Apr 2014 00:11:34 +0000 (-0700) Subject: TrackedOp: remove the init_from_message function X-Git-Tag: v0.82~82^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d7e04cc875e6c4d3efdb6c0bf7c93e053a4e43bb;p=ceph.git TrackedOp: remove the init_from_message function I'm not sure why we ever had this instead of just doing things in the subclass constructor, and the semantics around it don't make much sense for anything else (we called mark_event first anyway). Signed-off-by: Greg Farnum --- diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 4673c1b80f4f..a2c092707c41 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -117,8 +117,6 @@ public: _mark_event(retval.get(), "all_read", ref->get_recv_complete_stamp()); _mark_event(retval.get(), "dispatched", ref->get_dispatch_stamp()); - retval->init_from_message(); - return retval; } }; @@ -150,7 +148,6 @@ protected: tracker->register_inflight_op(&xitem); } - virtual void init_from_message() {} /// output any type-specific data you want to get when dump() is called virtual void _dump(utime_t now, Formatter *f) const {} /// if you want something else to happen when events are marked, implement diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index 33e7fbdb9d25..a42a085ebd0e 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -22,6 +22,11 @@ OpRequest::OpRequest(Message *req, OpTracker *tracker) : // don't warn as quickly for low priority ops warn_interval_multiplier = tracker->cct->_conf->osd_recovery_op_warn_multiple; } + if (req->get_type() == CEPH_MSG_OSD_OP) { + reqid = static_cast(req)->get_reqid(); + } else if (req->get_type() == MSG_OSD_SUBOP) { + reqid = static_cast(req)->reqid; + } } void OpRequest::_dump(utime_t now, Formatter *f) const @@ -50,15 +55,6 @@ void OpRequest::_dump(utime_t now, Formatter *f) const } } -void OpRequest::init_from_message() -{ - if (request->get_type() == CEPH_MSG_OSD_OP) { - reqid = static_cast(request)->get_reqid(); - } else if (request->get_type() == MSG_OSD_SUBOP) { - reqid = static_cast(request)->reqid; - } -} - bool OpRequest::check_rmw(int flag) { return rmw_flags & flag; } diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 569b6fc581ea..931f4aebbbe9 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -163,8 +163,6 @@ public: return reqid; } - void init_from_message(); - typedef ceph::shared_ptr Ref; };