]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: replace "ceph_abort_msg()" with assert() 37131/head
authorKefu Chai <kchai@redhat.com>
Tue, 15 Sep 2020 01:55:47 +0000 (09:55 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 15 Sep 2020 08:48:27 +0000 (16:48 +0800)
these are programming errors, and are easy to detect. also assert() does
not return, so compiler won't complain at seeing a branch does not
return value in a function that returns value.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/object_context.h

index 6f158bbd64ecf8c3bb70ae75fb7a6857dd31776f..8f25420948b0bde8f8c2e40ae3d8eefd2bcdaa7c 100644 (file)
@@ -123,8 +123,7 @@ public:
     case RWState::RWNONE:
       return seastar::make_ready_future<>();
     default:
-      ceph_abort_msg("invalid lock type");
-      return seastar::make_ready_future<>();
+      assert(0 == "invalid lock type");
     }
   }
 
@@ -139,8 +138,7 @@ public:
     case RWState::RWNONE:
       return;
     default:
-      ceph_abort_msg("invalid lock type");
-      return;
+      assert(0 == "invalid lock type");
     }
   }