Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Sysctl operations for Coda filesystem
0004  * Original version: (C) 1996 P. Braam and M. Callahan
0005  * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
0006  * 
0007  * Carnegie Mellon encourages users to contribute improvements to
0008  * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
0009  */
0010 
0011 #include <linux/sysctl.h>
0012 
0013 #include "coda_int.h"
0014 
0015 static struct ctl_table_header *fs_table_header;
0016 
0017 static struct ctl_table coda_table[] = {
0018     {
0019         .procname   = "timeout",
0020         .data       = &coda_timeout,
0021         .maxlen     = sizeof(int),
0022         .mode       = 0644,
0023         .proc_handler   = proc_dointvec
0024     },
0025     {
0026         .procname   = "hard",
0027         .data       = &coda_hard,
0028         .maxlen     = sizeof(int),
0029         .mode       = 0644,
0030         .proc_handler   = proc_dointvec
0031     },
0032     {
0033         .procname   = "fake_statfs",
0034         .data       = &coda_fake_statfs,
0035         .maxlen     = sizeof(int),
0036         .mode       = 0600,
0037         .proc_handler   = proc_dointvec
0038     },
0039     {}
0040 };
0041 
0042 static struct ctl_table fs_table[] = {
0043     {
0044         .procname   = "coda",
0045         .mode       = 0555,
0046         .child      = coda_table
0047     },
0048     {}
0049 };
0050 
0051 void coda_sysctl_init(void)
0052 {
0053     if ( !fs_table_header )
0054         fs_table_header = register_sysctl_table(fs_table);
0055 }
0056 
0057 void coda_sysctl_clean(void)
0058 {
0059     if ( fs_table_header ) {
0060         unregister_sysctl_table(fs_table_header);
0061         fs_table_header = NULL;
0062     }
0063 }