blob: 06d27a41807fb5be7f9f6eb65f227140205b4f77 [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;
16
Linus Torvalds1da177e2005-04-16 15:20:36 -070017static ctl_table coda_table[] = {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080018 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080019 .procname = "timeout",
20 .data = &coda_timeout,
21 .maxlen = sizeof(int),
22 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080023 .proc_handler = proc_dointvec
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080024 },
25 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080026 .procname = "hard",
27 .data = &coda_hard,
28 .maxlen = sizeof(int),
29 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080030 .proc_handler = proc_dointvec
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080031 },
32 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080033 .procname = "fake_statfs",
34 .data = &coda_fake_statfs,
35 .maxlen = sizeof(int),
36 .mode = 0600,
Eric W. Biederman6d456112009-11-16 03:11:48 -080037 .proc_handler = proc_dointvec
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080038 },
39 {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070040};
41
42static ctl_table fs_table[] = {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080043 {
Eric W. Biedermanfd6065b2007-02-14 00:33:55 -080044 .procname = "coda",
45 .mode = 0555,
46 .child = coda_table
47 },
48 {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070049};
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Linus Torvalds1da177e2005-04-16 15:20:36 -070051void coda_sysctl_init(void)
52{
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 if ( !fs_table_header )
Eric W. Biederman0b4d4142007-02-14 00:34:09 -080054 fs_table_header = register_sysctl_table(fs_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -070055}
56
Jan Harkes3cf01f22007-07-19 01:48:51 -070057void coda_sysctl_clean(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070058{
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 if ( fs_table_header ) {
60 unregister_sysctl_table(fs_table_header);
61 fs_table_header = NULL;
62 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070063}
Rakib Mullick0bc825d2011-03-22 16:35:00 -070064#endif