]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/operation/SnapshotProtectRequest.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / librbd / operation / SnapshotProtectRequest.cc
index 9a0375fc7c2f1f338248242abb70b71cb431848e..f3b9e7e0b76f3eb0eafe154ba209cd9da15a078f 100644 (file)
@@ -61,7 +61,7 @@ bool SnapshotProtectRequest<I>::should_complete(int r) {
 template <typename I>
 void SnapshotProtectRequest<I>::send_protect_snap() {
   I &image_ctx = this->m_image_ctx;
-  ceph_assert(image_ctx.owner_lock.is_locked());
+  ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
 
   CephContext *cct = image_ctx.cct;
   ldout(cct, 5) << this << " " << __func__ << dendl;
@@ -76,8 +76,7 @@ void SnapshotProtectRequest<I>::send_protect_snap() {
 template <typename I>
 int SnapshotProtectRequest<I>::verify_and_send_protect_snap() {
   I &image_ctx = this->m_image_ctx;
-  RWLock::RLocker md_locker(image_ctx.md_lock);
-  RWLock::RLocker snap_locker(image_ctx.snap_lock);
+  std::shared_lock image_locker{image_ctx.image_lock};
 
   CephContext *cct = image_ctx.cct;
   if ((image_ctx.features & RBD_FEATURE_LAYERING) == 0) {