Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3565864pxb; Mon, 16 Nov 2020 19:27:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKEFubSP0HdTQYAmj4XQ6UegDluGuKOmc0h/h0n4dZNlaeBib96XcZ031cQcWIl/YlmTSn X-Received: by 2002:a50:9e29:: with SMTP id z38mr19200067ede.220.1605583647378; Mon, 16 Nov 2020 19:27:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605583647; cv=none; d=google.com; s=arc-20160816; b=KQpH7l9gIefk2H5YScFU1ti888zlldkD3zkncXxnYlzmuA3noUggCPLsA9qWwWAFhz rymCvSVqOpS8k0zK4SJDYsbTBDOCWZ6s+LQ3wdAHSeTfKRuNbgN+RxwIWcCpl2BTJqAh VBTUapY4UDLkxOOopM3iXeHd16uIbPlscKS0ikwhVPd+fn3T4sByBh1F3MW+03CEOV8h Wofr6z5Qvyo5CDE9I+FC3SJOk7+MVIHM4Rzt8GRtBm0zCNLjJICoN40KdV9Qqj8YoXEI 9y78B+6JjULUq/q/ZO6bU6usfJHSSOgow5NZ2JhiNa0SyxdQrahK0H0x/S6gkkC6NyQ9 h5XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-filter; bh=Qh8cD6Z/VSpCLz67/l+M411BDYXfQ5zoGadhJkCxGpc=; b=YRpBQVyBeYde7dc62e/Bu3XmDp5/urQ7yT/cSNphxjWRd38Ltf9Vb1m/zNy1Z0cqtX E0qlTBNuHMsk49Dof54XuL7v7jytqMMHTEcpMdpruAUGFidESqj80AoqcGWHNFnc8DUS YSphoPOVWAlkyNMvCBoxZBnDDFV0FJGdXyVAz1n/mJ38tMdIxVuWFSo8RqQXHpnPw28T TP2q2s9VSD9Nk7CEEAi9zEcgiCYfCPFjSqoUsmHGgMdrl93afJF0EAsY4lrztS8wB/IG EE9zQNJfHnBGpOpF0jL0wbFbThCHpVinJr2y/XxHko8nEkz+23ifgy+U/yyv7sRl8px9 rm5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt10si7219248ejb.44.2020.11.16.19.27.05; Mon, 16 Nov 2020 19:27:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726085AbgKQDSK (ORCPT + 99 others); Mon, 16 Nov 2020 22:18:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbgKQDSJ (ORCPT ); Mon, 16 Nov 2020 22:18:09 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CDC0C0613D3 for ; Mon, 16 Nov 2020 19:18:09 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id CBBE61C29; Mon, 16 Nov 2020 22:18:08 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org CBBE61C29 From: "J. Bruce Fields" To: Jeff Layton Cc: Daire Byrne , Trond Myklebust , linux-cachefs , linux-nfs , "J. Bruce Fields" Subject: [PATCH 3/4] nfs: don't mangle i_version on NFS Date: Mon, 16 Nov 2020 22:18:05 -0500 Message-Id: <1605583086-19869-3-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605583086-19869-1-git-send-email-bfields@redhat.com> References: <20201117031601.GB10526@fieldses.org> <1605583086-19869-1-git-send-email-bfields@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" The i_version on NFS has pretty much opaque to the client, so we don't want to give the low bit any special interpretation. Define a new FS_PRIVATE_I_VERSION flag for filesystems that manage the i_version on their own. Signed-off-by: J. Bruce Fields --- fs/nfs/export.c | 1 + include/linux/exportfs.h | 1 + include/linux/iversion.h | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/fs/nfs/export.c b/fs/nfs/export.c index 3430d6891e89..c2eb915a54ca 100644 --- a/fs/nfs/export.c +++ b/fs/nfs/export.c @@ -171,4 +171,5 @@ const struct export_operations nfs_export_ops = { .encode_fh = nfs_encode_fh, .fh_to_dentry = nfs_fh_to_dentry, .get_parent = nfs_get_parent, + .fetch_iversion = inode_peek_iversion_raw, }; diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 3ceb72b67a7a..6000121a201f 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -213,6 +213,7 @@ struct export_operations { bool write, u32 *device_generation); int (*commit_blocks)(struct inode *inode, struct iomap *iomaps, int nr_iomaps, struct iattr *iattr); + u64 (*fetch_iversion)(const struct inode *); }; extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, diff --git a/include/linux/iversion.h b/include/linux/iversion.h index 2917ef990d43..481b3debf6bb 100644 --- a/include/linux/iversion.h +++ b/include/linux/iversion.h @@ -3,6 +3,7 @@ #define _LINUX_IVERSION_H #include +#include /* * The inode->i_version field: @@ -306,6 +307,9 @@ inode_query_iversion(struct inode *inode) { u64 cur, old, new; + if (inode->i_sb->s_export_op->fetch_iversion) + return inode->i_sb->s_export_op->fetch_iversion(inode); + cur = inode_peek_iversion_raw(inode); for (;;) { /* If flag is already set, then no need to swap */ -- 2.28.0