svn commit: r346798 - projects/nfsv42/sys/fs/nfs

Rick Macklem rmacklem at FreeBSD.org
Sat Apr 27 23:29:57 UTC 2019


Author: rmacklem
Date: Sat Apr 27 23:29:55 2019
New Revision: 346798
URL: https://svnweb.freebsd.org/changeset/base/346798

Log:
  Add code that will clear the NFSv4.2 attributes for non-NFSv4.2 mounts.

Modified:
  projects/nfsv42/sys/fs/nfs/nfs.h
  projects/nfsv42/sys/fs/nfs/nfsproto.h

Modified: projects/nfsv42/sys/fs/nfs/nfs.h
==============================================================================
--- projects/nfsv42/sys/fs/nfs/nfs.h	Sat Apr 27 22:31:41 2019	(r346797)
+++ projects/nfsv42/sys/fs/nfs/nfs.h	Sat Apr 27 23:29:55 2019	(r346798)
@@ -431,6 +431,8 @@ typedef struct {
 		(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1;			\
 		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
 	}								\
+	if (((n)->nd_flag & ND_NFSV42) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2;			\
 } while (0)
 
 #define	NFSISSET_ATTRBIT(b, p)	((b)->bits[(p) / 32] & (1 << ((p) % 32)))
@@ -457,6 +459,8 @@ typedef struct {
 		(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1;			\
 		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
 	}								\
+	if (((n)->nd_flag & ND_NFSV42) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2;			\
 } while (0)
 
 #define	NFSCLRNOTSETABLE_ATTRBIT(b, n) do { 				\
@@ -465,6 +469,8 @@ typedef struct {
 	(b)->bits[2] &= NFSATTRBIT_SETABLE2;				\
 	if (((n)->nd_flag & ND_NFSV41) == 0)				\
 		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
+	if (((n)->nd_flag & ND_NFSV42) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2;			\
 } while (0)
 
 #define	NFSNONZERO_ATTRBIT(b)	((b)->bits[0] || (b)->bits[1] || (b)->bits[2])

Modified: projects/nfsv42/sys/fs/nfs/nfsproto.h
==============================================================================
--- projects/nfsv42/sys/fs/nfs/nfsproto.h	Sat Apr 27 22:31:41 2019	(r346797)
+++ projects/nfsv42/sys/fs/nfs/nfsproto.h	Sat Apr 27 23:29:55 2019	(r346798)
@@ -1159,6 +1159,11 @@ struct nfsv3_sattr {
 	NFSATTRBM_SUPPATTREXCLCREAT)
 
 /*
+ * NFSATTRBIT_NFSV42 - Attributes only supported by NFSv4.2.
+ */
+#define	NFSATTRBIT_NFSV42_2	0
+
+/*
  * Set of attributes that the getattr vnode op needs.
  * OR of the following bits.
  * NFSATTRBIT_GETATTR0 - bits 0<->31


More information about the svn-src-projects mailing list