]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/operation/SnapshotRenameRequest.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / librbd / operation / SnapshotRenameRequest.cc
index 236d82815b3ea7220b429373c32d7f25bd395fe1..b25b991f4d1c734301c9eda805c752230096bacf 100644 (file)
@@ -34,13 +34,14 @@ SnapshotRenameRequest<I>::SnapshotRenameRequest(I &image_ctx,
                                                Context *on_finish,
                                                uint64_t snap_id,
                                                const std::string &snap_name)
-  : Request<I>(image_ctx, on_finish), m_snap_id(snap_id), m_snap_name(snap_name) {
+  : Request<I>(image_ctx, on_finish), m_snap_id(snap_id),
+    m_snap_name(snap_name), m_state(STATE_RENAME_SNAP) {
 }
 
 template <typename I>
 journal::Event SnapshotRenameRequest<I>::create_event(uint64_t op_tid) const {
   I &image_ctx = this->m_image_ctx;
-  assert(image_ctx.snap_lock.is_locked());
+  ceph_assert(image_ctx.snap_lock.is_locked());
 
   std::string src_snap_name;
   auto snap_info_it = image_ctx.snap_info.find(m_snap_id);
@@ -76,15 +77,13 @@ bool SnapshotRenameRequest<I>::should_complete(int r) {
 template <typename I>
 void SnapshotRenameRequest<I>::send_rename_snap() {
   I &image_ctx = this->m_image_ctx;
-  assert(image_ctx.owner_lock.is_locked());
+  ceph_assert(image_ctx.owner_lock.is_locked());
   RWLock::RLocker md_locker(image_ctx.md_lock);
   RWLock::RLocker snap_locker(image_ctx.snap_lock);
 
   CephContext *cct = image_ctx.cct;
   ldout(cct, 5) << this << " " << __func__ << dendl;
 
-  m_state = STATE_RENAME_SNAP;
-
   librados::ObjectWriteOperation op;
   if (image_ctx.old_format) {
     cls_client::old_snapshot_rename(&op, m_snap_id, m_snap_name);
@@ -95,7 +94,7 @@ void SnapshotRenameRequest<I>::send_rename_snap() {
   librados::AioCompletion *rados_completion = this->create_callback_completion();
   int r = image_ctx.md_ctx.aio_operate(image_ctx.header_oid,
                                        rados_completion, &op);
-  assert(r == 0);
+  ceph_assert(r == 0);
   rados_completion->release();
 }