]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: Use ceph_assert for asserts.
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 23 Aug 2018 15:19:34 +0000 (11:19 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 27 Aug 2018 13:09:01 +0000 (09:09 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/crimson/net/SocketConnection.cc
src/crimson/net/SocketMessenger.cc
src/crimson/thread/ThreadPool.cc

index a9d8162ab5ca4cf82cdca03d7219e6a70a135bd0..e7984223bbb9c3ce1c1bb3e51b067ba23fdb385b 100644 (file)
@@ -44,7 +44,7 @@ SocketConnection::SocketConnection(Messenger *messenger,
 SocketConnection::~SocketConnection()
 {
   // errors were reported to callers of send()
-  assert(send_ready.available());
+  ceph_assert(send_ready.available());
   send_ready.ignore_ready_future();
 }
 
@@ -245,12 +245,12 @@ bool SocketConnection::update_rx_seq(seq_num_t seq)
   if (seq <= in_seq) {
     if (HAVE_FEATURE(features, RECONNECT_SEQ) &&
         conf.ms_die_on_old_message) {
-      assert(0 == "old msgs despite reconnect_seq feature");
+      ceph_assert(0 == "old msgs despite reconnect_seq feature");
     }
     return false;
   } else if (seq > in_seq + 1) {
     if (conf.ms_die_on_skipped_message) {
-      assert(0 == "skipped incoming seq");
+      ceph_assert(0 == "skipped incoming seq");
     }
     return false;
   } else {
@@ -666,7 +666,7 @@ seastar::future<> SocketConnection::handle_connect_reply(msgr_tag_t tag)
     h.global_seq = get_messenger()->get_global_seq(h.reply.global_seq);
     return seastar::now();
   case CEPH_MSGR_TAG_RETRY_SESSION:
-    assert(h.reply.connect_seq > h.connect_seq);
+    ceph_assert(h.reply.connect_seq > h.connect_seq);
     h.connect_seq = h.reply.connect_seq;
     return seastar::now();
   case CEPH_MSGR_TAG_WAIT:
@@ -773,7 +773,7 @@ seastar::future<> SocketConnection::connect(entity_type_t peer_type,
     }).then([this] (bufferlist bl) {
       auto p = bl.cbegin();
       ::decode(h.reply, p);
-      assert(p.end());
+      ceph_assert(p.end());
       return read(h.reply.authorizer_len);
     }).then([this] (bufferlist bl) {
       if (h.authorizer) {
@@ -797,7 +797,7 @@ seastar::future<> SocketConnection::client_handshake(entity_type_t peer_type,
       entity_addr_t saddr, caddr;
       ::decode(saddr, p);
       ::decode(caddr, p);
-      assert(p.end());
+      ceph_assert(p.end());
       validate_peer_addr(saddr, peer_addr);
 
       if (my_addr != caddr) {
@@ -840,7 +840,7 @@ seastar::future<> SocketConnection::server_handshake()
       validate_banner(p);
       entity_addr_t addr;
       ::decode(addr, p);
-      assert(p.end());
+      ceph_assert(p.end());
       if (!addr.is_blank_ip()) {
         peer_addr = addr;
       }
index 9fc6cb008a45afd6350be4578b5671fbb76ecf90..f601d223f6cbe25956d94783a0c7132a733c936f 100644 (file)
@@ -43,7 +43,7 @@ seastar::future<> SocketMessenger::dispatch(ConnectionRef conn)
 {
   auto [i, added] = connections.emplace(conn->get_peer_addr(), conn);
   std::ignore = i;
-  assert(added);
+  ceph_assert(added);
 
   return seastar::repeat([=] {
       return conn->read_message()
@@ -185,10 +185,10 @@ ceph::net::ConnectionRef SocketMessenger::lookup_conn(const entity_addr_t& addr)
 
 void SocketMessenger::unregister_conn(ConnectionRef conn)
 {
-  assert(conn);
+  ceph_assert(conn);
   auto found = connections.find(conn->get_peer_addr());
-  assert(found != connections.end());
-  assert(found->second == conn);
+  ceph_assert(found != connections.end());
+  ceph_assert(found->second == conn);
   connections.erase(found);
 }
 
index d1fb262c477625e41f65fb6143da8ee72ecdc718..0154344c212cc1b3bbe14a0e81b100526079851e 100644 (file)
@@ -4,6 +4,8 @@
 #include "crimson/net/Config.h"
 #include "include/intarith.h"
 
+#include "include/assert.h"
+
 namespace ceph::thread {
 
 ThreadPool::ThreadPool(size_t n_threads,
@@ -34,7 +36,7 @@ void ThreadPool::pin(unsigned cpu_id)
   CPU_SET(cpu_id, &cs);
   [[maybe_unused]] auto r = pthread_setaffinity_np(pthread_self(),
                                                    sizeof(cs), &cs);
-  assert(r == 0);
+  ceph_assert(r == 0);
 }
 
 void ThreadPool::loop()