summaryrefslogtreecommitdiffstats
path: root/utils/nfsd/nfssvc.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2011-09-20 07:40:15 -0400
committerSteve Dickson <steved@redhat.com>2011-09-20 07:41:36 -0400
commitfe34ff0312c7c22554087ecd78bbbeadb38ce195 (patch)
treef8c8690404b011c812696cce5b79bdfad4b5cd99 /utils/nfsd/nfssvc.c
parent10e9c07a18d7c8635def61ea19adbc47f2934853 (diff)
downloadnfs-utils-fe34ff0312c7c22554087ecd78bbbeadb38ce195.tar.gz
nfs-utils-fe34ff0312c7c22554087ecd78bbbeadb38ce195.tar.xz
nfs-utils-fe34ff0312c7c22554087ecd78bbbeadb38ce195.zip
nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options. Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental). Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/nfsd/nfssvc.c')
-rw-r--r--utils/nfsd/nfssvc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
index f607214..683008e 100644
--- a/utils/nfsd/nfssvc.c
+++ b/utils/nfsd/nfssvc.c
@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits,
}
void
-nfssvc_setvers(unsigned int ctlbits, int minorvers4)
+nfssvc_setvers(unsigned int ctlbits, int minorvers41)
{
int fd, n, off;
char *ptr;
@@ -280,11 +280,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers4)
if (fd < 0)
return;
- n = minorvers4 >= 0 ? minorvers4 : -minorvers4;
- if (n >= NFSD_MINMINORVERS4 && n <= NFSD_MAXMINORVERS4)
- off += snprintf(ptr+off, sizeof(buf) - off, "%c4.%d ",
- minorvers4 > 0 ? '+' : '-',
- n);
+ if (minorvers41)
+ off += snprintf(ptr+off, sizeof(buf) - off, "%c4.1",
+ minorvers41 > 0 ? '+' : '-');
for (n = NFSD_MINVERS; n <= NFSD_MAXVERS; n++) {
if (NFSCTL_VERISSET(ctlbits, n))
off += snprintf(ptr+off, sizeof(buf) - off, "+%d ", n);