Linux 6.13-rc4
[linux.git] / fs / fuse / sysctl.c
blobb272bb333005a8ca4e5f10b2e1a659f3f38b660a
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * linux/fs/fuse/fuse_sysctl.c
5 * Sysctl interface to fuse parameters
6 */
7 #include <linux/sysctl.h>
9 #include "fuse_i.h"
11 static struct ctl_table_header *fuse_table_header;
13 /* Bound by fuse_init_out max_pages, which is a u16 */
14 static unsigned int sysctl_fuse_max_pages_limit = 65535;
16 static struct ctl_table fuse_sysctl_table[] = {
18 .procname = "max_pages_limit",
19 .data = &fuse_max_pages_limit,
20 .maxlen = sizeof(fuse_max_pages_limit),
21 .mode = 0644,
22 .proc_handler = proc_douintvec_minmax,
23 .extra1 = SYSCTL_ONE,
24 .extra2 = &sysctl_fuse_max_pages_limit,
28 int fuse_sysctl_register(void)
30 fuse_table_header = register_sysctl("fs/fuse", fuse_sysctl_table);
31 if (!fuse_table_header)
32 return -ENOMEM;
33 return 0;
36 void fuse_sysctl_unregister(void)
38 unregister_sysctl_table(fuse_table_header);
39 fuse_table_header = NULL;