NFS: Split fs/nfs/inode.c
[wrt350n-kernel.git] / net / rxrpc / sysctl.c
blobfbf98729c748b3acfc8276ef672ba8e03b7b3209
1 /* sysctl.c: Rx RPC control
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/config.h>
13 #include <linux/sched.h>
14 #include <linux/slab.h>
15 #include <linux/module.h>
16 #include <linux/sysctl.h>
17 #include <rxrpc/types.h>
18 #include <rxrpc/rxrpc.h>
19 #include <asm/errno.h>
20 #include "internal.h"
22 int rxrpc_ktrace;
23 int rxrpc_kdebug;
24 int rxrpc_kproto;
25 int rxrpc_knet;
27 #ifdef CONFIG_SYSCTL
28 static struct ctl_table_header *rxrpc_sysctl = NULL;
30 static ctl_table rxrpc_sysctl_table[] = {
32 .ctl_name = 1,
33 .procname = "kdebug",
34 .data = &rxrpc_kdebug,
35 .maxlen = sizeof(int),
36 .mode = 0644,
37 .proc_handler = &proc_dointvec
40 .ctl_name = 2,
41 .procname = "ktrace",
42 .data = &rxrpc_ktrace,
43 .maxlen = sizeof(int),
44 .mode = 0644,
45 .proc_handler = &proc_dointvec
48 .ctl_name = 3,
49 .procname = "kproto",
50 .data = &rxrpc_kproto,
51 .maxlen = sizeof(int),
52 .mode = 0644,
53 .proc_handler = &proc_dointvec
56 .ctl_name = 4,
57 .procname = "knet",
58 .data = &rxrpc_knet,
59 .maxlen = sizeof(int),
60 .mode = 0644,
61 .proc_handler = &proc_dointvec
64 .ctl_name = 5,
65 .procname = "peertimo",
66 .data = &rxrpc_peer_timeout,
67 .maxlen = sizeof(unsigned long),
68 .mode = 0644,
69 .proc_handler = &proc_doulongvec_minmax
72 .ctl_name = 6,
73 .procname = "conntimo",
74 .data = &rxrpc_conn_timeout,
75 .maxlen = sizeof(unsigned long),
76 .mode = 0644,
77 .proc_handler = &proc_doulongvec_minmax
79 { .ctl_name = 0 }
82 static ctl_table rxrpc_dir_sysctl_table[] = {
84 .ctl_name = 1,
85 .procname = "rxrpc",
86 .maxlen = 0,
87 .mode = 0555,
88 .child = rxrpc_sysctl_table
90 { .ctl_name = 0 }
92 #endif /* CONFIG_SYSCTL */
94 /*****************************************************************************/
96 * initialise the sysctl stuff for Rx RPC
98 int rxrpc_sysctl_init(void)
100 #ifdef CONFIG_SYSCTL
101 rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table, 0);
102 if (!rxrpc_sysctl)
103 return -ENOMEM;
104 #endif /* CONFIG_SYSCTL */
106 return 0;
107 } /* end rxrpc_sysctl_init() */
109 /*****************************************************************************/
111 * clean up the sysctl stuff for Rx RPC
113 void rxrpc_sysctl_cleanup(void)
115 #ifdef CONFIG_SYSCTL
116 if (rxrpc_sysctl) {
117 unregister_sysctl_table(rxrpc_sysctl);
118 rxrpc_sysctl = NULL;
120 #endif /* CONFIG_SYSCTL */
122 } /* end rxrpc_sysctl_cleanup() */