linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank van der Linden <fllinden@amazon.com>
To: <linux-nfs@vger.kernel.org>, <anna.schumaker@netapp.com>,
	<trond.myklebust@hammerspace.com>
Cc: Frank van der Linden <fllinden@amazon.com>
Subject: [PATCH v3 01/13] nfs,nfsd:  NFSv4.2 extended attribute protocol definitions
Date: Tue, 23 Jun 2020 22:38:52 +0000	[thread overview]
Message-ID: <20200623223904.31643-2-fllinden@amazon.com> (raw)
In-Reply-To: <20200623223904.31643-1-fllinden@amazon.com>

Add definitions for the new operations, errors and flags as defined
in RFC 8276 (File System Extended Attributes in NFSv4).

Signed-off-by: Frank van der Linden <fllinden@amazon.com>
---
 include/linux/nfs4.h      | 20 ++++++++++++++++++++
 include/uapi/linux/nfs4.h |  3 +++
 2 files changed, 23 insertions(+)

diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 4dba3c948932..e6ca9d1d2e76 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -150,6 +150,12 @@ enum nfs_opnum4 {
 	OP_WRITE_SAME = 70,
 	OP_CLONE = 71,
 
+	/* xattr support (RFC8726) */
+	OP_GETXATTR                = 72,
+	OP_SETXATTR                = 73,
+	OP_LISTXATTRS              = 74,
+	OP_REMOVEXATTR             = 75,
+
 	OP_ILLEGAL = 10044,
 };
 
@@ -280,6 +286,10 @@ enum nfsstat4 {
 	NFS4ERR_WRONG_LFS = 10092,
 	NFS4ERR_BADLABEL = 10093,
 	NFS4ERR_OFFLOAD_NO_REQS = 10094,
+
+	/* xattr (RFC8276) */
+	NFS4ERR_NOXATTR        = 10095,
+	NFS4ERR_XATTR2BIG      = 10096,
 };
 
 static inline bool seqid_mutating_err(u32 err)
@@ -452,6 +462,7 @@ enum change_attr_type4 {
 #define FATTR4_WORD2_CHANGE_ATTR_TYPE	(1UL << 15)
 #define FATTR4_WORD2_SECURITY_LABEL     (1UL << 16)
 #define FATTR4_WORD2_MODE_UMASK		(1UL << 17)
+#define FATTR4_WORD2_XATTR_SUPPORT	(1UL << 18)
 
 /* MDS threshold bitmap bits */
 #define THRESHOLD_RD                    (1UL << 0)
@@ -700,4 +711,13 @@ struct nl4_server {
 		struct nfs42_netaddr	nl4_addr; /* NL4_NETADDR */
 	} u;
 };
+
+/*
+ * Options for setxattr. These match the flags for setxattr(2).
+ */
+enum nfs4_setxattr_options {
+	SETXATTR4_EITHER	= 0,
+	SETXATTR4_CREATE	= 1,
+	SETXATTR4_REPLACE	= 2,
+};
 #endif
diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h
index 8572930cf5b0..bf197e99b98f 100644
--- a/include/uapi/linux/nfs4.h
+++ b/include/uapi/linux/nfs4.h
@@ -33,6 +33,9 @@
 #define NFS4_ACCESS_EXTEND      0x0008
 #define NFS4_ACCESS_DELETE      0x0010
 #define NFS4_ACCESS_EXECUTE     0x0020
+#define NFS4_ACCESS_XAREAD      0x0040
+#define NFS4_ACCESS_XAWRITE     0x0080
+#define NFS4_ACCESS_XALIST      0x0100
 
 #define NFS4_FH_PERSISTENT		0x0000
 #define NFS4_FH_NOEXPIRE_WITH_OPEN	0x0001
-- 
2.17.2


  reply	other threads:[~2020-06-23 22:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 22:38 [PATCH v3 00/13] client side user xattr (RFC8276) support Frank van der Linden
2020-06-23 22:38 ` Frank van der Linden [this message]
2020-06-23 22:38 ` [PATCH v3 02/13] nfs: add client side only definitions for user xattrs Frank van der Linden
2020-06-23 22:38 ` [PATCH v3 03/13] NFSv4.2: define limits and sizes for user xattr handling Frank van der Linden
2020-06-23 22:38 ` [PATCH v3 04/13] NFSv4.2: query the server for extended attribute support Frank van der Linden
2020-06-23 22:38 ` [PATCH v3 05/13] NFSv4.2: add client side XDR handling for extended attributes Frank van der Linden
2020-06-23 22:38 ` [PATCH v3 06/13] nfs: define nfs_access_get_cached function Frank van der Linden
2020-06-23 22:38 ` [PATCH v3 07/13] NFSv4.2: query the extended attribute access bits Frank van der Linden
2020-06-23 22:38 ` [PATCH v3 08/13] nfs: modify update_changeattr to deal with regular files Frank van der Linden
2020-06-23 22:39 ` [PATCH v3 09/13] nfs: define and use the NFS_INO_INVALID_XATTR flag Frank van der Linden
2020-06-23 22:39 ` [PATCH v3 10/13] nfs: make the buf_to_pages_noslab function available to the nfs code Frank van der Linden
2020-06-23 22:39 ` [PATCH v3 11/13] NFSv4.2: add the extended attribute proc functions Frank van der Linden
2020-06-23 22:39 ` [PATCH v3 12/13] NFSv4.2: hook in the user extended attribute handlers Frank van der Linden
2020-08-21  6:50   ` Murphy Zhou
2020-08-21 16:03     ` Frank van der Linden
2020-08-21 16:41       ` Trond Myklebust
2020-08-24  0:13         ` Murphy Zhou
2020-08-24 16:16           ` Frank van der Linden
2020-08-25  0:14             ` Murphy Zhou
2020-06-23 22:39 ` [PATCH v3 13/13] NFSv4.2: add client side xattr caching Frank van der Linden
2020-07-14 17:20 ` [PATCH v3 00/13] client side user xattr (RFC8276) support van der Linden, Frank

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=20200623223904.31643-2-fllinden@amazon.com \
    --to=fllinden@amazon.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /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;
as well as URLs for NNTP newsgroup(s).