From: Jason Dillaman Date: Wed, 9 Dec 2015 04:07:52 +0000 (-0500) Subject: librbd: ImageWatcher should release lock upon request X-Git-Tag: v10.0.2~35^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8740ddf0f74fd1a96edb866c9282a143d72be782;p=ceph.git librbd: ImageWatcher should release lock upon request Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 15a7616c9ac25..fc5845aa23334 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -581,9 +581,7 @@ bool ImageWatcher::handle_payload(const RequestLockPayload &payload, ldout(m_image_ctx.cct, 10) << this << " queuing release of exclusive lock" << dendl; - FunctionContext *ctx = new FunctionContext( - boost::bind(&ImageWatcher::notify_release_lock, this)); - m_task_finisher->queue(TASK_CODE_RELEASING_LOCK, ctx); + m_image_ctx.exclusive_lock->release_lock(nullptr); } return true; } diff --git a/src/librbd/ImageWatcher.h b/src/librbd/ImageWatcher.h index 9fd7c223c570d..9784227882433 100644 --- a/src/librbd/ImageWatcher.h +++ b/src/librbd/ImageWatcher.h @@ -46,7 +46,6 @@ public: int notify_rename(const std::string &image_name); void notify_acquired_lock(); - void notify_release_lock(); void notify_released_lock(); void notify_request_lock(); @@ -68,7 +67,6 @@ private: enum TaskCode { TASK_CODE_ACQUIRED_LOCK, TASK_CODE_REQUEST_LOCK, - TASK_CODE_RELEASING_LOCK, TASK_CODE_RELEASED_LOCK, TASK_CODE_CANCEL_ASYNC_REQUESTS, TASK_CODE_REREGISTER_WATCH,