From: Mike Snitzer <snitzer@kernel.org>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: Tom Haynes <loghyr@hammerspace.com>, Chuck Lever <cel@kernel.org>,
linux-nfs@vger.kernel.org
Subject: [PATCH 1/4] nfs4.2: add nfs4_2.x to generate the UNCACHEABLE_FILE_DATA attribute
Date: Wed, 24 Jun 2026 15:17:03 -0400 [thread overview]
Message-ID: <20260624191706.72544-2-snitzer@kernel.org> (raw)
In-Reply-To: <20260624191706.72544-1-snitzer@kernel.org>
Introduce Documentation/sunrpc/xdr/nfs4_2.x for NFSv4.2 protocol
extensions and define the UNCACHEABLE_FILE_DATA attribute (attr 87)
there, verbatim from draft-ietf-nfsv4-uncacheable-files Section 7:
typedef bool fattr4_uncacheable_file_data;
const FATTR4_UNCACHEABLE_FILE_DATA = 87;
This mirrors how the sibling NFSv4.2 attributes (FATTR4_OFFLINE=83,
FATTR4_TIME_DELEG_*=84/85, FATTR4_OPEN_ARGUMENTS=86) are defined in
Documentation/sunrpc/xdr/nfs4_1.x and generated by
tools/net/sunrpc/xdrgen into <linux/sunrpc/xdrgen/nfs4_1.h>, which
nfs4.h already includes.
Wire the fs/nfsd "make xdrgen" target to generate the definitions header
<linux/sunrpc/xdrgen/nfs4_2.h> and include it from <linux/nfs4.h>, so the
generated FATTR4_UNCACHEABLE_FILE_DATA constant and the
NFS4_fattr4_uncacheable_file_data_sz size macro are available to the
NFSv4.2 client support that follows.
No functional change.
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Assisted-by: Claude:claude-opus-4-8
---
Documentation/sunrpc/xdr/nfs4_2.x | 52 ++++++++++++++++++++++++++++
fs/nfsd/Makefile | 5 ++-
include/linux/nfs4.h | 1 +
include/linux/sunrpc/xdrgen/nfs4_2.h | 19 ++++++++++
4 files changed, 76 insertions(+), 1 deletion(-)
create mode 100644 Documentation/sunrpc/xdr/nfs4_2.x
create mode 100644 include/linux/sunrpc/xdrgen/nfs4_2.h
diff --git a/Documentation/sunrpc/xdr/nfs4_2.x b/Documentation/sunrpc/xdr/nfs4_2.x
new file mode 100644
index 000000000000..d10a91d657b0
--- /dev/null
+++ b/Documentation/sunrpc/xdr/nfs4_2.x
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2026 IETF Trust and the persons identified
+ * as the document authors. All rights reserved.
+ *
+ * The document authors are identified in RFC 7862 and
+ * draft-ietf-nfsv4-uncacheable-files.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ *
+ * - Neither the name of Internet Society, IETF or IETF
+ * Trust, nor the names of specific contributors, may be
+ * used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+pragma header nfs4;
+
+/*
+ * The following content was extracted from
+ * draft-ietf-nfsv4-uncacheable-files
+ */
+
+typedef bool fattr4_uncacheable_file_data;
+
+const FATTR4_UNCACHEABLE_FILE_DATA = 87;
diff --git a/fs/nfsd/Makefile b/fs/nfsd/Makefile
index f0da4d69dc74..0ff198e102a3 100644
--- a/fs/nfsd/Makefile
+++ b/fs/nfsd/Makefile
@@ -37,11 +37,14 @@ nfsd-$(CONFIG_DEBUG_FS) += debugfs.o
#
.PHONY: xdrgen
-xdrgen: ../../include/linux/sunrpc/xdrgen/nfs4_1.h nfs4xdr_gen.h nfs4xdr_gen.c
+xdrgen: ../../include/linux/sunrpc/xdrgen/nfs4_1.h ../../include/linux/sunrpc/xdrgen/nfs4_2.h nfs4xdr_gen.h nfs4xdr_gen.c
../../include/linux/sunrpc/xdrgen/nfs4_1.h: ../../Documentation/sunrpc/xdr/nfs4_1.x
../../tools/net/sunrpc/xdrgen/xdrgen definitions $< > $@
+../../include/linux/sunrpc/xdrgen/nfs4_2.h: ../../Documentation/sunrpc/xdr/nfs4_2.x
+ ../../tools/net/sunrpc/xdrgen/xdrgen definitions $< > $@
+
nfs4xdr_gen.h: ../../Documentation/sunrpc/xdr/nfs4_1.x
../../tools/net/sunrpc/xdrgen/xdrgen declarations $< > $@
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 44e5e9fa12e1..34aa303354bc 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -18,6 +18,7 @@
#include <uapi/linux/nfs4.h>
#include <linux/sunrpc/msg_prot.h>
#include <linux/sunrpc/xdrgen/nfs4_1.h>
+#include <linux/sunrpc/xdrgen/nfs4_2.h>
enum nfs4_acl_whotype {
NFS4_ACL_WHO_NAMED = 0,
diff --git a/include/linux/sunrpc/xdrgen/nfs4_2.h b/include/linux/sunrpc/xdrgen/nfs4_2.h
new file mode 100644
index 000000000000..9441f6cefbff
--- /dev/null
+++ b/include/linux/sunrpc/xdrgen/nfs4_2.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Generated by xdrgen. Manual edits will be lost. */
+/* XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_2.x */
+/* XDR specification modification time: Fri Jun 12 10:44:36 2026 */
+
+#ifndef _LINUX_XDRGEN_NFS4_2_DEF_H
+#define _LINUX_XDRGEN_NFS4_2_DEF_H
+
+#include <linux/types.h>
+#include <linux/sunrpc/xdrgen/_defs.h>
+
+typedef bool fattr4_uncacheable_file_data;
+
+enum { FATTR4_UNCACHEABLE_FILE_DATA = 87 };
+
+#define NFS4_fattr4_uncacheable_file_data_sz \
+ (XDR_bool)
+
+#endif /* _LINUX_XDRGEN_NFS4_2_DEF_H */
--
2.47.3
next prev parent reply other threads:[~2026-06-24 19:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 19:17 [PATCH 0/4] nfs: NFSv4.2 client support for UNCACHEABLE_FILE_DATA Mike Snitzer
2026-06-24 19:17 ` Mike Snitzer [this message]
2026-06-24 19:17 ` [PATCH 2/4] nfs4.2: add UNCACHEABLE_FILE_DATA attribute support Mike Snitzer
2026-06-24 19:17 ` [PATCH 3/4] nfs4.2: request UNCACHEABLE_FILE_DATA only for regular files Mike Snitzer
2026-06-24 19:17 ` [PATCH 4/4] nfs4.2: open UNCACHEABLE_FILE_DATA files with O_DIRECT Mike Snitzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624191706.72544-2-snitzer@kernel.org \
--to=snitzer@kernel.org \
--cc=anna@kernel.org \
--cc=cel@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=loghyr@hammerspace.com \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox