From patchwork Fri Apr 12 08:11:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2434461 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 46DF43FD40 for ; Fri, 12 Apr 2013 08:11:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753881Ab3DLILW (ORCPT ); Fri, 12 Apr 2013 04:11:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:62108 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753701Ab3DLILS (ORCPT ); Fri, 12 Apr 2013 04:11:18 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 12 Apr 2013 01:09:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,461,1363158000"; d="scan'208";a="317091192" Received: from zyan5-mobl.sh.intel.com ([10.239.13.24]) by orsmga002.jf.intel.com with ESMTP; 12 Apr 2013 01:11:16 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: greg@inktank.com, elder@inktank.com, "Yan, Zheng" Subject: [PATCH 1/2] mds: pass proper mask to CInode::get_caps_issued Date: Fri, 12 Apr 2013 16:11:09 +0800 Message-Id: <1365754273-14088-2-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1365754273-14088-1-git-send-email-zheng.z.yan@intel.com> References: <1365754273-14088-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 From: "Yan, Zheng" There is a total of 22 cap bits and file lock uses 8 cap bits. Signed-off-by: Yan, Zheng --- src/mds/CInode.h | 4 ++-- src/mds/Locker.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 43af9c4..a3fe3cf 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -736,9 +736,9 @@ public: // caps issued, wanted int get_caps_issued(int *ploner = 0, int *pother = 0, int *pxlocker = 0, - int shift = 0, int mask = 0xffff); + int shift = 0, int mask = -1); bool is_any_caps_wanted(); - int get_caps_wanted(int *ploner = 0, int *pother = 0, int shift = 0, int mask = 0xffff); + int get_caps_wanted(int *ploner = 0, int *pother = 0, int shift = 0, int mask = -1); bool issued_caps_need_gather(SimpleLock *lock); void replicate_relax_locks(); diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 7ba9f44..f86ba88 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -616,7 +616,8 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, listis_head()) { - in->get_caps_issued(&loner_issued, &other_issued, &xlocker_issued, lock->get_cap_shift(), 3); + in->get_caps_issued(&loner_issued, &other_issued, &xlocker_issued, + lock->get_cap_shift(), lock->get_cap_mask()); dout(10) << " next state is " << lock->get_state_name(next) << " issued/allows loner " << gcap_string(loner_issued) << "/" << gcap_string(lock->gcaps_allowed(CAP_LONER, next))