rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 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). |
| 9 | */ |
| 10 | |
| 11 | #include <linux/sysctl.h> |
| 12 | |
| 13 | #include "coda_int.h" |
| 14 | |
| 15 | #ifdef CONFIG_SYSCTL |
| 16 | static struct ctl_table_header *fs_table_header; |
| 17 | |
| 18 | static struct 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 | static struct ctl_table fs_table[] = { |
| 44 | { |
| 45 | .procname = "coda", |
| 46 | .mode = 0555, |
| 47 | .child = coda_table |
| 48 | }, |
| 49 | {} |
| 50 | }; |
| 51 | |
| 52 | void coda_sysctl_init(void) |
| 53 | { |
| 54 | if ( !fs_table_header ) |
| 55 | fs_table_header = register_sysctl_table(fs_table); |
| 56 | } |
| 57 | |
| 58 | void coda_sysctl_clean(void) |
| 59 | { |
| 60 | if ( fs_table_header ) { |
| 61 | unregister_sysctl_table(fs_table_header); |
| 62 | fs_table_header = NULL; |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | #else |
| 67 | void coda_sysctl_init(void) |
| 68 | { |
| 69 | } |
| 70 | |
| 71 | void coda_sysctl_clean(void) |
| 72 | { |
| 73 | } |
| 74 | #endif |