diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:45 -0500 |
commit | 00977a59b951207d38380c75f03a36829950265c (patch) | |
tree | 26933feafebffca95df02c19df03f5e56aada47e /fs/proc/proc_misc.c | |
parent | d54b1fdb1d9f82e375a299e22bd366aad52d4c34 (diff) |
[PATCH] mark struct file_operations const 6
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r-- | fs/proc/proc_misc.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 5e2d4359c292..e2c4c0a5c90d 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -223,7 +223,7 @@ static int fragmentation_open(struct inode *inode, struct file *file) | |||
223 | return seq_open(file, &fragmentation_op); | 223 | return seq_open(file, &fragmentation_op); |
224 | } | 224 | } |
225 | 225 | ||
226 | static struct file_operations fragmentation_file_operations = { | 226 | static const struct file_operations fragmentation_file_operations = { |
227 | .open = fragmentation_open, | 227 | .open = fragmentation_open, |
228 | .read = seq_read, | 228 | .read = seq_read, |
229 | .llseek = seq_lseek, | 229 | .llseek = seq_lseek, |
@@ -236,7 +236,7 @@ static int zoneinfo_open(struct inode *inode, struct file *file) | |||
236 | return seq_open(file, &zoneinfo_op); | 236 | return seq_open(file, &zoneinfo_op); |
237 | } | 237 | } |
238 | 238 | ||
239 | static struct file_operations proc_zoneinfo_file_operations = { | 239 | static const struct file_operations proc_zoneinfo_file_operations = { |
240 | .open = zoneinfo_open, | 240 | .open = zoneinfo_open, |
241 | .read = seq_read, | 241 | .read = seq_read, |
242 | .llseek = seq_lseek, | 242 | .llseek = seq_lseek, |
@@ -261,7 +261,7 @@ static int cpuinfo_open(struct inode *inode, struct file *file) | |||
261 | return seq_open(file, &cpuinfo_op); | 261 | return seq_open(file, &cpuinfo_op); |
262 | } | 262 | } |
263 | 263 | ||
264 | static struct file_operations proc_cpuinfo_operations = { | 264 | static const struct file_operations proc_cpuinfo_operations = { |
265 | .open = cpuinfo_open, | 265 | .open = cpuinfo_open, |
266 | .read = seq_read, | 266 | .read = seq_read, |
267 | .llseek = seq_lseek, | 267 | .llseek = seq_lseek, |
@@ -320,7 +320,7 @@ static int devinfo_open(struct inode *inode, struct file *filp) | |||
320 | return seq_open(filp, &devinfo_ops); | 320 | return seq_open(filp, &devinfo_ops); |
321 | } | 321 | } |
322 | 322 | ||
323 | static struct file_operations proc_devinfo_operations = { | 323 | static const struct file_operations proc_devinfo_operations = { |
324 | .open = devinfo_open, | 324 | .open = devinfo_open, |
325 | .read = seq_read, | 325 | .read = seq_read, |
326 | .llseek = seq_lseek, | 326 | .llseek = seq_lseek, |
@@ -332,7 +332,7 @@ static int vmstat_open(struct inode *inode, struct file *file) | |||
332 | { | 332 | { |
333 | return seq_open(file, &vmstat_op); | 333 | return seq_open(file, &vmstat_op); |
334 | } | 334 | } |
335 | static struct file_operations proc_vmstat_file_operations = { | 335 | static const struct file_operations proc_vmstat_file_operations = { |
336 | .open = vmstat_open, | 336 | .open = vmstat_open, |
337 | .read = seq_read, | 337 | .read = seq_read, |
338 | .llseek = seq_lseek, | 338 | .llseek = seq_lseek, |
@@ -363,7 +363,7 @@ static int partitions_open(struct inode *inode, struct file *file) | |||
363 | { | 363 | { |
364 | return seq_open(file, &partitions_op); | 364 | return seq_open(file, &partitions_op); |
365 | } | 365 | } |
366 | static struct file_operations proc_partitions_operations = { | 366 | static const struct file_operations proc_partitions_operations = { |
367 | .open = partitions_open, | 367 | .open = partitions_open, |
368 | .read = seq_read, | 368 | .read = seq_read, |
369 | .llseek = seq_lseek, | 369 | .llseek = seq_lseek, |
@@ -375,7 +375,7 @@ static int diskstats_open(struct inode *inode, struct file *file) | |||
375 | { | 375 | { |
376 | return seq_open(file, &diskstats_op); | 376 | return seq_open(file, &diskstats_op); |
377 | } | 377 | } |
378 | static struct file_operations proc_diskstats_operations = { | 378 | static const struct file_operations proc_diskstats_operations = { |
379 | .open = diskstats_open, | 379 | .open = diskstats_open, |
380 | .read = seq_read, | 380 | .read = seq_read, |
381 | .llseek = seq_lseek, | 381 | .llseek = seq_lseek, |
@@ -389,7 +389,7 @@ static int modules_open(struct inode *inode, struct file *file) | |||
389 | { | 389 | { |
390 | return seq_open(file, &modules_op); | 390 | return seq_open(file, &modules_op); |
391 | } | 391 | } |
392 | static struct file_operations proc_modules_operations = { | 392 | static const struct file_operations proc_modules_operations = { |
393 | .open = modules_open, | 393 | .open = modules_open, |
394 | .read = seq_read, | 394 | .read = seq_read, |
395 | .llseek = seq_lseek, | 395 | .llseek = seq_lseek, |
@@ -404,7 +404,7 @@ static int slabinfo_open(struct inode *inode, struct file *file) | |||
404 | { | 404 | { |
405 | return seq_open(file, &slabinfo_op); | 405 | return seq_open(file, &slabinfo_op); |
406 | } | 406 | } |
407 | static struct file_operations proc_slabinfo_operations = { | 407 | static const struct file_operations proc_slabinfo_operations = { |
408 | .open = slabinfo_open, | 408 | .open = slabinfo_open, |
409 | .read = seq_read, | 409 | .read = seq_read, |
410 | .write = slabinfo_write, | 410 | .write = slabinfo_write, |
@@ -438,7 +438,7 @@ static int slabstats_release(struct inode *inode, struct file *file) | |||
438 | return seq_release(inode, file); | 438 | return seq_release(inode, file); |
439 | } | 439 | } |
440 | 440 | ||
441 | static struct file_operations proc_slabstats_operations = { | 441 | static const struct file_operations proc_slabstats_operations = { |
442 | .open = slabstats_open, | 442 | .open = slabstats_open, |
443 | .read = seq_read, | 443 | .read = seq_read, |
444 | .llseek = seq_lseek, | 444 | .llseek = seq_lseek, |
@@ -551,7 +551,7 @@ static int stat_open(struct inode *inode, struct file *file) | |||
551 | kfree(buf); | 551 | kfree(buf); |
552 | return res; | 552 | return res; |
553 | } | 553 | } |
554 | static struct file_operations proc_stat_operations = { | 554 | static const struct file_operations proc_stat_operations = { |
555 | .open = stat_open, | 555 | .open = stat_open, |
556 | .read = seq_read, | 556 | .read = seq_read, |
557 | .llseek = seq_lseek, | 557 | .llseek = seq_lseek, |
@@ -593,7 +593,7 @@ static int interrupts_open(struct inode *inode, struct file *filp) | |||
593 | return seq_open(filp, &int_seq_ops); | 593 | return seq_open(filp, &int_seq_ops); |
594 | } | 594 | } |
595 | 595 | ||
596 | static struct file_operations proc_interrupts_operations = { | 596 | static const struct file_operations proc_interrupts_operations = { |
597 | .open = interrupts_open, | 597 | .open = interrupts_open, |
598 | .read = seq_read, | 598 | .read = seq_read, |
599 | .llseek = seq_lseek, | 599 | .llseek = seq_lseek, |
@@ -650,7 +650,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf, | |||
650 | return count; | 650 | return count; |
651 | } | 651 | } |
652 | 652 | ||
653 | static struct file_operations proc_sysrq_trigger_operations = { | 653 | static const struct file_operations proc_sysrq_trigger_operations = { |
654 | .write = write_sysrq_trigger, | 654 | .write = write_sysrq_trigger, |
655 | }; | 655 | }; |
656 | #endif | 656 | #endif |