Commit fac1e8e4 authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust

NFS: Keep module parameters in the generic NFS client

Otherwise we break backwards compatibility when v4 becomes a modules.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 19d87ca3
...@@ -37,31 +37,7 @@ static struct nfs_callback_data nfs_callback_info[NFS4_MAX_MINOR_VERSION + 1]; ...@@ -37,31 +37,7 @@ static struct nfs_callback_data nfs_callback_info[NFS4_MAX_MINOR_VERSION + 1];
static DEFINE_MUTEX(nfs_callback_mutex); static DEFINE_MUTEX(nfs_callback_mutex);
static struct svc_program nfs4_callback_program; static struct svc_program nfs4_callback_program;
unsigned int nfs_callback_set_tcpport;
unsigned short nfs_callback_tcpport;
unsigned short nfs_callback_tcpport6; unsigned short nfs_callback_tcpport6;
#define NFS_CALLBACK_MAXPORTNR (65535U)
static int param_set_portnr(const char *val, const struct kernel_param *kp)
{
unsigned long num;
int ret;
if (!val)
return -EINVAL;
ret = strict_strtoul(val, 0, &num);
if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR)
return -EINVAL;
*((unsigned int *)kp->arg) = num;
return 0;
}
static struct kernel_param_ops param_ops_portnr = {
.set = param_set_portnr,
.get = param_get_uint,
};
#define param_check_portnr(name, p) __param_check(name, p, unsigned int);
module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644);
/* /*
* This is the NFSv4 callback kernel thread. * This is the NFSv4 callback kernel thread.
......
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
#define NFS_UINT_MAXLEN 11 #define NFS_UINT_MAXLEN 11
/* Default cache timeout is 10 minutes */
unsigned int nfs_idmap_cache_timeout = 600;
static const struct cred *id_resolver_cache; static const struct cred *id_resolver_cache;
static struct key_type key_type_id_resolver_legacy; static struct key_type key_type_id_resolver_legacy;
...@@ -366,7 +364,6 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen, const char *typ ...@@ -366,7 +364,6 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen, const char *typ
} }
/* idmap classic begins here */ /* idmap classic begins here */
module_param(nfs_idmap_cache_timeout, int, 0644);
enum { enum {
Opt_find_uid, Opt_find_gid, Opt_find_user, Opt_find_group, Opt_find_err Opt_find_uid, Opt_find_gid, Opt_find_user, Opt_find_group, Opt_find_err
......
...@@ -367,7 +367,9 @@ extern struct nfs_subversion nfs_v4; ...@@ -367,7 +367,9 @@ extern struct nfs_subversion nfs_v4;
struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *); struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *);
int init_nfs_v4(void); int init_nfs_v4(void);
void exit_nfs_v4(void); void exit_nfs_v4(void);
extern bool nfs4_disable_idmapping;
extern unsigned short max_session_slots;
extern unsigned short send_implementation_id;
/* nfs4sysctl.c */ /* nfs4sysctl.c */
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
int nfs4_register_sysctl(void); int nfs4_register_sysctl(void);
......
...@@ -17,11 +17,6 @@ ...@@ -17,11 +17,6 @@
#define NFSDBG_FACILITY NFSDBG_CLIENT #define NFSDBG_FACILITY NFSDBG_CLIENT
/*
* Turn off NFSv4 uid/gid mapping when using AUTH_SYS
*/
static bool nfs4_disable_idmapping = true;
/* /*
* Get a unique NFSv4.0 callback identifier which will be used * Get a unique NFSv4.0 callback identifier which will be used
* by the V4.0 callback service to lookup the nfs_client struct * by the V4.0 callback service to lookup the nfs_client struct
...@@ -659,7 +654,3 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, ...@@ -659,7 +654,3 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
dprintk("<-- nfs4_create_referral_server() = error %d\n", error); dprintk("<-- nfs4_create_referral_server() = error %d\n", error);
return ERR_PTR(error); return ERR_PTR(error);
} }
module_param(nfs4_disable_idmapping, bool, 0644);
MODULE_PARM_DESC(nfs4_disable_idmapping,
"Turn off NFSv4 idmapping when using 'sec=sys'");
...@@ -72,8 +72,6 @@ ...@@ -72,8 +72,6 @@
#define NFS4_MAX_LOOP_ON_RECOVER (10) #define NFS4_MAX_LOOP_ON_RECOVER (10)
static unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
struct nfs4_opendata; struct nfs4_opendata;
static int _nfs4_proc_open(struct nfs4_opendata *data); static int _nfs4_proc_open(struct nfs4_opendata *data);
static int _nfs4_recover_proc_open(struct nfs4_opendata *data); static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
...@@ -6932,10 +6930,6 @@ const struct xattr_handler *nfs4_xattr_handlers[] = { ...@@ -6932,10 +6930,6 @@ const struct xattr_handler *nfs4_xattr_handlers[] = {
NULL NULL
}; };
module_param(max_session_slots, ushort, 0644);
MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
"requests the client will negotiate");
/* /*
* Local variables: * Local variables:
* c-basic-offset: 8 * c-basic-offset: 8
......
...@@ -852,12 +852,6 @@ const u32 nfs41_maxread_overhead = ((RPC_MAX_HEADER_WITH_AUTH + ...@@ -852,12 +852,6 @@ const u32 nfs41_maxread_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
XDR_UNIT); XDR_UNIT);
#endif /* CONFIG_NFS_V4_1 */ #endif /* CONFIG_NFS_V4_1 */
static unsigned short send_implementation_id = 1;
module_param(send_implementation_id, ushort, 0644);
MODULE_PARM_DESC(send_implementation_id,
"Send implementation ID with NFSv4.1 exchange_id");
static const umode_t nfs_type2fmt[] = { static const umode_t nfs_type2fmt[] = {
[NF4BAD] = 0, [NF4BAD] = 0,
[NF4REG] = S_IFREG, [NF4REG] = S_IFREG,
......
...@@ -2574,4 +2574,49 @@ static int nfs4_validate_mount_data(void *options, ...@@ -2574,4 +2574,49 @@ static int nfs4_validate_mount_data(void *options,
return -EINVAL; return -EINVAL;
} }
/*
* NFS v4 module parameters need to stay in the
* NFS client for backwards compatibility
*/
unsigned int nfs_callback_set_tcpport;
unsigned short nfs_callback_tcpport;
/* Default cache timeout is 10 minutes */
unsigned int nfs_idmap_cache_timeout = 600;
/* Turn off NFSv4 uid/gid mapping when using AUTH_SYS */
bool nfs4_disable_idmapping = true;
unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
unsigned short send_implementation_id = 1;
#define NFS_CALLBACK_MAXPORTNR (65535U)
static int param_set_portnr(const char *val, const struct kernel_param *kp)
{
unsigned long num;
int ret;
if (!val)
return -EINVAL;
ret = strict_strtoul(val, 0, &num);
if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR)
return -EINVAL;
*((unsigned int *)kp->arg) = num;
return 0;
}
static struct kernel_param_ops param_ops_portnr = {
.set = param_set_portnr,
.get = param_get_uint,
};
#define param_check_portnr(name, p) __param_check(name, p, unsigned int);
module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644);
module_param(nfs_idmap_cache_timeout, int, 0644);
module_param(nfs4_disable_idmapping, bool, 0644);
MODULE_PARM_DESC(nfs4_disable_idmapping,
"Turn off NFSv4 idmapping when using 'sec=sys'");
module_param(max_session_slots, ushort, 0644);
MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
"requests the client will negotiate");
module_param(send_implementation_id, ushort, 0644);
MODULE_PARM_DESC(send_implementation_id,
"Send implementation ID with NFSv4.1 exchange_id");
#endif /* CONFIG_NFS_V4 */ #endif /* CONFIG_NFS_V4 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment