summaryrefslogtreecommitdiffstats
path: root/fs/ntfs/sysctl.c
blob: 3ab5137693c141c07db47fb62a5b70cd47512760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 *  sysctl.c
 *  System control stuff
 *
 *  Copyright (C) 1997 Martin von Löwis
 *  Copyright (C) 1997 Régis Duchesne
 *
 */

#include "sysctl.h"

#ifdef DEBUG
#include <linux/locks.h>
#include <linux/sysctl.h>

int ntdebug = 0;

/* Add or remove the debug sysctl
 * Is this really the only file system with sysctls ?
 */
void ntfs_sysctl(int add)
{
#define FS_NTFS             1
	/* Definition of the sysctl */
	static ctl_table ntfs_sysctls[]={
		{FS_NTFS,                  /* ID */
		 "ntfs-debug",             /* name in /proc */
		 &ntdebug,sizeof(ntdebug), /* data ptr, data size */
		 0644,                     /* mode */
		 0,                        /* child */
		 proc_dointvec,            /* proc handler */
		 0,                        /* strategy */
		 0,                        /* proc control block */
		 0,0},                     /* extra */
		{0}
	};
	/* Define the parent file : /proc/sys/fs */
	static ctl_table sysctls_root[]={
		{CTL_FS,
		 "fs",
		 NULL,0,
		 0555,
		 ntfs_sysctls},
		{0}
	};
	static struct ctl_table_header *sysctls_root_header = NULL;

	if(add){
		if(!sysctls_root_header)
			sysctls_root_header = register_sysctl_table(sysctls_root, 0);
	} else if(sysctls_root_header) {
		unregister_sysctl_table(sysctls_root_header);
		sysctls_root_header = NULL;
	}
}
#endif /* DEBUG */

/*
 * Local variables:
 * c-file-style: "linux"
 * End:
 */