]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/operation/SnapshotRenameRequest.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / librbd / operation / SnapshotRenameRequest.cc
index b25b991f4d1c734301c9eda805c752230096bacf..e9257f18c021f6d4c9ef92e1bdb7a148026a3a0e 100644 (file)
@@ -4,7 +4,6 @@
 #include "librbd/operation/SnapshotRenameRequest.h"
 #include "common/dout.h"
 #include "common/errno.h"
-#include "librbd/ExclusiveLock.h"
 #include "librbd/ImageCtx.h"
 
 #define dout_subsys ceph_subsys_rbd
@@ -41,7 +40,7 @@ SnapshotRenameRequest<I>::SnapshotRenameRequest(I &image_ctx,
 template <typename I>
 journal::Event SnapshotRenameRequest<I>::create_event(uint64_t op_tid) const {
   I &image_ctx = this->m_image_ctx;
-  ceph_assert(image_ctx.snap_lock.is_locked());
+  ceph_assert(ceph_mutex_is_locked(image_ctx.image_lock));
 
   std::string src_snap_name;
   auto snap_info_it = image_ctx.snap_info.find(m_snap_id);
@@ -77,9 +76,8 @@ bool SnapshotRenameRequest<I>::should_complete(int r) {
 template <typename I>
 void SnapshotRenameRequest<I>::send_rename_snap() {
   I &image_ctx = this->m_image_ctx;
-  ceph_assert(image_ctx.owner_lock.is_locked());
-  RWLock::RLocker md_locker(image_ctx.md_lock);
-  RWLock::RLocker snap_locker(image_ctx.snap_lock);
+  ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
+  std::shared_lock image_locker{image_ctx.image_lock};
 
   CephContext *cct = image_ctx.cct;
   ldout(cct, 5) << this << " " << __func__ << dendl;