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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
Index: src/kernel/linux-2.6/pvfs2-proc.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-proc.c,v
diff -u -r1.8 -r1.9
--- src/kernel/linux-2.6/pvfs2-proc.c 19 Aug 2007 18:20:28 -0000 1.8
+++ src/kernel/linux-2.6/pvfs2-proc.c 11 Jan 2008 15:20:16 -0000 1.9
@@ -261,10 +261,19 @@
static int min_debug[] = {0}, max_debug[] = {GOSSIP_MAX_DEBUG};
static int min_op_timeout_secs[] = {0}, max_op_timeout_secs[] = {INT_MAX};
+/*
+ * Modern kernels prefer to number the controls themselves.
+ */
+#ifdef CTL_UNNUMBERED
+#define UNNUMBERED_OR_VAL(x) CTL_UNNUMBERED
+#else
+#define UNNUMBERED_OR_VAL(x) x
+#endif
+
static ctl_table pvfs2_acache_table[] = {
/* controls acache timeout */
{
- .ctl_name = 1,
+ .ctl_name = UNNUMBERED_OR_VAL(1),
.procname = "timeout-msecs",
.maxlen = sizeof(int),
.mode = 0644,
@@ -273,7 +282,7 @@
},
/* controls acache hard limit */
{
- .ctl_name = 2,
+ .ctl_name = UNNUMBERED_OR_VAL(2),
.procname = "hard-limit",
.maxlen = sizeof(int),
.mode = 0644,
@@ -282,7 +291,7 @@
},
/* controls acache soft limit */
{
- .ctl_name = 3,
+ .ctl_name = UNNUMBERED_OR_VAL(3),
.procname = "soft-limit",
.maxlen = sizeof(int),
.mode = 0644,
@@ -291,7 +300,7 @@
},
/* controls acache reclaim percentage */
{
- .ctl_name = 4,
+ .ctl_name = UNNUMBERED_OR_VAL(4),
.procname = "reclaim-percentage",
.maxlen = sizeof(int),
.mode = 0644,
@@ -303,7 +312,7 @@
static ctl_table pvfs2_ncache_table[] = {
/* controls ncache timeout */
{
- .ctl_name = 1,
+ .ctl_name = UNNUMBERED_OR_VAL(1),
.procname = "timeout-msecs",
.maxlen = sizeof(int),
.mode = 0644,
@@ -312,7 +321,7 @@
},
/* controls ncache hard limit */
{
- .ctl_name = 2,
+ .ctl_name = UNNUMBERED_OR_VAL(2),
.procname = "hard-limit",
.maxlen = sizeof(int),
.mode = 0644,
@@ -321,7 +330,7 @@
},
/* controls ncache soft limit */
{
- .ctl_name = 3,
+ .ctl_name = UNNUMBERED_OR_VAL(3),
.procname = "soft-limit",
.maxlen = sizeof(int),
.mode = 0644,
@@ -330,7 +339,7 @@
},
/* controls ncache reclaim percentage */
{
- .ctl_name = 4,
+ .ctl_name = UNNUMBERED_OR_VAL(4),
.procname = "reclaim-percentage",
.maxlen = sizeof(int),
.mode = 0644,
@@ -343,15 +352,15 @@
static int ncache_perf_count = PVFS2_PERF_COUNT_REQUEST_NCACHE;
static ctl_table pvfs2_pc_table[] = {
{
- .ctl_name = 1,
+ .ctl_name = UNNUMBERED_OR_VAL(1),
.procname = "acache",
.maxlen = 4096,
.mode = 0444,
.proc_handler = pvfs2_pc_proc_handler,
.extra1 = &acache_perf_count,
},
{
- .ctl_name = 2,
+ .ctl_name = UNNUMBERED_OR_VAL(2),
.procname = "ncache",
.maxlen = 4096,
.mode = 0444,
@@ -366,44 +375,44 @@
static ctl_table pvfs2_stats_table[] = {
/* shows number of hits in cache */
{
- .ctl_name = 1,
+ .ctl_name = UNNUMBERED_OR_VAL(1),
.procname = "hits",
.data = &g_pvfs2_stats.cache_hits,
.maxlen = sizeof(unsigned long),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
{
- .ctl_name = 2,
+ .ctl_name = UNNUMBERED_OR_VAL(2),
.procname = "misses",
.data = &g_pvfs2_stats.cache_misses,
.maxlen = sizeof(unsigned long),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
{
- .ctl_name = 3,
+ .ctl_name = UNNUMBERED_OR_VAL(3),
.procname = "reads",
.data = &g_pvfs2_stats.reads,
.maxlen = sizeof(unsigned long),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
{
- .ctl_name = 4,
+ .ctl_name = UNNUMBERED_OR_VAL(4),
.procname = "writes",
.data = &g_pvfs2_stats.writes,
.maxlen = sizeof(unsigned long),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
- {.ctl_name = 0},
+ {0}
};
static ctl_table pvfs2_table[] = {
/* controls debugging level */
{
- .ctl_name = 1,
+ .ctl_name = UNNUMBERED_OR_VAL(1),
.procname = "debug",
.data = &gossip_debug_mask,
.maxlen = sizeof(int),
@@ -415,7 +424,7 @@
},
/* operation timeout */
{
- .ctl_name = 2,
+ .ctl_name = UNNUMBERED_OR_VAL(2),
.procname = "op-timeout-secs",
.data = &op_timeout_secs,
.maxlen = sizeof(int),
@@ -427,7 +436,7 @@
},
/* time interval for client side performance counters */
{
- .ctl_name = 3,
+ .ctl_name = UNNUMBERED_OR_VAL(3),
.procname = "perf-time-interval-secs",
.maxlen = sizeof(int),
.mode = 0644,
@@ -436,7 +445,7 @@
},
/* time interval for client side performance counters */
{
- .ctl_name = 4,
+ .ctl_name = UNNUMBERED_OR_VAL(4),
.procname = "perf-history-size",
.maxlen = sizeof(int),
.mode = 0644,
@@ -445,7 +454,7 @@
},
/* reset performance counters */
{
- .ctl_name = 5,
+ .ctl_name = UNNUMBERED_OR_VAL(5),
.procname = "perf-counter-reset",
.maxlen = sizeof(int),
.mode = 0644,
@@ -454,30 +463,30 @@
},
/* subdir for acache control */
{
- .ctl_name = 6,
+ .ctl_name = UNNUMBERED_OR_VAL(6),
.procname = "acache",
.maxlen = 0,
.mode = 0555,
.child = pvfs2_acache_table
},
{
- .ctl_name = 7,
+ .ctl_name = UNNUMBERED_OR_VAL(7),
.procname = "perf-counters",
.maxlen = 0,
.mode = 0555,
.child = pvfs2_pc_table
},
/* subdir for ncache control */
{
- .ctl_name = 8,
+ .ctl_name = UNNUMBERED_OR_VAL(8),
.procname = "ncache",
.maxlen = 0,
.mode = 0555,
.child = pvfs2_ncache_table
},
/* statistics maintained by the kernel module (output only below this) */
{
- .ctl_name = 9,
+ .ctl_name = UNNUMBERED_OR_VAL(9),
.procname = "stats",
.maxlen = 0,
.mode = 0555,
@@ -487,7 +496,7 @@
};
static ctl_table fs_table[] = {
{
- .ctl_name = 1,
+ .ctl_name = UNNUMBERED_OR_VAL(1),
.procname = "pvfs2",
.mode = 0555,
.child = pvfs2_table
|