]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/msg/Connection.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / msg / Connection.cc
index 21f147b8034963aa2439728b5b2d5a6edb096d96..9183871b59429ec66add6b2ddf8c3c50427d3841 100644 (file)
@@ -7,8 +7,17 @@
 
 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));
+
+  switch (peer_type) {
+  case CEPH_ENTITY_TYPE_MON:
+    return conf->ms_blackhole_mon;
+  case CEPH_ENTITY_TYPE_OSD:
+    return conf->ms_blackhole_osd;
+  case CEPH_ENTITY_TYPE_MDS:
+    return conf->ms_blackhole_mds;
+  case CEPH_ENTITY_TYPE_CLIENT:
+    return conf->ms_blackhole_client;
+  default:
+    return false;
+  }
 }