aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfs/nfsclstate.h
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2019-12-12 23:22:55 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2019-12-12 23:22:55 +0000
commitc057a378180e630854dae599324be358046ce244 (patch)
tree26616a3cf0d0ab71a1d78191d9163b2385447c74 /sys/fs/nfs/nfsclstate.h
parentf5392eb67249a53a303ab21ae69deb4d063e372b (diff)
downloadsrc-c057a378180e630854dae599324be358046ce244.tar.gz
src-c057a378180e630854dae599324be358046ce244.zip
Add support for NFSv4.2 to the NFS client and server.
This patch adds support for NFSv4.2 (RFC-7862) and Extended Attributes (RFC-8276) to the NFS client and server. NFSv4.2 is comprised of several optional features that can be supported in addition to NFSv4.1. This patch adds the following optional features: - posix_fadvise(POSIX_FADV_WILLNEED/POSIX_FADV_DONTNEED) - posix_fallocate() - intra server file range copying via the copy_file_range(2) syscall --> Avoiding data tranfer over the wire to/from the NFS client. - lseek(SEEK_DATA/SEEK_HOLE) - Extended attribute syscalls for "user" namespace attributes as defined by RFC-8276. Although this patch is fairly large, it should not affect support for the other versions of NFS. However it does add two new sysctls that allow a sysadmin to limit which minor versions of NFSv4 a server supports, allowing a sysadmin to disable NFSv4.2. Unfortunately, when the NFS stats structure was last revised, it was assumed that there would be no additional operations added beyond what was specified in RFC-7862. However RFC-8276 did add additional operations, forcing the NFS stats structure to revised again. It now has extra unused entries in all arrays, so that future extensions to NFSv4.2 can be accomodated without revising this structure again. A future commit will update nfsstat(1) to report counts for the new NFSv4.2 specific operations/procedures. This patch affects the internal interface between the nfscommon, nfscl and nfsd modules and, as such, they all must be upgraded simultaneously. I will do a version bump (although arguably not needed), due to this. This code has survived a "make universe" but has not been built with a recent GCC. If you encounter build problems, please email me. Relnotes: yes
Notes
Notes: svn path=/head/; revision=355677
Diffstat (limited to 'sys/fs/nfs/nfsclstate.h')
-rw-r--r--sys/fs/nfs/nfsclstate.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h
index 2ada4bfc5540..e17be74c5581 100644
--- a/sys/fs/nfs/nfsclstate.h
+++ b/sys/fs/nfs/nfsclstate.h
@@ -64,6 +64,8 @@ struct nfsclsession {
uint64_t nfsess_slots;
uint32_t nfsess_sequenceid;
uint32_t nfsess_maxcache; /* Max size for cached reply. */
+ uint32_t nfsess_maxreq; /* Max request size. */
+ uint32_t nfsess_maxresp; /* Max reply size. */
uint16_t nfsess_foreslots;
uint16_t nfsess_backslots;
uint8_t nfsess_sessionid[NFSX_V4SESSIONID];
@@ -72,7 +74,7 @@ struct nfsclsession {
/*
* This structure holds the session, clientid and related information
- * needed for an NFSv4.1 Meta Data Server (MDS) or Data Server (DS).
+ * needed for an NFSv4.1 or NFSv4.2 Meta Data Server (MDS) or Data Server (DS).
* It is malloc'd to the correct length.
*/
struct nfsclds {
@@ -95,6 +97,7 @@ struct nfsclds {
#define NFSCLDS_DS 0x0004
#define NFSCLDS_CLOSED 0x0008
#define NFSCLDS_SAMECONN 0x0010
+#define NFSCLDS_MINORV2 0x0020
struct nfsclclient {
LIST_ENTRY(nfsclclient) nfsc_list;