Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Dec 2019 01:53:02 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355435 - head/sys/fs/nfs
Message-ID:  <201912060153.xB61r2Zu023689@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Dec  6 01:53:02 2019
New Revision: 355435
URL: https://svnweb.freebsd.org/changeset/base/355435

Log:
  Add some definitions for NFSv4.2 which will be used by subsequent commits.
  
  This is a preliminary commit of NFSv4.2 definitions that will be used by
  subsequent commits which adds NFSv4.2 support to the NFS client and server.
  
  There will be a series of these preliminary commits that will prepare for
  a major commit of the NFSv4.2 client/server changes currently found in
  subversion under projects/nfsv42/sys.

Modified:
  head/sys/fs/nfs/nfsproto.h

Modified: head/sys/fs/nfs/nfsproto.h
==============================================================================
--- head/sys/fs/nfs/nfsproto.h	Fri Dec  6 00:29:16 2019	(r355434)
+++ head/sys/fs/nfs/nfsproto.h	Fri Dec  6 01:53:02 2019	(r355435)
@@ -705,6 +705,7 @@
 /* Flags for File Layout. */
 #define	NFSFLAYUTIL_DENSE		0x1
 #define	NFSFLAYUTIL_COMMIT_THRU_MDS	0x2
+#define	NFSFLAYUTIL_IOADVISE_THRU_MDS	0x4
 #define	NFSFLAYUTIL_STRIPE_MASK		0xffffffc0
 
 /* Flags for Flex File Layout. */
@@ -874,6 +875,24 @@ struct nfsv3_sattr {
 	u_int32_t sa_mtimetype;
 	nfstime3  sa_mtime;
 };
+
+/*
+ * IO Advise hint bits for NFSv4.2.
+ * Since these go on the wire as a bitmap, the NFSATTRBIT macros are
+ * used to manipulate these bits.
+ */
+#define	NFSV4IOHINT_NORMAL		0
+#define	NFSV4IOHINT_SEQUENTIAL		1
+#define	NFSV4IOHINT_SEQUENTIALBACK	2
+#define	NFSV4IOHINT_RANDOM		3
+#define	NFSV4IOHINT_WILLNEED		4
+#define	NFSV4IOHINT_WILLNEEDOPTUN	5
+#define	NFSV4IOHINT_DONTNEED		6
+#define	NFSV4IOHINT_NOREUSE		7
+#define	NFSV4IOHINT_READ		8
+#define	NFSV4IOHINT_WRITE		9
+#define	NFSV4IOHINT_INITPROXIMITY	10
+
 #endif	/* _KERNEL */
 
 /*
@@ -960,6 +979,12 @@ struct nfsv3_sattr {
 #define	NFSATTRBIT_MODESETMASKED	74
 #define	NFSATTRBIT_SUPPATTREXCLCREAT	75
 #define	NFSATTRBIT_FSCHARSETCAP		76
+#define	NFSATTRBIT_CLONEBLKSIZE		77
+#define	NFSATTRBIT_SPACEFREED		78
+#define	NFSATTRBIT_CHANGEATTRTYPE	79
+#define	NFSATTRBIT_SECLABEL		80
+/* Not sure what attribute bit #81 is? */
+#define	NFSATTRBIT_XATTRSUPPORT		82
 
 #define	NFSATTRBM_SUPPORTEDATTRS	0x00000001
 #define	NFSATTRBM_TYPE			0x00000002
@@ -1038,6 +1063,12 @@ struct nfsv3_sattr {
 #define	NFSATTRBM_MODESETMASKED		0x00000400
 #define	NFSATTRBM_SUPPATTREXCLCREAT	0x00000800
 #define	NFSATTRBM_FSCHARSETCAP		0x00001000
+#define	NFSATTRBM_CLONEBLKSIZE		0x00002000
+#define	NFSATTRBM_SPACEFREED		0x00004000
+#define	NFSATTRBM_CHANGEATTRTYPE	0x00008000
+#define	NFSATTRBM_SECLABEL		0x00010000
+/* Not sure what attribute bit#81/0x00020000 is? */
+#define	NFSATTRBM_XATTRSUPPORT		0x00040000
 
 #define	NFSATTRBIT_MAX			77
 
@@ -1162,6 +1193,11 @@ struct nfsv3_sattr {
 	NFSATTRBM_SUPPATTREXCLCREAT)
 
 /*
+ * NFSATTRBIT_NFSV42 - Attributes only supported by NFSv4.2.
+ */
+#define	NFSATTRBIT_NFSV42_2	NFSATTRBM_XATTRSUPPORT
+
+/*
  * Set of attributes that the getattr vnode op needs.
  * OR of the following bits.
  * NFSATTRBIT_GETATTR0 - bits 0<->31
@@ -1462,5 +1498,14 @@ typedef struct nfsv4stateid nfsv4stateid_t;
 #define	NFSV4LAYOUTRET_FILE	1
 #define	NFSV4LAYOUTRET_FSID	2
 #define	NFSV4LAYOUTRET_ALL	3
+
+/* Seek Contents. */
+#define	NFSV4CONTENT_DATA	0
+#define	NFSV4CONTENT_HOLE	1
+
+/* Options for Set Extended attribute (RFC-8276). */
+#define	NFSV4SXATTR_EITHER	0
+#define	NFSV4SXATTR_CREATE	1
+#define	NFSV4SXATTR_REPLACE	2
 
 #endif	/* _NFS_NFSPROTO_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912060153.xB61r2Zu023689>