From d53fe5fe72d2b8d645ad362840da42021363384d Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 4 Apr 2017 17:57:26 -0400 Subject: nfsd: Allow the caller to turn off NFSv4.0 without turning off NFSv4.x The new semantic is that '-N4' turns off all NFSv4 minor versions, while '-V4' turns them all on. In order to turn off just minor version x (x >= 0), use -N4.x, and to turn it back on. '-V4.x'. Note that on older kernels, attempting to use -N4.0 and -V4.0 is equivalent to specifying -N4 or -V4. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson --- support/include/nfs/nfs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'support/include/nfs/nfs.h') diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h index 15ecc6b..5860343 100644 --- a/support/include/nfs/nfs.h +++ b/support/include/nfs/nfs.h @@ -16,8 +16,8 @@ #define NFSD_MINVERS 2 #define NFSD_MAXVERS 4 -#define NFS4_MINMINOR 1 -#define NFS4_MAXMINOR WORD_BIT +#define NFS4_MINMINOR 0 +#define NFS4_MAXMINOR (WORD_BIT-1) struct nfs_fh_len { int fh_size; @@ -29,15 +29,18 @@ struct nfs_fh_len { #define NFSCTL_TCPBIT (1 << (18 - 1)) #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1))) +#define NFSCTL_MINORUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v))) #define NFSCTL_UDPUNSET(_cltbits) ((_cltbits) &= ~NFSCTL_UDPBIT) #define NFSCTL_TCPUNSET(_cltbits) ((_cltbits) &= ~NFSCTL_TCPBIT) #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1))) +#define NFSCTL_MINORISSET(_cltbits, _v) ((_cltbits) & (1 << (_v))) #define NFSCTL_UDPISSET(_cltbits) ((_cltbits) & NFSCTL_UDPBIT) #define NFSCTL_TCPISSET(_cltbits) ((_cltbits) & NFSCTL_TCPBIT) #define NFSCTL_VERDEFAULT (0xc) /* versions 3 and 4 */ #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << ((_v) - 1))) +#define NFSCTL_MINORSET(_cltbits, _v) ((_cltbits) |= (1 << (_v))) #define NFSCTL_UDPSET(_cltbits) ((_cltbits) |= NFSCTL_UDPBIT) #define NFSCTL_TCPSET(_cltbits) ((_cltbits) |= NFSCTL_TCPBIT) -- cgit