diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:46 -0500 |
commit | 9a32144e9d7b4e21341174b1a83b82a82353be86 (patch) | |
tree | 6f08560b341418fc9934f56f6162a95f5b5d8aec /ipc/shm.c | |
parent | 00977a59b951207d38380c75f03a36829950265c (diff) |
[PATCH] mark struct file_operations const 7
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 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | #include "util.h" | 43 | #include "util.h" |
44 | 44 | ||
45 | static struct file_operations shm_file_operations; | 45 | static const struct file_operations shm_file_operations; |
46 | static struct vm_operations_struct shm_vm_ops; | 46 | static struct vm_operations_struct shm_vm_ops; |
47 | 47 | ||
48 | static struct ipc_ids init_shm_ids; | 48 | static struct ipc_ids init_shm_ids; |
@@ -249,7 +249,7 @@ static int shm_release(struct inode *ino, struct file *file) | |||
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
251 | 251 | ||
252 | static struct file_operations shm_file_operations = { | 252 | static const struct file_operations shm_file_operations = { |
253 | .mmap = shm_mmap, | 253 | .mmap = shm_mmap, |
254 | .release = shm_release, | 254 | .release = shm_release, |
255 | #ifndef CONFIG_MMU | 255 | #ifndef CONFIG_MMU |