From 8740ddf0f74fd1a96edb866c9282a143d72be782 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 8 Dec 2015 23:07:52 -0500 Subject: [PATCH] librbd: ImageWatcher should release lock upon request Signed-off-by: Jason Dillaman --- src/librbd/ImageWatcher.cc | 4 +--- src/librbd/ImageWatcher.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) 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, -- 2.39.5