From patchwork Wed May 11 10:21:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9067431 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 C007ABF29F for ; Wed, 11 May 2016 10:21:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94B5B201BB for ; Wed, 11 May 2016 10:21:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACF87201B9 for ; Wed, 11 May 2016 10:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932116AbcEKKV3 (ORCPT ); Wed, 11 May 2016 06:21:29 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33107 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbcEKKV0 (ORCPT ); Wed, 11 May 2016 06:21:26 -0400 Received: by mail-qk0-f193.google.com with SMTP id q184so2745376qkf.0 for ; Wed, 11 May 2016 03:21:26 -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=injMkXzLVLolGv//2KBQ1mlwZKMHPZjFmc3Mi+YaNKc=; b=h1sKyJ7gw96Kysb323DpAxzXaWO7hfhOor95ZSKGWlAo4Zp0n6wrMO6etq/ybToB+z ms2AiIz+6gPUM3YS03ry9KgtXIJgdDJPWMN3s/LQNYHcLBa9UiKgR/wYUJyAenIrkIav 8KwIm2ps5/1lLGDZOzPs1ixzsOO7WJ9RsiHqDr12wnN4vzqPEGvpiQYEwdt4xPT9uELZ EbCqdaMyx804fdrhAGDBsDReP/D2ZnMSIomu6ASlf/gyiOlvk2hKQBH51FpfRSVW2v8n G8ieJxsmpTk+SHTZJLkvlGoZh/mOl6dBq1VpBC3x70/NPxq/hVWDfcz7j9735rcnJZ8I LbzQ== 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=injMkXzLVLolGv//2KBQ1mlwZKMHPZjFmc3Mi+YaNKc=; b=W/ZuyoikLqaLUw0kTraUQSySP2JlpSZ4WX+OsVDZ7+JP7PMlMOVOxbdZlMOYxWmK17 z91QnBZ5oo+hytHg0wfoxYzESJSGtwF88RE83wNj3UbLnyl4MysWtQ9HdvBw97UCAHAw b0wtLac7MTYJ7v/3W/V2eN5OQfD+vhbni9Xrh0KWyxo5VoSaNDJYF1JW2LuL+K6VDRW6 sjNukuk4MLgPbbvAqwHCveWpKgPGpBPN7x3VeNKduu+pAkIUu3y/pGa1pnj4xK/yxiH3 pw4byV883ZkqN6KPg5BAyhqlc7FtDJ0YgDmMuJ2YwtNPWnDI/v6t49L++DNIc2WUtA3g BrZA== X-Gm-Message-State: AOPr4FVGo7Q12HQPbHnKhin7CP+dlxbp8qS6VQLNjhOlGYKzY2jAq/oAEPfu1b/WETSQ5g== X-Received: by 10.55.22.169 with SMTP id 41mr2476866qkw.111.1462962085550; Wed, 11 May 2016 03:21:25 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id r127sm3048446qkf.47.2016.05.11.03.21.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 May 2016 03:21:24 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 2/9] pnfs: record sequence in pnfs_layout_segment when it's created Date: Wed, 11 May 2016 06:21:07 -0400 Message-Id: <1462962074-6989-3-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462962074-6989-1-git-send-email-jeff.layton@primarydata.com> References: <1462962074-6989-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.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 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 5b404d926e08..18b6f950e300 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 7222d3a35439..361fa5494aa5 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;