]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/Operations.cc
update sources to v12.1.0
[ceph.git] / ceph / src / librbd / Operations.cc
index c70ff6f91112c202243c1e6b255d8ff30a5493b7..af0cb1220d465554b35e4d252cd1ad5ebf7f6f3c 100644 (file)
@@ -192,9 +192,8 @@ struct C_InvokeAsyncRequest : public Context {
       return;
     }
 
-    int r;
     if (image_ctx.exclusive_lock->is_lock_owner() &&
-        image_ctx.exclusive_lock->accept_requests(&r)) {
+        image_ctx.exclusive_lock->accept_requests()) {
       send_local_request();
       owner_lock.put_read();
       return;
@@ -1473,7 +1472,6 @@ int Operations<I>::prepare_image_update() {
   }
 
   // need to upgrade to a write lock
-  int r = 0;
   bool trying_lock = false;
   C_SaferCond ctx;
   m_image_ctx.owner_lock.put_read();
@@ -1481,12 +1479,13 @@ int Operations<I>::prepare_image_update() {
     RWLock::WLocker owner_locker(m_image_ctx.owner_lock);
     if (m_image_ctx.exclusive_lock != nullptr &&
         (!m_image_ctx.exclusive_lock->is_lock_owner() ||
-         !m_image_ctx.exclusive_lock->accept_requests(&r))) {
+         !m_image_ctx.exclusive_lock->accept_requests())) {
       m_image_ctx.exclusive_lock->try_acquire_lock(&ctx);
       trying_lock = true;
     }
   }
 
+  int r = 0;
   if (trying_lock) {
     r = ctx.wait();
   }