nfsd41: control nfsv4.1 svc via /proc/fs/nfsd/versions
Support enabling and disabling nfsv4.1 via /proc/fs/nfsd/versions by writing the strings "+4.1" or "-4.1" correspondingly. Use user mode nfs-utils (rpc.nfsd option) to enable. This will allow us to get rid of CONFIG_NFSD_V4_1 [nfsd41: disable support for minorversion by default] Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
committed by
J. Bruce Fields
parent
84459a1162
commit
8daf220a6a
@@ -121,6 +121,8 @@ struct svc_program nfsd_program = {
|
||||
|
||||
};
|
||||
|
||||
u32 nfsd_supported_minorversion;
|
||||
|
||||
int nfsd_vers(int vers, enum vers_op change)
|
||||
{
|
||||
if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS)
|
||||
@@ -147,6 +149,28 @@ int nfsd_vers(int vers, enum vers_op change)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nfsd_minorversion(u32 minorversion, enum vers_op change)
|
||||
{
|
||||
if (minorversion > NFSD_SUPPORTED_MINOR_VERSION)
|
||||
return -1;
|
||||
switch(change) {
|
||||
case NFSD_SET:
|
||||
nfsd_supported_minorversion = minorversion;
|
||||
break;
|
||||
case NFSD_CLEAR:
|
||||
if (minorversion == 0)
|
||||
return -1;
|
||||
nfsd_supported_minorversion = minorversion - 1;
|
||||
break;
|
||||
case NFSD_TEST:
|
||||
return minorversion <= nfsd_supported_minorversion;
|
||||
case NFSD_AVAIL:
|
||||
return minorversion <= NFSD_SUPPORTED_MINOR_VERSION;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Maximum number of nfsd processes
|
||||
*/
|
||||
|
Reference in New Issue
Block a user