blob: 0301d45000a8a45e4492d1993ce1de5bbabb47e6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Sysctl operations for Coda filesystem
4 * Original version: (C) 1996 P. Braam and M. Callahan
5 * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
6 *
7 * Carnegie Mellon encourages users to contribute improvements to
8 * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 */
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/sysctl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Jan Harkes3cf01f22007-07-19 01:48:51 -070013#include "coda_int.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Richard A. Holden III87d1fda2009-01-07 18:07:28 -080015#ifdef CONFIG_SYSCTL
Linus Torvalds1da177e2005-04-16 15:20:36 -070016static struct ctl_table_header *fs_table_header;
17
Joe Perchesa88bbbe2014-06-06 14:38:00 -070018static struct ctl_table coda_table[] = {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080019 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080020 .procname = "timeout",
21 .data = &coda_timeout,
22 .maxlen = sizeof(int),
23 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080024 .proc_handler = proc_dointvec
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080025 },
26 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080027 .procname = "hard",
28 .data = &coda_hard,
29 .maxlen = sizeof(int),
30 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080031 .proc_handler = proc_dointvec
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080032 },
33 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080034 .procname = "fake_statfs",
35 .data = &coda_fake_statfs,
36 .maxlen = sizeof(int),
37 .mode = 0600,
Eric W. Biederman6d456112009-11-16 03:11:48 -080038 .proc_handler = proc_dointvec
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080039 },
40 {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070041};
42
Joe Perchesa88bbbe2014-06-06 14:38:00 -070043static struct ctl_table fs_table[] = {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080044 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080045 .procname = "coda",
46 .mode = 0555,
47 .child = coda_table
48 },
49 {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070050};
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052void coda_sysctl_init(void)
53{
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 if ( !fs_table_header )
Eric W. Biederman0b4d4142007-02-14 00:34:09 -080055 fs_table_header = register_sysctl_table(fs_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056}
57
Jan Harkes3cf01f22007-07-19 01:48:51 -070058void coda_sysctl_clean(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059{
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 if ( fs_table_header ) {
61 unregister_sysctl_table(fs_table_header);
62 fs_table_header = NULL;
63 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070064}
Rakib Mullickc03e3122011-03-25 01:57:01 -070065
66#else
67void coda_sysctl_init(void)
68{
69}
70
71void coda_sysctl_clean(void)
72{
73}
Rakib Mullick0bc825d2011-03-22 16:35:00 -070074#endif