diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:46 -0500 |
commit | c5ef1c42c51b1b5b4a401a6517bdda30933ddbaf (patch) | |
tree | e1a9804a8af427f700aaba4b386cf8679b317e83 /fs/proc/generic.c | |
parent | 92e1d5be91a0e3ffa5c4697eeb09b2aa22792122 (diff) |
[PATCH] mark struct inode_operations const 3
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 'fs/proc/generic.c')
-rw-r--r-- | fs/proc/generic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index aa52f1080e62..0cdc00d9d97e 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -265,7 +265,7 @@ static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry, | |||
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | static struct inode_operations proc_file_inode_operations = { | 268 | static const struct inode_operations proc_file_inode_operations = { |
269 | .setattr = proc_notify_change, | 269 | .setattr = proc_notify_change, |
270 | }; | 270 | }; |
271 | 271 | ||
@@ -357,7 +357,7 @@ static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
357 | return NULL; | 357 | return NULL; |
358 | } | 358 | } |
359 | 359 | ||
360 | static struct inode_operations proc_link_inode_operations = { | 360 | static const struct inode_operations proc_link_inode_operations = { |
361 | .readlink = generic_readlink, | 361 | .readlink = generic_readlink, |
362 | .follow_link = proc_follow_link, | 362 | .follow_link = proc_follow_link, |
363 | }; | 363 | }; |
@@ -505,7 +505,7 @@ static const struct file_operations proc_dir_operations = { | |||
505 | /* | 505 | /* |
506 | * proc directories can do almost nothing.. | 506 | * proc directories can do almost nothing.. |
507 | */ | 507 | */ |
508 | static struct inode_operations proc_dir_inode_operations = { | 508 | static const struct inode_operations proc_dir_inode_operations = { |
509 | .lookup = proc_lookup, | 509 | .lookup = proc_lookup, |
510 | .getattr = proc_getattr, | 510 | .getattr = proc_getattr, |
511 | .setattr = proc_notify_change, | 511 | .setattr = proc_notify_change, |