Message.cc
Messenger.cc
QueueStrategy.cc
+ Connection.cc
msg_types.cc)
list(APPEND msg_srcs
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#include "msg/Connection.h"
+#include "msg/Messenger.h"
+
+
+bool Connection::is_blackhole() const {
+ auto& conf = msgr->cct->_conf;
+ return ((conf->ms_blackhole_mon && peer_type == CEPH_ENTITY_TYPE_MON) ||
+ (conf->ms_blackhole_osd && peer_type == CEPH_ENTITY_TYPE_OSD) ||
+ (conf->ms_blackhole_mds && peer_type == CEPH_ENTITY_TYPE_MDS) ||
+ (conf->ms_blackhole_client && peer_type == CEPH_ENTITY_TYPE_CLIENT));
+}
#include "common/item_history.h"
#include "msg/MessageRef.h"
-
// ======================================================
// abstract Connection, for keeping per-connection state
std::lock_guard l{lock};
last_keepalive_ack = t;
}
-
+ bool is_blackhole() const;
};
typedef boost::intrusive_ptr<Connection> ConnectionRef;
<< this
<< dendl;
- auto cct = async_msgr->cct;
- if ((cct->_conf->ms_blackhole_mon && peer_type == CEPH_ENTITY_TYPE_MON)||
- (cct->_conf->ms_blackhole_osd && peer_type == CEPH_ENTITY_TYPE_OSD)||
- (cct->_conf->ms_blackhole_mds && peer_type == CEPH_ENTITY_TYPE_MDS)||
- (cct->_conf->ms_blackhole_client &&
- peer_type == CEPH_ENTITY_TYPE_CLIENT)) {
- lgeneric_subdout(cct, ms, 0) << __func__ << ceph_entity_type_name(peer_type)
- << " blackhole " << *m << dendl;
+ if (is_blackhole()) {
+ lgeneric_subdout(async_msgr->cct, ms, 0) << __func__ << ceph_entity_type_name(peer_type)
+ << " blackhole " << *m << dendl;
m->put();
return 0;
}
ceph::mono_time fast_dispatch_time;
- auto& conf = cct->_conf;
- if ((conf->ms_blackhole_mon && connection->peer_type == CEPH_ENTITY_TYPE_MON)||
- (conf->ms_blackhole_osd && connection->peer_type == CEPH_ENTITY_TYPE_OSD)||
- (conf->ms_blackhole_mds && connection->peer_type == CEPH_ENTITY_TYPE_MDS)||
- (conf->ms_blackhole_client &&
- connection->peer_type == CEPH_ENTITY_TYPE_CLIENT)) {
+ if (connection->is_blackhole()) {
ldout(cct, 10) << __func__ << " blackhole " << *message << dendl;
message->put();
goto out;
ceph::mono_time fast_dispatch_time;
- auto& conf = cct->_conf;
- if ((conf->ms_blackhole_mon && connection->peer_type == CEPH_ENTITY_TYPE_MON)||
- (conf->ms_blackhole_osd && connection->peer_type == CEPH_ENTITY_TYPE_OSD)||
- (conf->ms_blackhole_mds && connection->peer_type == CEPH_ENTITY_TYPE_MDS)||
- (conf->ms_blackhole_client &&
- connection->peer_type == CEPH_ENTITY_TYPE_CLIENT)) {
+ if (connection->is_blackhole()) {
ldout(cct, 10) << __func__ << " blackhole " << *message << dendl;
message->put();
goto out;