blob: bb6ed810fa6f35d46c9f1f5ff87e392e2f539644 [file] [log] [blame]
Trond Myklebusta72b4422006-01-03 09:55:41 +01001/*
2 * linux/fs/nfs/sysctl.c
3 *
4 * Sysctl interface to NFS parameters
5 */
Trond Myklebusta72b4422006-01-03 09:55:41 +01006#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>
Trond Myklebust51d8fa62006-06-09 09:34:20 -040012#include <linux/nfs_fs.h>
Trond Myklebusta72b4422006-01-03 09:55:41 +010013
Trond Myklebusta72b4422006-01-03 09:55:41 +010014static struct ctl_table_header *nfs_callback_sysctl_table;
Trond Myklebusta72b4422006-01-03 09:55:41 +010015
Joe Perchesf5102e52014-06-06 14:38:03 -070016static struct ctl_table nfs_cb_sysctls[] = {
Trond Myklebust51d8fa62006-06-09 09:34:20 -040017 {
Trond Myklebust51d8fa62006-06-09 09:34:20 -040018 .procname = "nfs_mountpoint_timeout",
19 .data = &nfs_mountpoint_expiry_timeout,
20 .maxlen = sizeof(nfs_mountpoint_expiry_timeout),
21 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080022 .proc_handler = proc_dointvec_jiffies,
Trond Myklebust51d8fa62006-06-09 09:34:20 -040023 },
Peter Zijlstra89a09142007-03-16 13:38:26 -080024 {
Peter Zijlstra89a09142007-03-16 13:38:26 -080025 .procname = "nfs_congestion_kb",
26 .data = &nfs_congestion_kb,
27 .maxlen = sizeof(nfs_congestion_kb),
28 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080029 .proc_handler = proc_dointvec,
Peter Zijlstra89a09142007-03-16 13:38:26 -080030 },
Eric W. Biedermanab092032009-11-05 14:25:10 -080031 { }
Trond Myklebusta72b4422006-01-03 09:55:41 +010032};
33
Joe Perchesf5102e52014-06-06 14:38:03 -070034static struct ctl_table nfs_cb_sysctl_dir[] = {
Trond Myklebusta72b4422006-01-03 09:55:41 +010035 {
Trond Myklebusta72b4422006-01-03 09:55:41 +010036 .procname = "nfs",
37 .mode = 0555,
38 .child = nfs_cb_sysctls,
39 },
Eric W. Biedermanab092032009-11-05 14:25:10 -080040 { }
Trond Myklebusta72b4422006-01-03 09:55:41 +010041};
42
Joe Perchesf5102e52014-06-06 14:38:03 -070043static struct ctl_table nfs_cb_sysctl_root[] = {
Trond Myklebusta72b4422006-01-03 09:55:41 +010044 {
Trond Myklebusta72b4422006-01-03 09:55:41 +010045 .procname = "fs",
46 .mode = 0555,
47 .child = nfs_cb_sysctl_dir,
48 },
Eric W. Biedermanab092032009-11-05 14:25:10 -080049 { }
Trond Myklebusta72b4422006-01-03 09:55:41 +010050};
51
52int nfs_register_sysctl(void)
53{
Eric W. Biederman0b4d4142007-02-14 00:34:09 -080054 nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root);
Trond Myklebusta72b4422006-01-03 09:55:41 +010055 if (nfs_callback_sysctl_table == NULL)
56 return -ENOMEM;
57 return 0;
58}
59
60void nfs_unregister_sysctl(void)
61{
62 unregister_sysctl_table(nfs_callback_sysctl_table);
63 nfs_callback_sysctl_table = NULL;
64}