aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
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 /fs/nfs/super.c
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>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c45
1 files changed, 45 insertions, 0 deletions
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 */