xref: /openbmc/linux/fs/nfs/sysctl.c (revision a2189b77)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2a72b4422STrond Myklebust /*
3a72b4422STrond Myklebust  * linux/fs/nfs/sysctl.c
4a72b4422STrond Myklebust  *
5a72b4422STrond Myklebust  * Sysctl interface to NFS parameters
6a72b4422STrond Myklebust  */
7a72b4422STrond Myklebust #include <linux/types.h>
8a72b4422STrond Myklebust #include <linux/linkage.h>
9a72b4422STrond Myklebust #include <linux/ctype.h>
10a72b4422STrond Myklebust #include <linux/fs.h>
11a72b4422STrond Myklebust #include <linux/sysctl.h>
12a72b4422STrond Myklebust #include <linux/module.h>
1351d8fa6aSTrond Myklebust #include <linux/nfs_fs.h>
14a72b4422STrond Myklebust 
15a72b4422STrond Myklebust static struct ctl_table_header *nfs_callback_sysctl_table;
16a72b4422STrond Myklebust 
17f5102e56SJoe Perches static struct ctl_table nfs_cb_sysctls[] = {
1851d8fa6aSTrond Myklebust 	{
1951d8fa6aSTrond Myklebust 		.procname	= "nfs_mountpoint_timeout",
2051d8fa6aSTrond Myklebust 		.data		= &nfs_mountpoint_expiry_timeout,
2151d8fa6aSTrond Myklebust 		.maxlen		= sizeof(nfs_mountpoint_expiry_timeout),
2251d8fa6aSTrond Myklebust 		.mode		= 0644,
236d456111SEric W. Biederman 		.proc_handler	= proc_dointvec_jiffies,
2451d8fa6aSTrond Myklebust 	},
2589a09141SPeter Zijlstra 	{
2689a09141SPeter Zijlstra 		.procname	= "nfs_congestion_kb",
2789a09141SPeter Zijlstra 		.data		= &nfs_congestion_kb,
2889a09141SPeter Zijlstra 		.maxlen		= sizeof(nfs_congestion_kb),
2989a09141SPeter Zijlstra 		.mode		= 0644,
306d456111SEric W. Biederman 		.proc_handler	= proc_dointvec,
3189a09141SPeter Zijlstra 	},
32ab09203eSEric W. Biederman 	{ }
33a72b4422STrond Myklebust };
34a72b4422STrond Myklebust 
nfs_register_sysctl(void)35a72b4422STrond Myklebust int nfs_register_sysctl(void)
36a72b4422STrond Myklebust {
37*a2189b77SLuis Chamberlain 	nfs_callback_sysctl_table = register_sysctl("fs/nfs", nfs_cb_sysctls);
38a72b4422STrond Myklebust 	if (nfs_callback_sysctl_table == NULL)
39a72b4422STrond Myklebust 		return -ENOMEM;
40a72b4422STrond Myklebust 	return 0;
41a72b4422STrond Myklebust }
42a72b4422STrond Myklebust 
nfs_unregister_sysctl(void)43a72b4422STrond Myklebust void nfs_unregister_sysctl(void)
44a72b4422STrond Myklebust {
45a72b4422STrond Myklebust 	unregister_sysctl_table(nfs_callback_sysctl_table);
46a72b4422STrond Myklebust 	nfs_callback_sysctl_table = NULL;
47a72b4422STrond Myklebust }
48