Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * linux/fs/nfs/nfs4sysctl.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Sysctl interface to NFS v4 parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * Copyright (c) 2006 Trond Myklebust <Trond.Myklebust@netapp.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #include <linux/sysctl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/nfs_fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "nfs4_fs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "nfs4idmap.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "callback.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) static const int nfs_set_port_min;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) static const int nfs_set_port_max = 65535;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static struct ctl_table_header *nfs4_callback_sysctl_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static struct ctl_table nfs4_cb_sysctls[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 		.procname = "nfs_callback_tcpport",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 		.data = &nfs_callback_set_tcpport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 		.maxlen = sizeof(int),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 		.mode = 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 		.proc_handler = proc_dointvec_minmax,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 		.extra1 = (int *)&nfs_set_port_min,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 		.extra2 = (int *)&nfs_set_port_max,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		.procname = "idmap_cache_timeout",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 		.data = &nfs_idmap_cache_timeout,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 		.maxlen = sizeof(int),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 		.mode = 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 		.proc_handler = proc_dointvec,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) static struct ctl_table nfs4_cb_sysctl_dir[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 		.procname = "nfs",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 		.mode = 0555,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 		.child = nfs4_cb_sysctls,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) static struct ctl_table nfs4_cb_sysctl_root[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 		.procname = "fs",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 		.mode = 0555,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 		.child = nfs4_cb_sysctl_dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int nfs4_register_sysctl(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	nfs4_callback_sysctl_table = register_sysctl_table(nfs4_cb_sysctl_root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 	if (nfs4_callback_sysctl_table == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) void nfs4_unregister_sysctl(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 	unregister_sysctl_table(nfs4_callback_sysctl_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 	nfs4_callback_sysctl_table = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }