From patchwork Wed Jul 17 08:28:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2828489 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00850C0AB2 for ; Wed, 17 Jul 2013 08:29:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25EC620171 for ; Wed, 17 Jul 2013 08:29:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D53220173 for ; Wed, 17 Jul 2013 08:28:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753109Ab3GQI24 (ORCPT ); Wed, 17 Jul 2013 04:28:56 -0400 Received: from mga14.intel.com ([143.182.124.37]:50906 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055Ab3GQI2x (ORCPT ); Wed, 17 Jul 2013 04:28:53 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 17 Jul 2013 01:28:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,683,1367996400"; d="scan'208";a="269368661" Received: from zyan5-mobl.sh.intel.com ([10.239.13.5]) by AZSMGA002.ch.intel.com with ESMTP; 17 Jul 2013 01:28:51 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, "Yan, Zheng" Subject: [PATCH 5/6] mds: wake xlock waiter when xlock is done Date: Wed, 17 Jul 2013 16:28:42 +0800 Message-Id: <1374049723-19274-6-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1374049723-19274-1-git-send-email-zheng.z.yan@intel.com> References: <1374049723-19274-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Yan, Zheng" Once a lock is in LOCK_XLOCKDONE state, client already holds xlock can acquire extra xlock. So wake up xlock waiter when we set lock state to LOCK_XLOCKDONE. Signed-off-by: Yan, Zheng --- src/mds/Locker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 47ea6fc..a4b50db 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -477,6 +477,7 @@ void Locker::set_xlocks_done(Mutation *mut, bool skip_dentry) continue; dout(10) << "set_xlocks_done on " << **p << " " << *(*p)->get_parent() << dendl; (*p)->set_xlock_done(); + (*p)->finish_waiters(ScatterLock::WAIT_XLOCK); } } @@ -1419,7 +1420,7 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequest *mut) } } - lock->add_waiter(SimpleLock::WAIT_WR|SimpleLock::WAIT_STABLE, new C_MDS_RetryRequest(mdcache, mut)); + lock->add_waiter(SimpleLock::WAIT_XLOCK|SimpleLock::WAIT_STABLE, new C_MDS_RetryRequest(mdcache, mut)); nudge_log(lock); return false; } else {