Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
at v2.6.30-rc8 74 lines 1.4 kB view raw
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 .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, 37 .procname = "fake_statfs", 38 .data = &coda_fake_statfs, 39 .maxlen = sizeof(int), 40 .mode = 0600, 41 .proc_handler = &proc_dointvec 42 }, 43 {} 44}; 45 46#ifdef CONFIG_SYSCTL 47static ctl_table fs_table[] = { 48 { 49 .ctl_name = CTL_UNNUMBERED, 50 .procname = "coda", 51 .mode = 0555, 52 .child = coda_table 53 }, 54 {} 55}; 56#endif 57 58void coda_sysctl_init(void) 59{ 60#ifdef CONFIG_SYSCTL 61 if ( !fs_table_header ) 62 fs_table_header = register_sysctl_table(fs_table); 63#endif 64} 65 66void coda_sysctl_clean(void) 67{ 68#ifdef CONFIG_SYSCTL 69 if ( fs_table_header ) { 70 unregister_sysctl_table(fs_table_header); 71 fs_table_header = NULL; 72 } 73#endif 74}