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 /fs/jfs | |
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 'fs/jfs')
-rw-r--r-- | fs/jfs/file.c | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_inode.h | 6 | ||||
-rw-r--r-- | fs/jfs/namei.c | 2 | ||||
-rw-r--r-- | fs/jfs/symlink.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/fs/jfs/file.c b/fs/jfs/file.c index aa9132d04920..f7f8eff19b7b 100644 --- a/fs/jfs/file.c +++ b/fs/jfs/file.c | |||
@@ -88,7 +88,7 @@ static int jfs_release(struct inode *inode, struct file *file) | |||
88 | return 0; | 88 | return 0; |
89 | } | 89 | } |
90 | 90 | ||
91 | struct inode_operations jfs_file_inode_operations = { | 91 | const struct inode_operations jfs_file_inode_operations = { |
92 | .truncate = jfs_truncate, | 92 | .truncate = jfs_truncate, |
93 | .setxattr = jfs_setxattr, | 93 | .setxattr = jfs_setxattr, |
94 | .getxattr = jfs_getxattr, | 94 | .getxattr = jfs_getxattr, |
diff --git a/fs/jfs/jfs_inode.h b/fs/jfs/jfs_inode.h index 0d06ccfaff0e..6802837f757e 100644 --- a/fs/jfs/jfs_inode.h +++ b/fs/jfs/jfs_inode.h | |||
@@ -35,10 +35,10 @@ extern void jfs_set_inode_flags(struct inode *); | |||
35 | extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 35 | extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
36 | 36 | ||
37 | extern const struct address_space_operations jfs_aops; | 37 | extern const struct address_space_operations jfs_aops; |
38 | extern struct inode_operations jfs_dir_inode_operations; | 38 | extern const struct inode_operations jfs_dir_inode_operations; |
39 | extern const struct file_operations jfs_dir_operations; | 39 | extern const struct file_operations jfs_dir_operations; |
40 | extern struct inode_operations jfs_file_inode_operations; | 40 | extern const struct inode_operations jfs_file_inode_operations; |
41 | extern const struct file_operations jfs_file_operations; | 41 | extern const struct file_operations jfs_file_operations; |
42 | extern struct inode_operations jfs_symlink_inode_operations; | 42 | extern const struct inode_operations jfs_symlink_inode_operations; |
43 | extern struct dentry_operations jfs_ci_dentry_operations; | 43 | extern struct dentry_operations jfs_ci_dentry_operations; |
44 | #endif /* _H_JFS_INODE */ | 44 | #endif /* _H_JFS_INODE */ |
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 7ab47561b68d..41c204771262 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -1503,7 +1503,7 @@ struct dentry *jfs_get_parent(struct dentry *dentry) | |||
1503 | return parent; | 1503 | return parent; |
1504 | } | 1504 | } |
1505 | 1505 | ||
1506 | struct inode_operations jfs_dir_inode_operations = { | 1506 | const struct inode_operations jfs_dir_inode_operations = { |
1507 | .create = jfs_create, | 1507 | .create = jfs_create, |
1508 | .lookup = jfs_lookup, | 1508 | .lookup = jfs_lookup, |
1509 | .link = jfs_link, | 1509 | .link = jfs_link, |
diff --git a/fs/jfs/symlink.c b/fs/jfs/symlink.c index cee43f36f51d..4af1a05aad0a 100644 --- a/fs/jfs/symlink.c +++ b/fs/jfs/symlink.c | |||
@@ -29,7 +29,7 @@ static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
29 | return NULL; | 29 | return NULL; |
30 | } | 30 | } |
31 | 31 | ||
32 | struct inode_operations jfs_symlink_inode_operations = { | 32 | const struct inode_operations jfs_symlink_inode_operations = { |
33 | .readlink = generic_readlink, | 33 | .readlink = generic_readlink, |
34 | .follow_link = jfs_follow_link, | 34 | .follow_link = jfs_follow_link, |
35 | .setxattr = jfs_setxattr, | 35 | .setxattr = jfs_setxattr, |