From patchwork Thu Sep 26 18:41:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950341 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6226A9F288 for ; Thu, 26 Sep 2013 18:41:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F590202DD for ; Thu, 26 Sep 2013 18:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4043120164 for ; Thu, 26 Sep 2013 18:41:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754019Ab3IZSlo (ORCPT ); Thu, 26 Sep 2013 14:41:44 -0400 Received: from mail-qc0-f169.google.com ([209.85.216.169]:46099 "EHLO mail-qc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab3IZSlo (ORCPT ); Thu, 26 Sep 2013 14:41:44 -0400 Received: by mail-qc0-f169.google.com with SMTP id c9so1047556qcz.0 for ; Thu, 26 Sep 2013 11:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=IabZMYb5EvYNOMmeRndhj5eolnQwOHtEeSq7tJA9Co8=; b=e0cvNdcabx/rMe5rj8ckdmg4zID4UPORunrppubDLVGBcArmK9DCR3VGophOLLw8kw kCK2V8akos7vVAB4YUMEoCiiR0h/62qUr/sFWqPziHJZFdm2OPMJoDIW6XjgLNpoggto D/XoQwKGAA23o3TDpePXvfsohtEwZCv3zhj9/IVDaowSwooYsHsTueQYbFVyJw2TauBV v+GUb/gsG2SL7YZvVaY8Z6aajsAitEpd41AwfwQ+zHWp8c788ljHtB+ILW4PhZKIYiaj N1d8bwcgKdZ3zvNqL+gTLxGQyqsldFYXPJMpkD4LYK9AfPxsK5+j8imylufn/IBLeK0T Z2Og== X-Received: by 10.229.213.1 with SMTP id gu1mr3617068qcb.13.1380220903619; Thu, 26 Sep 2013 11:41:43 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id x8sm10301724qam.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:41:42 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 27/49] pnfsd: hash layouts on layout state Date: Thu, 26 Sep 2013 14:41:41 -0400 Message-Id: <1380220901-13918-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Benny Halevy --- fs/nfsd/nfs4pnfsd.c | 2 ++ fs/nfsd/pnfsd.h | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c index 2c5d30d..386afa3 100644 --- a/fs/nfsd/nfs4pnfsd.c +++ b/fs/nfsd/nfs4pnfsd.c @@ -133,6 +133,7 @@ struct sbid_tracker { new->ls_stid.sc_type = NFS4_LAYOUT_STID; INIT_LIST_HEAD(&new->ls_perclnt); INIT_LIST_HEAD(&new->ls_perfile); + INIT_LIST_HEAD(&new->ls_layouts); new->ls_client = clp; get_nfs4_file(fp); /* released on destroy_layout_state */ new->ls_file = fp; @@ -281,6 +282,7 @@ static void update_layout_stateid_locked(struct nfs4_layout_state *ls, stateid_t lp->lo_state = ls; spin_lock(&layout_lock); update_layout_stateid_locked(ls, stateid); + list_add_tail(&lp->lo_perstate, &ls->ls_layouts); spin_unlock(&layout_lock); dprintk("pNFS %s end\n", __func__); } diff --git a/fs/nfsd/pnfsd.h b/fs/nfsd/pnfsd.h index 852c250..1cd7a87 100644 --- a/fs/nfsd/pnfsd.h +++ b/fs/nfsd/pnfsd.h @@ -48,6 +48,7 @@ struct nfs4_layout_state { struct nfs4_client *ls_client; struct list_head ls_perfile; struct nfs4_file *ls_file; + struct list_head ls_layouts; }; /* outstanding layout */