From patchwork Thu May 5 18:24:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9026491 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4FEF1BF29F for ; Thu, 5 May 2016 18:25:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7051F203C3 for ; Thu, 5 May 2016 18:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 837AF203E6 for ; Thu, 5 May 2016 18:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753556AbcEESY6 (ORCPT ); Thu, 5 May 2016 14:24:58 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:35839 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbcEESY5 (ORCPT ); Thu, 5 May 2016 14:24:57 -0400 Received: by mail-qk0-f170.google.com with SMTP id j68so36030830qke.2 for ; Thu, 05 May 2016 11:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pU5ZX3meMN2JAQZZ8sPQB8i21ENiSG7VYDj+HAMULm0=; b=BpRTkxzBYOEldAa6rAka8ePkhr6ITS8gQSkmWY8aXMXD8uW3rsix1xp2gq7ZvvlkdS 7pRJu6DVx1WlZ6NzmM5TyM8MjlHDkdlqlLMGUdNqIaV7ujEpmruyd6sMKVPhtUlUW4y8 CPEJLkCjsDQzG+wnqlITcsFl/445hHpTJ5TmkPN4311fYXSKzwGmg+r79DsiaOyw5wV7 dWSaqa3xY9/errxhi2zpcmICw2kF2Kv4VtZc4A43JUfSHTJKwDALZvMyz0o0MrD6p8oq 7dYxy9blZHEup38dXGRZ7gTCq3qbSJaMbB2mm5b3Yui8GIVBWIhmStZbI3k3PWISXMJc 9gkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pU5ZX3meMN2JAQZZ8sPQB8i21ENiSG7VYDj+HAMULm0=; b=A9b0KUba5tLPmZEjz9cfwi9yupkE8Y4KVa812KYZCVr/PyB38dD8XRqfWxXWPQUXS4 bjwGMbovZRfqt7fGmnE+SALnOUzoAk4W3zg8zxHbyVB4Zq8n5XnOWiyUASwtkZWBOiah K99WypewuR+7BS7Lq55aKAA5O1O/sfHUz41FaQzOoSi7cOlE2WsF6Obtxdr+MC8+RLNy HiWBzscmdD0nqu6C0bLteT7gXLNnng8NqeBqwMTv4HDeFE/uuMFKL3TzkGPxV7dD1jEv eOrdWcPsVF7KkwfB5XveHJO16oQyzFkKBmX3TC18QJwo8aey3sANaTwamQlqfkfPabGG lI/w== X-Gm-Message-State: AOPr4FWlOYAZFNZevS1ayxjGhlhbeJeTQeTk15yci/aAthMSpOsMVb44GxdAsjXD5VcmhQ== X-Received: by 10.55.43.222 with SMTP id r91mr16946249qkr.117.1462472696540; Thu, 05 May 2016 11:24:56 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id x136sm4049807qkb.27.2016.05.05.11.24.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 May 2016 11:24:55 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: linux-nfs@vger.kernel.org Cc: hch@lst.de, Anna.Schumaker@netapp.com Subject: [RFC PATCH 2/6] nfs: record sequence in pnfs_layout_segment when it's created Date: Thu, 5 May 2016 14:24:44 -0400 Message-Id: <1462472688-5663-3-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462472688-5663-1-git-send-email-jeff.layton@primarydata.com> References: <1462472688-5663-1-git-send-email-jeff.layton@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=-8.9 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 In later patches, we're going to teach the client to be more selective about how it returns layouts. This means keeping a record of what the stateid's seqid was at the time that the server handed out a layout segment. Signed-off-by: Jeff Layton --- fs/nfs/pnfs.c | 1 + fs/nfs/pnfs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 89a5ef4df08a..7cc2c431f355 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1697,6 +1697,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) init_lseg(lo, lseg); lseg->pls_range = res->range; + lseg->pls_seq = be32_to_cpu(res->stateid.seqid); spin_lock(&ino->i_lock); if (pnfs_layoutgets_blocked(lo)) { diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 1ac1db5f6dad..62e61cf0ad98 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -64,6 +64,7 @@ struct pnfs_layout_segment { struct list_head pls_lc_list; struct pnfs_layout_range pls_range; atomic_t pls_refcount; + u32 pls_seq; unsigned long pls_flags; struct pnfs_layout_hdr *pls_layout; struct work_struct pls_work;