From owner-svn-src-head@freebsd.org Fri Dec 6 01:53:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 215851B2E86; Fri, 6 Dec 2019 01:53:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47TbFq061qz3N7G; Fri, 6 Dec 2019 01:53:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBF9222089; Fri, 6 Dec 2019 01:53:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB61r2Y3023690; Fri, 6 Dec 2019 01:53:02 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB61r2Zu023689; Fri, 6 Dec 2019 01:53:02 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912060153.xB61r2Zu023689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 Dec 2019 01:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355435 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 355435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2019 01:53:03 -0000 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_ */