]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
TrackedOp: remove the init_from_message function
authorGreg Farnum <greg@inktank.com>
Tue, 15 Apr 2014 00:11:34 +0000 (17:11 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 5 May 2014 21:57:52 +0000 (14:57 -0700)
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 <greg@inktank.com>
src/common/TrackedOp.h
src/osd/OpRequest.cc
src/osd/OpRequest.h

index 4673c1b80f4f824684858cdd9b0442cb48e7308f..a2c092707c41a726a26d247f29756d4f63ab3f31 100644 (file)
@@ -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
index 33e7fbdb9d25f354fa408ae0f40cffa6d0bf3cf9..a42a085ebd0eadc7eb23df11c41bd88835993e95 100644 (file)
@@ -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<MOSDOp*>(req)->get_reqid();
+  } else if (req->get_type() == MSG_OSD_SUBOP) {
+    reqid = static_cast<MOSDSubOp*>(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<MOSDOp*>(request)->get_reqid();
-  } else if (request->get_type() == MSG_OSD_SUBOP) {
-    reqid = static_cast<MOSDSubOp*>(request)->reqid;
-  }
-}
-
 bool OpRequest::check_rmw(int flag) {
   return rmw_flags & flag;
 }
index 569b6fc581ea37041592ea5fc177a35b2a5f3040..931f4aebbbe9af9e9ad3cf44a93ef5b7d2e47a8d 100644 (file)
@@ -163,8 +163,6 @@ public:
     return reqid;
   }
 
-  void init_from_message();
-
   typedef ceph::shared_ptr<OpRequest> Ref;
 };