Skip to content

Commit

Permalink
Merge pull request ceph#8808 from wjin/fast_heartbeat
Browse files Browse the repository at this point in the history
osd: fast dispatch heartbeat message

Reviewed-by: Haomai Wang <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed May 4, 2016
2 parents 2c6b95e + 6f1f717 commit b84f906
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/osd/OSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,20 @@ class OSD : public Dispatcher,
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);
}
Expand Down

0 comments on commit b84f906

Please sign in to comment.