aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:45 -0500
commit00977a59b951207d38380c75f03a36829950265c (patch)
tree26933feafebffca95df02c19df03f5e56aada47e /fs/proc/generic.c
parentd54b1fdb1d9f82e375a299e22bd366aad52d4c34 (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/generic.c')
-rw-r--r--fs/proc/generic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 853cb877d5f3..aa52f1080e62 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -39,7 +39,7 @@ int proc_match(int len, const char *name, struct proc_dir_entry *de)
39 return !memcmp(name, de->name, len); 39 return !memcmp(name, de->name, len);
40} 40}
41 41
42static struct file_operations proc_file_operations = { 42static const struct file_operations proc_file_operations = {
43 .llseek = proc_file_lseek, 43 .llseek = proc_file_lseek,
44 .read = proc_file_read, 44 .read = proc_file_read,
45 .write = proc_file_write, 45 .write = proc_file_write,
@@ -497,7 +497,7 @@ out: unlock_kernel();
497 * use the in-memory "struct proc_dir_entry" tree to parse 497 * use the in-memory "struct proc_dir_entry" tree to parse
498 * the /proc directory. 498 * the /proc directory.
499 */ 499 */
500static struct file_operations proc_dir_operations = { 500static const struct file_operations proc_dir_operations = {
501 .read = generic_read_dir, 501 .read = generic_read_dir,
502 .readdir = proc_readdir, 502 .readdir = proc_readdir,
503}; 503};