]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/ExclusiveLock.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / librbd / ExclusiveLock.cc
index a70e77e917c053594b6038c6017a342282ece78c..71d98c5b2e6496625ea44c2c5809601fdfd8d5b3 100644 (file)
@@ -29,8 +29,8 @@ template <typename I>
 ExclusiveLock<I>::ExclusiveLock(I &image_ctx)
   : ML<I>(image_ctx.md_ctx, image_ctx.op_work_queue, image_ctx.header_oid,
           image_ctx.image_watcher, managed_lock::EXCLUSIVE,
-          image_ctx.blacklist_on_break_lock,
-          image_ctx.blacklist_expire_seconds),
+          image_ctx.config.template get_val<bool>("rbd_blacklist_on_break_lock"),
+          image_ctx.config.template get_val<uint64_t>("rbd_blacklist_expire_seconds")),
     m_image_ctx(image_ctx) {
   Mutex::Locker locker(ML<I>::m_lock);
   ML<I>::set_state_uninitialized();
@@ -81,7 +81,7 @@ template <typename I>
 void ExclusiveLock<I>::unblock_requests() {
   Mutex::Locker locker(ML<I>::m_lock);
 
-  assert(m_request_blocked_count > 0);
+  ceph_assert(m_request_blocked_count > 0);
   m_request_blocked_count--;
   if (m_request_blocked_count == 0) {
     m_request_blocked_ret_val = 0;
@@ -100,7 +100,7 @@ int ExclusiveLock<I>::get_unlocked_op_error() const {
 
 template <typename I>
 void ExclusiveLock<I>::init(uint64_t features, Context *on_init) {
-  assert(m_image_ctx.owner_lock.is_locked());
+  ceph_assert(m_image_ctx.owner_lock.is_locked());
   ldout(m_image_ctx.cct, 10) << dendl;
 
   {
@@ -130,7 +130,7 @@ void ExclusiveLock<I>::handle_peer_notification(int r) {
   }
 
   ldout(m_image_ctx.cct, 10) << dendl;
-  assert(ML<I>::is_action_acquire_lock());
+  ceph_assert(ML<I>::is_action_acquire_lock());
 
   m_acquire_lock_peer_ret_val = r;
   ML<I>::execute_next_action();
@@ -138,7 +138,7 @@ void ExclusiveLock<I>::handle_peer_notification(int r) {
 
 template <typename I>
 Context *ExclusiveLock<I>::start_op(int* ret_val) {
-  assert(m_image_ctx.owner_lock.is_locked());
+  ceph_assert(m_image_ctx.owner_lock.is_locked());
   Mutex::Locker locker(ML<I>::m_lock);
 
   if (!accept_ops(ML<I>::m_lock)) {
@@ -217,7 +217,7 @@ void ExclusiveLock<I>::post_acquire_lock_handler(int r, Context *on_finish) {
     return;
   } else if (r < 0) {
     ML<I>::m_lock.Lock();
-    assert(ML<I>::is_state_acquiring());
+    ceph_assert(ML<I>::is_state_acquiring());
 
     // PostAcquire state machine will not run, so we need complete prepare
     m_image_ctx.state->handle_prepare_lock_complete();
@@ -263,7 +263,7 @@ void ExclusiveLock<I>::handle_post_acquiring_lock(int r) {
 
   Mutex::Locker locker(ML<I>::m_lock);
 
-  assert(r == 0);
+  ceph_assert(r == 0);
 
   // lock is owned at this point
   ML<I>::set_state_post_acquiring();
@@ -276,7 +276,7 @@ void ExclusiveLock<I>::handle_post_acquired_lock(int r) {
   Context *on_finish = nullptr;
   {
     Mutex::Locker locker(ML<I>::m_lock);
-    assert(ML<I>::is_state_acquiring() || ML<I>::is_state_post_acquiring());
+    ceph_assert(ML<I>::is_state_acquiring() || ML<I>::is_state_post_acquiring());
 
     assert (m_pre_post_callback != nullptr);
     std::swap(m_pre_post_callback, on_finish);
@@ -314,7 +314,7 @@ void ExclusiveLock<I>::post_release_lock_handler(bool shutting_down, int r,
   if (!shutting_down) {
     {
       Mutex::Locker locker(ML<I>::m_lock);
-      assert(ML<I>::is_state_pre_releasing() || ML<I>::is_state_releasing());
+      ceph_assert(ML<I>::is_state_pre_releasing() || ML<I>::is_state_releasing());
     }
 
     if (r >= 0) {