more changes on original files
[linux-2.4.git] / fs / ntfs / sysctl.c
1 /*
2  * sysctl.c - System control stuff
3  *
4  * Copyright (C) 1997 Martin von Löwis
5  * Copyright (C) 1997 Régis Duchesne
6  */
7
8 #include "sysctl.h"
9
10 #ifdef DEBUG
11 #include <linux/locks.h>
12 #include <linux/sysctl.h>
13
14 int ntdebug = 0;
15
16 /* Add or remove the debug sysctl
17  * Is this really the only file system with sysctls ?
18  */
19 void ntfs_sysctl(int add)
20 {
21 #define FS_NTFS             1
22         /* Definition of the sysctl */
23         static ctl_table ntfs_sysctls[]={
24                 {FS_NTFS,                  /* ID */
25                  "ntfs-debug",             /* name in /proc */
26                  &ntdebug,sizeof(ntdebug), /* data ptr, data size */
27                  0644,                     /* mode */
28                  0,                        /* child */
29                  proc_dointvec,            /* proc handler */
30                  0,                        /* strategy */
31                  0,                        /* proc control block */
32                  0,0},                     /* extra */
33                 {0}
34         };
35         /* Define the parent file : /proc/sys/fs */
36         static ctl_table sysctls_root[]={
37                 {CTL_FS,
38                  "fs",
39                  NULL,0,
40                  0555,
41                  ntfs_sysctls},
42                 {0}
43         };
44         static struct ctl_table_header *sysctls_root_header = NULL;
45
46         if(add){
47                 if(!sysctls_root_header)
48                         sysctls_root_header = register_sysctl_table(sysctls_root, 0);
49         } else if(sysctls_root_header) {
50                 unregister_sysctl_table(sysctls_root_header);
51                 sysctls_root_header = NULL;
52         }
53 }
54 #endif /* DEBUG */
55