Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/*
2 * Sysctl operations for Coda filesystem
3 * Original version: (C) 1996 P. Braam and M. Callahan
4 * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
5 *
6 * Carnegie Mellon encourages users to contribute improvements to
7 * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
8 */
9
10#include <linux/sysctl.h>
11
12#include "coda_int.h"
13
14#ifdef CONFIG_SYSCTL
15static struct ctl_table_header *fs_table_header;
16#endif
17
18static ctl_table coda_table[] = {
19 {
20 .procname = "timeout",
21 .data = &coda_timeout,
22 .maxlen = sizeof(int),
23 .mode = 0644,
24 .proc_handler = proc_dointvec
25 },
26 {
27 .procname = "hard",
28 .data = &coda_hard,
29 .maxlen = sizeof(int),
30 .mode = 0644,
31 .proc_handler = proc_dointvec
32 },
33 {
34 .procname = "fake_statfs",
35 .data = &coda_fake_statfs,
36 .maxlen = sizeof(int),
37 .mode = 0600,
38 .proc_handler = proc_dointvec
39 },
40 {}
41};
42
43#ifdef CONFIG_SYSCTL
44static ctl_table fs_table[] = {
45 {
46 .procname = "coda",
47 .mode = 0555,
48 .child = coda_table
49 },
50 {}
51};
52#endif
53
54void coda_sysctl_init(void)
55{
56#ifdef CONFIG_SYSCTL
57 if ( !fs_table_header )
58 fs_table_header = register_sysctl_table(fs_table);
59#endif
60}
61
62void coda_sysctl_clean(void)
63{
64#ifdef CONFIG_SYSCTL
65 if ( fs_table_header ) {
66 unregister_sysctl_table(fs_table_header);
67 fs_table_header = NULL;
68 }
69#endif
70}