SUNRPC: Make rpc_mkpipe() take the parent dentry as an argument
[deliverable/linux.git] / fs / nfs / sysctl.c
CommitLineData
a72b4422
TM
1/*
2 * linux/fs/nfs/sysctl.c
3 *
4 * Sysctl interface to NFS parameters
5 */
a72b4422
TM
6#include <linux/types.h>
7#include <linux/linkage.h>
8#include <linux/ctype.h>
9#include <linux/fs.h>
10#include <linux/sysctl.h>
11#include <linux/module.h>
12#include <linux/nfs4.h>
58df095b 13#include <linux/nfs_idmap.h>
51d8fa6a 14#include <linux/nfs_fs.h>
a72b4422
TM
15
16#include "callback.h"
17
18static const int nfs_set_port_min = 0;
19static const int nfs_set_port_max = 65535;
20static struct ctl_table_header *nfs_callback_sysctl_table;
21/*
22 * Something that isn't CTL_ANY, CTL_NONE or a value that may clash.
23 * Use the same values as fs/lockd/svc.c
24 */
25#define CTL_UNNUMBERED -2
26
27static ctl_table nfs_cb_sysctls[] = {
28#ifdef CONFIG_NFS_V4
29 {
30 .ctl_name = CTL_UNNUMBERED,
31 .procname = "nfs_callback_tcpport",
32 .data = &nfs_callback_set_tcpport,
33 .maxlen = sizeof(int),
34 .mode = 0644,
35 .proc_handler = &proc_dointvec_minmax,
36 .extra1 = (int *)&nfs_set_port_min,
37 .extra2 = (int *)&nfs_set_port_max,
38 },
58df095b
TM
39 {
40 .ctl_name = CTL_UNNUMBERED,
41 .procname = "idmap_cache_timeout",
42 .data = &nfs_idmap_cache_timeout,
43 .maxlen = sizeof(int),
44 .mode = 0644,
45 .proc_handler = &proc_dointvec_jiffies,
46 .strategy = &sysctl_jiffies,
47 },
a72b4422 48#endif
51d8fa6a
TM
49 {
50 .ctl_name = CTL_UNNUMBERED,
51 .procname = "nfs_mountpoint_timeout",
52 .data = &nfs_mountpoint_expiry_timeout,
53 .maxlen = sizeof(nfs_mountpoint_expiry_timeout),
54 .mode = 0644,
55 .proc_handler = &proc_dointvec_jiffies,
56 .strategy = &sysctl_jiffies,
57 },
a72b4422
TM
58 { .ctl_name = 0 }
59};
60
61static ctl_table nfs_cb_sysctl_dir[] = {
62 {
63 .ctl_name = CTL_UNNUMBERED,
64 .procname = "nfs",
65 .mode = 0555,
66 .child = nfs_cb_sysctls,
67 },
68 { .ctl_name = 0 }
69};
70
71static ctl_table nfs_cb_sysctl_root[] = {
72 {
73 .ctl_name = CTL_FS,
74 .procname = "fs",
75 .mode = 0555,
76 .child = nfs_cb_sysctl_dir,
77 },
78 { .ctl_name = 0 }
79};
80
81int nfs_register_sysctl(void)
82{
83 nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root, 0);
84 if (nfs_callback_sysctl_table == NULL)
85 return -ENOMEM;
86 return 0;
87}
88
89void nfs_unregister_sysctl(void)
90{
91 unregister_sysctl_table(nfs_callback_sysctl_table);
92 nfs_callback_sysctl_table = NULL;
93}
This page took 0.098536 seconds and 5 git commands to generate.