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/generic.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/generic.c')
-rw-r--r-- | fs/proc/generic.c | 4 |
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 | ||
42 | static struct file_operations proc_file_operations = { | 42 | static 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 | */ |
500 | static struct file_operations proc_dir_operations = { | 500 | static 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 | }; |