From: Mykola Golub Date: Tue, 6 Jun 2017 07:38:34 +0000 (+0300) Subject: Merge pull request #15415 from dillaman/wip-rbd-valgrind X-Git-Tag: ses5-milestone6~8^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ce058fb12ca2498cbd70eef916ab972af485772;p=ceph.git Merge pull request #15415 from dillaman/wip-rbd-valgrind librbd: fix valgrind errors and ensure tests detect future leaks Reviewed-by: Mykola Golub --- 7ce058fb12ca2498cbd70eef916ab972af485772 diff --cc src/librbd/ExclusiveLock.cc index f35b90f1df5a,8c421215281c..a3d69fce89fb --- a/src/librbd/ExclusiveLock.cc +++ b/src/librbd/ExclusiveLock.cc @@@ -128,24 -111,9 +128,24 @@@ void ExclusiveLock::handle_peer_noti ML::execute_next_action(); } +template +Context *ExclusiveLock::start_op() { + assert(m_image_ctx.owner_lock.is_locked()); + Mutex::Locker locker(ML::m_lock); + + if (!accept_ops(ML::m_lock)) { + return nullptr; + } + + m_async_op_tracker.start_op(); + return new FunctionContext([this](int r) { + m_async_op_tracker.finish_op(); + }); +} + template void ExclusiveLock::handle_init_complete(uint64_t features) { - ldout(m_image_ctx.cct, 10) << "features=" << features << dendl; + ldout(m_image_ctx.cct, 10) << ": features=" << features << dendl; if ((features & RBD_FEATURE_JOURNALING) != 0) { m_image_ctx.io_work_queue->set_require_lock_on_read();