2 * linux/fs/nfs/nfs4sysctl.c
4 * Sysctl interface to NFS v4 parameters
6 * Copyright (c) 2006 Trond Myklebust <Trond.Myklebust@netapp.com>
8 #include <linux/sysctl.h>
9 #include <linux/nfs_idmap.h>
10 #include <linux/nfs_fs.h>
14 static const int nfs_set_port_min = 0;
15 static const int nfs_set_port_max = 65535;
16 static struct ctl_table_header *nfs4_callback_sysctl_table;
18 static ctl_table nfs4_cb_sysctls[] = {
20 .procname = "nfs_callback_tcpport",
21 .data = &nfs_callback_set_tcpport,
22 .maxlen = sizeof(int),
24 .proc_handler = proc_dointvec_minmax,
25 .extra1 = (int *)&nfs_set_port_min,
26 .extra2 = (int *)&nfs_set_port_max,
29 .procname = "idmap_cache_timeout",
30 .data = &nfs_idmap_cache_timeout,
31 .maxlen = sizeof(int),
33 .proc_handler = proc_dointvec_jiffies,
38 static ctl_table nfs4_cb_sysctl_dir[] = {
42 .child = nfs4_cb_sysctls,
47 static ctl_table nfs4_cb_sysctl_root[] = {
51 .child = nfs4_cb_sysctl_dir,
56 int nfs4_register_sysctl(void)
58 nfs4_callback_sysctl_table = register_sysctl_table(nfs4_cb_sysctl_root);
59 if (nfs4_callback_sysctl_table == NULL)
64 void nfs4_unregister_sysctl(void)
66 unregister_sysctl_table(nfs4_callback_sysctl_table);
67 nfs4_callback_sysctl_table = NULL;