]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fast dispatch heartbeat message 8808/head
authorWei Jin <wjin.cn@gmail.com>
Thu, 28 Apr 2016 11:00:48 +0000 (19:00 +0800)
committerWei Jin <wjin.cn@gmail.com>
Fri, 29 Apr 2016 15:35:08 +0000 (23:35 +0800)
Signed-off-by: Wei Jin <wjin.cn@gmail.com>
src/osd/OSD.h

index 8a62ebbc1b25080990ab177b48e383055da40b65..3fb996b090207e1fa6fb8612c5981c2859e5b245 100644 (file)
@@ -1594,6 +1594,20 @@ public:
   struct HeartbeatDispatcher : public Dispatcher {
     OSD *osd;
     explicit HeartbeatDispatcher(OSD *o) : Dispatcher(o->cct), osd(o) {}
+
+    bool ms_can_fast_dispatch_any() const { return true; }
+    bool ms_can_fast_dispatch(Message *m) const {
+      switch (m->get_type()) {
+       case CEPH_MSG_PING:
+       case MSG_OSD_PING:
+          return true;
+       default:
+          return false;
+       }
+    }
+    void ms_fast_dispatch(Message *m) {
+      osd->heartbeat_dispatch(m);
+    }
     bool ms_dispatch(Message *m) {
       return osd->heartbeat_dispatch(m);
     }