]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: don't clone IoCtx in send_copyup()
authorIlya Dryomov <idryomov@gmail.com>
Mon, 18 Feb 2019 10:37:09 +0000 (11:37 +0100)
committerJason Dillaman <dillaman@redhat.com>
Wed, 20 Feb 2019 19:12:21 +0000 (14:12 -0500)
Calling aio_operate() with the explicit snap_seq and snaps doesn't
mutate IoCtx, so no reason to clone it.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/io/CopyupRequest.cc
src/librbd/io/CopyupRequest.h

index 7e34112c7414d6d2de20ec2c17eaedfc5d09a9ec..dddaa369fc8c16091f5995b8dc5841b4498dc92b 100644 (file)
@@ -145,12 +145,10 @@ bool CopyupRequest<I>::send_copyup() {
     // this is a CoW request, a second request will be created for the
     // actual modification.
     m_pending_copyups++;
-
     ldout(m_ictx->cct, 20) << "copyup with empty snapshot context" << dendl;
-    librados::AioCompletion *comp = util::create_rados_callback(this);
 
-    m_data_ctx.dup(m_ictx->data_ctx);
-    r = m_data_ctx.aio_operate(
+    librados::AioCompletion *comp = util::create_rados_callback(this);
+    r = m_ictx->data_ctx.aio_operate(
       m_oid, comp, &copyup_op, 0, snaps,
       (m_trace.valid() ? m_trace.get_info() : nullptr));
     ceph_assert(r == 0);
index de7930856226001273dda74165bb6090556e6068..fba71202372deb298c6a5efeb3e5ef8d606e7857 100644 (file)
@@ -100,7 +100,6 @@ private:
   AsyncOperation m_async_op;
 
   std::vector<uint64_t> m_snap_ids;
-  librados::IoCtx m_data_ctx; // for empty SnapContext
 
   Mutex m_lock;