diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 00:55:35 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 09:48:46 -0800 |
commit | 9a32144e9d7b4e21341174b1a83b82a82353be86 (patch) | |
tree | 6f08560b341418fc9934f56f6162a95f5b5d8aec /ipc | |
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')
-rw-r--r-- | ipc/mqueue.c | 4 | ||||
-rw-r--r-- | ipc/shm.c | 4 | ||||
-rw-r--r-- | ipc/util.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 02717f71d8d..fafdef357e9 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -85,7 +85,7 @@ struct mqueue_inode_info { }; static struct inode_operations mqueue_dir_inode_operations; -static struct file_operations mqueue_file_operations; +static const struct file_operations mqueue_file_operations; static struct super_operations mqueue_super_ops; static void remove_notification(struct mqueue_inode_info *info); @@ -1166,7 +1166,7 @@ static struct inode_operations mqueue_dir_inode_operations = { .unlink = mqueue_unlink, }; -static struct file_operations mqueue_file_operations = { +static const struct file_operations mqueue_file_operations = { .flush = mqueue_flush_file, .poll = mqueue_poll_file, .read = mqueue_read_file, diff --git a/ipc/shm.c b/ipc/shm.c index f8e10a25ad7..5bb617f6306 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -42,7 +42,7 @@ #include "util.h" -static struct file_operations shm_file_operations; +static const struct file_operations shm_file_operations; static struct vm_operations_struct shm_vm_ops; static struct ipc_ids init_shm_ids; @@ -249,7 +249,7 @@ static int shm_release(struct inode *ino, struct file *file) return 0; } -static struct file_operations shm_file_operations = { +static const struct file_operations shm_file_operations = { .mmap = shm_mmap, .release = shm_release, #ifndef CONFIG_MMU diff --git a/ipc/util.c b/ipc/util.c index 115e9aac136..08a647965b9 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -205,7 +205,7 @@ void __ipc_init ipc_init_ids(struct ipc_ids* ids, int size) } #ifdef CONFIG_PROC_FS -static struct file_operations sysvipc_proc_fops; +static const struct file_operations sysvipc_proc_fops; /** * ipc_init_proc_interface - Create a proc interface for sysipc types using a seq_file interface. * @path: Path in procfs @@ -879,7 +879,7 @@ static int sysvipc_proc_release(struct inode *inode, struct file *file) return seq_release_private(inode, file); } -static struct file_operations sysvipc_proc_fops = { +static const struct file_operations sysvipc_proc_fops = { .open = sysvipc_proc_open, .read = seq_read, .llseek = seq_lseek, |