blob: 43c96ce29614e65fcdfdc3825d309ad0fe62dcfd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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).
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
9
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <linux/sysctl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Jan Harkes3cf01f22007-07-19 01:48:51 -070012#include "coda_int.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Richard A. Holden III87d1fda2009-01-07 18:07:28 -080014#ifdef CONFIG_SYSCTL
Linus Torvalds1da177e2005-04-16 15:20:36 -070015static struct ctl_table_header *fs_table_header;
Richard A. Holden III87d1fda2009-01-07 18:07:28 -080016#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Linus Torvalds1da177e2005-04-16 15:20:36 -070018static ctl_table coda_table[] = {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080019 {
20 .ctl_name = CTL_UNNUMBERED,
21 .procname = "timeout",
22 .data = &coda_timeout,
23 .maxlen = sizeof(int),
24 .mode = 0644,
25 .proc_handler = &proc_dointvec
26 },
27 {
28 .ctl_name = CTL_UNNUMBERED,
29 .procname = "hard",
30 .data = &coda_hard,
31 .maxlen = sizeof(int),
32 .mode = 0644,
33 .proc_handler = &proc_dointvec
34 },
35 {
36 .ctl_name = CTL_UNNUMBERED,
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080037 .procname = "fake_statfs",
38 .data = &coda_fake_statfs,
39 .maxlen = sizeof(int),
40 .mode = 0600,
41 .proc_handler = &proc_dointvec
42 },
43 {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070044};
45
Richard A. Holden III87d1fda2009-01-07 18:07:28 -080046#ifdef CONFIG_SYSCTL
Linus Torvalds1da177e2005-04-16 15:20:36 -070047static ctl_table fs_table[] = {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080048 {
49 .ctl_name = CTL_UNNUMBERED,
50 .procname = "coda",
51 .mode = 0555,
52 .child = coda_table
53 },
54 {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070055};
Richard A. Holden III87d1fda2009-01-07 18:07:28 -080056#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Linus Torvalds1da177e2005-04-16 15:20:36 -070058void coda_sysctl_init(void)
59{
Linus Torvalds1da177e2005-04-16 15:20:36 -070060#ifdef CONFIG_SYSCTL
61 if ( !fs_table_header )
Eric W. Biederman0b4d4142007-02-14 00:34:09 -080062 fs_table_header = register_sysctl_table(fs_table);
Jan Harkes3cf01f22007-07-19 01:48:51 -070063#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070064}
65
Jan Harkes3cf01f22007-07-19 01:48:51 -070066void coda_sysctl_clean(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070067{
Linus Torvalds1da177e2005-04-16 15:20:36 -070068#ifdef CONFIG_SYSCTL
69 if ( fs_table_header ) {
70 unregister_sysctl_table(fs_table_header);
71 fs_table_header = NULL;
72 }
73#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070074}