]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fast dispatch heartbeat message 10761/head
authorWei Jin <wjin.cn@gmail.com>
Thu, 28 Apr 2016 11:00:48 +0000 (19:00 +0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 17 Aug 2016 16:04:53 +0000 (18:04 +0200)
Signed-off-by: Wei Jin <wjin.cn@gmail.com>
(cherry picked from commit 6f1f717446314618db7a165c75dfd6a76a01f55e)

src/osd/OSD.h

index 79a0d17aac867ebc62b0ec7cbc5e9da345b841cd..1d918ff57e035c4f7fff8669aeeecc16275785ca 100644 (file)
@@ -1598,6 +1598,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);
     }