From patchwork Thu Oct 25 12:26:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1643611 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 B954F3FC36 for ; Thu, 25 Oct 2012 12:27:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758951Ab2JYM1D (ORCPT ); Thu, 25 Oct 2012 08:27:03 -0400 Received: from mga03.intel.com ([143.182.124.21]:50693 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758904Ab2JYM1B (ORCPT ); Thu, 25 Oct 2012 08:27:01 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 25 Oct 2012 05:27:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,646,1344236400"; d="scan'208";a="209165544" Received: from unknown (HELO zyan5-mobl.ccr.corp.intel.com) ([10.255.21.91]) by azsmga001.ch.intel.com with ESMTP; 25 Oct 2012 05:26:59 -0700 From: "Yan, Zheng" To: sage@inktank.com, ceph-devel@vger.kernel.org Cc: "Yan, Zheng" Subject: [PATCH 3/4] mds: Send mdsdir as base inode for rejoins Date: Thu, 25 Oct 2012 20:26:51 +0800 Message-Id: <1351168012-4981-3-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351168012-4981-1-git-send-email-zheng.z.yan@intel.com> References: <1351168012-4981-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" Stray dir inodes are no longer base inodes, they are in the mdsdir and the mdrdir is base inode. Signed-off-by: Yan, Zheng --- src/mds/MDCache.cc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 8598f46..8c83abc 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -3315,10 +3315,9 @@ void MDCache::rejoin_send_rejoins() p->second->add_scatterlock_state(root); } } - for (int i = 0; i < NUM_STRAY; ++i) { - CInode *s = get_inode(MDS_INO_STRAY(p->first, i)); - if (s) - p->second->add_weak_inode(s->vino()); + if (CInode *in = get_inode(MDS_INO_MDSDIR(p->first))) { + if (in) + p->second->add_weak_inode(in->vino()); } } else { // strong @@ -3334,15 +3333,14 @@ void MDCache::rejoin_send_rejoins() p->second->add_scatterlock_state(root); } } - for (int i = 0; i < NUM_STRAY; ++i) { - if (CInode *in = get_inode(MDS_INO_STRAY(p->first, i))) { - p->second->add_weak_inode(in->vino()); - p->second->add_strong_inode(in->vino(), - in->get_caps_wanted(), - in->filelock.get_state(), - in->nestlock.get_state(), - in->dirfragtreelock.get_state()); - } + + if (CInode *in = get_inode(MDS_INO_MDSDIR(p->first))) { + p->second->add_weak_inode(in->vino()); + p->second->add_strong_inode(in->vino(), + in->get_caps_wanted(), + in->filelock.get_state(), + in->nestlock.get_state(), + in->dirfragtreelock.get_state()); } } }