diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:46 -0500 |
commit | 92e1d5be91a0e3ffa5c4697eeb09b2aa22792122 (patch) | |
tree | 4eb22a9f6c38e9f4cc2a5100cd6659b0af08b7ae /mm/shmem.c | |
parent | 754661f143e70d66eae6c48532ca245aa05dec0e (diff) |
[PATCH] mark struct inode_operations const 2
Many struct inode_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 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index b38e17169271..882053031aa0 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -178,9 +178,9 @@ static inline void shmem_unacct_blocks(unsigned long flags, long pages) | |||
178 | static struct super_operations shmem_ops; | 178 | static struct super_operations shmem_ops; |
179 | static const struct address_space_operations shmem_aops; | 179 | static const struct address_space_operations shmem_aops; |
180 | static const struct file_operations shmem_file_operations; | 180 | static const struct file_operations shmem_file_operations; |
181 | static struct inode_operations shmem_inode_operations; | 181 | static const struct inode_operations shmem_inode_operations; |
182 | static struct inode_operations shmem_dir_inode_operations; | 182 | static const struct inode_operations shmem_dir_inode_operations; |
183 | static struct inode_operations shmem_special_inode_operations; | 183 | static const struct inode_operations shmem_special_inode_operations; |
184 | static struct vm_operations_struct shmem_vm_ops; | 184 | static struct vm_operations_struct shmem_vm_ops; |
185 | 185 | ||
186 | static struct backing_dev_info shmem_backing_dev_info __read_mostly = { | 186 | static struct backing_dev_info shmem_backing_dev_info __read_mostly = { |
@@ -1410,8 +1410,8 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev) | |||
1410 | } | 1410 | } |
1411 | 1411 | ||
1412 | #ifdef CONFIG_TMPFS | 1412 | #ifdef CONFIG_TMPFS |
1413 | static struct inode_operations shmem_symlink_inode_operations; | 1413 | static const struct inode_operations shmem_symlink_inode_operations; |
1414 | static struct inode_operations shmem_symlink_inline_operations; | 1414 | static const struct inode_operations shmem_symlink_inline_operations; |
1415 | 1415 | ||
1416 | /* | 1416 | /* |
1417 | * Normally tmpfs makes no use of shmem_prepare_write, but it | 1417 | * Normally tmpfs makes no use of shmem_prepare_write, but it |
@@ -1904,12 +1904,12 @@ static void shmem_put_link(struct dentry *dentry, struct nameidata *nd, void *co | |||
1904 | } | 1904 | } |
1905 | } | 1905 | } |
1906 | 1906 | ||
1907 | static struct inode_operations shmem_symlink_inline_operations = { | 1907 | static const struct inode_operations shmem_symlink_inline_operations = { |
1908 | .readlink = generic_readlink, | 1908 | .readlink = generic_readlink, |
1909 | .follow_link = shmem_follow_link_inline, | 1909 | .follow_link = shmem_follow_link_inline, |
1910 | }; | 1910 | }; |
1911 | 1911 | ||
1912 | static struct inode_operations shmem_symlink_inode_operations = { | 1912 | static const struct inode_operations shmem_symlink_inode_operations = { |
1913 | .truncate = shmem_truncate, | 1913 | .truncate = shmem_truncate, |
1914 | .readlink = generic_readlink, | 1914 | .readlink = generic_readlink, |
1915 | .follow_link = shmem_follow_link, | 1915 | .follow_link = shmem_follow_link, |
@@ -2335,7 +2335,7 @@ static const struct file_operations shmem_file_operations = { | |||
2335 | #endif | 2335 | #endif |
2336 | }; | 2336 | }; |
2337 | 2337 | ||
2338 | static struct inode_operations shmem_inode_operations = { | 2338 | static const struct inode_operations shmem_inode_operations = { |
2339 | .truncate = shmem_truncate, | 2339 | .truncate = shmem_truncate, |
2340 | .setattr = shmem_notify_change, | 2340 | .setattr = shmem_notify_change, |
2341 | .truncate_range = shmem_truncate_range, | 2341 | .truncate_range = shmem_truncate_range, |
@@ -2349,7 +2349,7 @@ static struct inode_operations shmem_inode_operations = { | |||
2349 | 2349 | ||
2350 | }; | 2350 | }; |
2351 | 2351 | ||
2352 | static struct inode_operations shmem_dir_inode_operations = { | 2352 | static const struct inode_operations shmem_dir_inode_operations = { |
2353 | #ifdef CONFIG_TMPFS | 2353 | #ifdef CONFIG_TMPFS |
2354 | .create = shmem_create, | 2354 | .create = shmem_create, |
2355 | .lookup = simple_lookup, | 2355 | .lookup = simple_lookup, |
@@ -2371,7 +2371,7 @@ static struct inode_operations shmem_dir_inode_operations = { | |||
2371 | #endif | 2371 | #endif |
2372 | }; | 2372 | }; |
2373 | 2373 | ||
2374 | static struct inode_operations shmem_special_inode_operations = { | 2374 | static const struct inode_operations shmem_special_inode_operations = { |
2375 | #ifdef CONFIG_TMPFS_POSIX_ACL | 2375 | #ifdef CONFIG_TMPFS_POSIX_ACL |
2376 | .setattr = shmem_notify_change, | 2376 | .setattr = shmem_notify_change, |
2377 | .setxattr = generic_setxattr, | 2377 | .setxattr = generic_setxattr, |