aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-07-30 16:05:22 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-30 19:06:31 -0400
commitfac1e8e4ef417e958060a6c3a061cc1a180bd8ae (patch)
tree1ddba7b104171b39c9985610715049409cd7916e
parent19d87ca3623956494b517f3abe0caf2616d55457 (diff)
NFS: Keep module parameters in the generic NFS client
Otherwise we break backwards compatibility when v4 becomes a modules. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/callback.c24
-rw-r--r--fs/nfs/idmap.c3
-rw-r--r--fs/nfs/nfs4_fs.h4
-rw-r--r--fs/nfs/nfs4client.c9
-rw-r--r--fs/nfs/nfs4proc.c6
-rw-r--r--fs/nfs/nfs4xdr.c6
-rw-r--r--fs/nfs/super.c45
7 files changed, 48 insertions, 49 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 23ff18fe080a..ca3ac992028b 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -37,31 +37,7 @@ static struct nfs_callback_data nfs_callback_info[NFS4_MAX_MINOR_VERSION + 1];
37static DEFINE_MUTEX(nfs_callback_mutex); 37static DEFINE_MUTEX(nfs_callback_mutex);
38static struct svc_program nfs4_callback_program; 38static struct svc_program nfs4_callback_program;
39 39
40unsigned int nfs_callback_set_tcpport;
41unsigned short nfs_callback_tcpport;
42unsigned short nfs_callback_tcpport6; 40unsigned short nfs_callback_tcpport6;
43#define NFS_CALLBACK_MAXPORTNR (65535U)
44
45static int param_set_portnr(const char *val, const struct kernel_param *kp)
46{
47 unsigned long num;
48 int ret;
49
50 if (!val)
51 return -EINVAL;
52 ret = strict_strtoul(val, 0, &num);
53 if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR)
54 return -EINVAL;
55 *((unsigned int *)kp->arg) = num;
56 return 0;
57}
58static struct kernel_param_ops param_ops_portnr = {
59 .set = param_set_portnr,
60 .get = param_get_uint,
61};
62#define param_check_portnr(name, p) __param_check(name, p, unsigned int);
63
64module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644);
65 41
66/* 42/*
67 * This is the NFSv4 callback kernel thread. 43 * This is the NFSv4 callback kernel thread.
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 1b5058b4043b..b701358c39c3 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -52,8 +52,6 @@
52 52
53#define NFS_UINT_MAXLEN 11 53#define NFS_UINT_MAXLEN 11
54 54
55/* Default cache timeout is 10 minutes */
56unsigned int nfs_idmap_cache_timeout = 600;
57static const struct cred *id_resolver_cache; 55static const struct cred *id_resolver_cache;
58static struct key_type key_type_id_resolver_legacy; 56static struct key_type key_type_id_resolver_legacy;
59 57
@@ -366,7 +364,6 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen, const char *typ
366} 364}
367 365
368/* idmap classic begins here */ 366/* idmap classic begins here */
369module_param(nfs_idmap_cache_timeout, int, 0644);
370 367
371enum { 368enum {
372 Opt_find_uid, Opt_find_gid, Opt_find_user, Opt_find_group, Opt_find_err 369 Opt_find_uid, Opt_find_gid, Opt_find_user, Opt_find_group, Opt_find_err
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 4811e1251d32..bafe5186c9cd 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -367,7 +367,9 @@ extern struct nfs_subversion nfs_v4;
367struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *); 367struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *);
368int init_nfs_v4(void); 368int init_nfs_v4(void);
369void exit_nfs_v4(void); 369void exit_nfs_v4(void);
370 370extern bool nfs4_disable_idmapping;
371extern unsigned short max_session_slots;
372extern unsigned short send_implementation_id;
371/* nfs4sysctl.c */ 373/* nfs4sysctl.c */
372#ifdef CONFIG_SYSCTL 374#ifdef CONFIG_SYSCTL
373int nfs4_register_sysctl(void); 375int nfs4_register_sysctl(void);
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index b2d409d2805a..cbcdfaf32505 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -18,11 +18,6 @@
18#define NFSDBG_FACILITY NFSDBG_CLIENT 18#define NFSDBG_FACILITY NFSDBG_CLIENT
19 19
20/* 20/*
21 * Turn off NFSv4 uid/gid mapping when using AUTH_SYS
22 */
23static bool nfs4_disable_idmapping = true;
24
25/*
26 * Get a unique NFSv4.0 callback identifier which will be used 21 * Get a unique NFSv4.0 callback identifier which will be used
27 * by the V4.0 callback service to lookup the nfs_client struct 22 * by the V4.0 callback service to lookup the nfs_client struct
28 */ 23 */
@@ -659,7 +654,3 @@ error:
659 dprintk("<-- nfs4_create_referral_server() = error %d\n", error); 654 dprintk("<-- nfs4_create_referral_server() = error %d\n", error);
660 return ERR_PTR(error); 655 return ERR_PTR(error);
661} 656}
662
663module_param(nfs4_disable_idmapping, bool, 0644);
664MODULE_PARM_DESC(nfs4_disable_idmapping,
665 "Turn off NFSv4 idmapping when using 'sec=sys'");
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 36c6432aac7b..a99a8d948721 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -72,8 +72,6 @@
72 72
73#define NFS4_MAX_LOOP_ON_RECOVER (10) 73#define NFS4_MAX_LOOP_ON_RECOVER (10)
74 74
75static unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
76
77struct nfs4_opendata; 75struct nfs4_opendata;
78static int _nfs4_proc_open(struct nfs4_opendata *data); 76static int _nfs4_proc_open(struct nfs4_opendata *data);
79static int _nfs4_recover_proc_open(struct nfs4_opendata *data); 77static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
@@ -6932,10 +6930,6 @@ const struct xattr_handler *nfs4_xattr_handlers[] = {
6932 NULL 6930 NULL
6933}; 6931};
6934 6932
6935module_param(max_session_slots, ushort, 0644);
6936MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
6937 "requests the client will negotiate");
6938
6939/* 6933/*
6940 * Local variables: 6934 * Local variables:
6941 * c-basic-offset: 8 6935 * c-basic-offset: 8
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 6cbd602e26d5..ca13483edd60 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -852,12 +852,6 @@ const u32 nfs41_maxread_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
852 XDR_UNIT); 852 XDR_UNIT);
853#endif /* CONFIG_NFS_V4_1 */ 853#endif /* CONFIG_NFS_V4_1 */
854 854
855static unsigned short send_implementation_id = 1;
856
857module_param(send_implementation_id, ushort, 0644);
858MODULE_PARM_DESC(send_implementation_id,
859 "Send implementation ID with NFSv4.1 exchange_id");
860
861static const umode_t nfs_type2fmt[] = { 855static const umode_t nfs_type2fmt[] = {
862 [NF4BAD] = 0, 856 [NF4BAD] = 0,
863 [NF4REG] = S_IFREG, 857 [NF4REG] = S_IFREG,
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index a275d19ae512..8e0da5a6b3c5 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2574,4 +2574,49 @@ out_no_address:
2574 return -EINVAL; 2574 return -EINVAL;
2575} 2575}
2576 2576
2577/*
2578 * NFS v4 module parameters need to stay in the
2579 * NFS client for backwards compatibility
2580 */
2581unsigned int nfs_callback_set_tcpport;
2582unsigned short nfs_callback_tcpport;
2583/* Default cache timeout is 10 minutes */
2584unsigned int nfs_idmap_cache_timeout = 600;
2585/* Turn off NFSv4 uid/gid mapping when using AUTH_SYS */
2586bool nfs4_disable_idmapping = true;
2587unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
2588unsigned short send_implementation_id = 1;
2589
2590#define NFS_CALLBACK_MAXPORTNR (65535U)
2591
2592static int param_set_portnr(const char *val, const struct kernel_param *kp)
2593{
2594 unsigned long num;
2595 int ret;
2596
2597 if (!val)
2598 return -EINVAL;
2599 ret = strict_strtoul(val, 0, &num);
2600 if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR)
2601 return -EINVAL;
2602 *((unsigned int *)kp->arg) = num;
2603 return 0;
2604}
2605static struct kernel_param_ops param_ops_portnr = {
2606 .set = param_set_portnr,
2607 .get = param_get_uint,
2608};
2609#define param_check_portnr(name, p) __param_check(name, p, unsigned int);
2610
2611module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644);
2612module_param(nfs_idmap_cache_timeout, int, 0644);
2613module_param(nfs4_disable_idmapping, bool, 0644);
2614MODULE_PARM_DESC(nfs4_disable_idmapping,
2615 "Turn off NFSv4 idmapping when using 'sec=sys'");
2616module_param(max_session_slots, ushort, 0644);
2617MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
2618 "requests the client will negotiate");
2619module_param(send_implementation_id, ushort, 0644);
2620MODULE_PARM_DESC(send_implementation_id,
2621 "Send implementation ID with NFSv4.1 exchange_id");
2577#endif /* CONFIG_NFS_V4 */ 2622#endif /* CONFIG_NFS_V4 */