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 | |
| 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>
54 files changed, 105 insertions, 105 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index f40a84807d75..60f47bf2e8e8 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
| @@ -1115,7 +1115,7 @@ static int gfs2_removexattr(struct dentry *dentry, const char *name) | |||
| 1115 | return gfs2_ea_remove(GFS2_I(dentry->d_inode), &er); | 1115 | return gfs2_ea_remove(GFS2_I(dentry->d_inode), &er); |
| 1116 | } | 1116 | } |
| 1117 | 1117 | ||
| 1118 | struct inode_operations gfs2_file_iops = { | 1118 | const struct inode_operations gfs2_file_iops = { |
| 1119 | .permission = gfs2_permission, | 1119 | .permission = gfs2_permission, |
| 1120 | .setattr = gfs2_setattr, | 1120 | .setattr = gfs2_setattr, |
| 1121 | .getattr = gfs2_getattr, | 1121 | .getattr = gfs2_getattr, |
| @@ -1125,7 +1125,7 @@ struct inode_operations gfs2_file_iops = { | |||
| 1125 | .removexattr = gfs2_removexattr, | 1125 | .removexattr = gfs2_removexattr, |
| 1126 | }; | 1126 | }; |
| 1127 | 1127 | ||
| 1128 | struct inode_operations gfs2_dev_iops = { | 1128 | const struct inode_operations gfs2_dev_iops = { |
| 1129 | .permission = gfs2_permission, | 1129 | .permission = gfs2_permission, |
| 1130 | .setattr = gfs2_setattr, | 1130 | .setattr = gfs2_setattr, |
| 1131 | .getattr = gfs2_getattr, | 1131 | .getattr = gfs2_getattr, |
| @@ -1135,7 +1135,7 @@ struct inode_operations gfs2_dev_iops = { | |||
| 1135 | .removexattr = gfs2_removexattr, | 1135 | .removexattr = gfs2_removexattr, |
| 1136 | }; | 1136 | }; |
| 1137 | 1137 | ||
| 1138 | struct inode_operations gfs2_dir_iops = { | 1138 | const struct inode_operations gfs2_dir_iops = { |
| 1139 | .create = gfs2_create, | 1139 | .create = gfs2_create, |
| 1140 | .lookup = gfs2_lookup, | 1140 | .lookup = gfs2_lookup, |
| 1141 | .link = gfs2_link, | 1141 | .link = gfs2_link, |
| @@ -1154,7 +1154,7 @@ struct inode_operations gfs2_dir_iops = { | |||
| 1154 | .removexattr = gfs2_removexattr, | 1154 | .removexattr = gfs2_removexattr, |
| 1155 | }; | 1155 | }; |
| 1156 | 1156 | ||
| 1157 | struct inode_operations gfs2_symlink_iops = { | 1157 | const struct inode_operations gfs2_symlink_iops = { |
| 1158 | .readlink = gfs2_readlink, | 1158 | .readlink = gfs2_readlink, |
| 1159 | .follow_link = gfs2_follow_link, | 1159 | .follow_link = gfs2_follow_link, |
| 1160 | .permission = gfs2_permission, | 1160 | .permission = gfs2_permission, |
diff --git a/fs/gfs2/ops_inode.h b/fs/gfs2/ops_inode.h index b15acb4fd34c..34f0caac1a03 100644 --- a/fs/gfs2/ops_inode.h +++ b/fs/gfs2/ops_inode.h | |||
| @@ -12,9 +12,9 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
| 14 | 14 | ||
| 15 | extern struct inode_operations gfs2_file_iops; | 15 | extern const struct inode_operations gfs2_file_iops; |
| 16 | extern struct inode_operations gfs2_dir_iops; | 16 | extern const struct inode_operations gfs2_dir_iops; |
| 17 | extern struct inode_operations gfs2_symlink_iops; | 17 | extern const struct inode_operations gfs2_symlink_iops; |
| 18 | extern struct inode_operations gfs2_dev_iops; | 18 | extern const struct inode_operations gfs2_dev_iops; |
| 19 | 19 | ||
| 20 | #endif /* __OPS_INODE_DOT_H__ */ | 20 | #endif /* __OPS_INODE_DOT_H__ */ |
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index e2e0358da335..7c69b98a2e45 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c | |||
| @@ -320,7 +320,7 @@ const struct file_operations hfs_dir_operations = { | |||
| 320 | .release = hfs_dir_release, | 320 | .release = hfs_dir_release, |
| 321 | }; | 321 | }; |
| 322 | 322 | ||
| 323 | struct inode_operations hfs_dir_inode_operations = { | 323 | const struct inode_operations hfs_dir_inode_operations = { |
| 324 | .create = hfs_create, | 324 | .create = hfs_create, |
| 325 | .lookup = hfs_lookup, | 325 | .lookup = hfs_lookup, |
| 326 | .unlink = hfs_unlink, | 326 | .unlink = hfs_unlink, |
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index 735332dfd1b8..147374b6f675 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h | |||
| @@ -170,7 +170,7 @@ extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qst | |||
| 170 | 170 | ||
| 171 | /* dir.c */ | 171 | /* dir.c */ |
| 172 | extern const struct file_operations hfs_dir_operations; | 172 | extern const struct file_operations hfs_dir_operations; |
| 173 | extern struct inode_operations hfs_dir_inode_operations; | 173 | extern const struct inode_operations hfs_dir_inode_operations; |
| 174 | 174 | ||
| 175 | /* extent.c */ | 175 | /* extent.c */ |
| 176 | extern int hfs_ext_keycmp(const btree_key *, const btree_key *); | 176 | extern int hfs_ext_keycmp(const btree_key *, const btree_key *); |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 5cb7f8fee8d6..fafcba593871 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #include "btree.h" | 18 | #include "btree.h" |
| 19 | 19 | ||
| 20 | static const struct file_operations hfs_file_operations; | 20 | static const struct file_operations hfs_file_operations; |
| 21 | static struct inode_operations hfs_file_inode_operations; | 21 | static const struct inode_operations hfs_file_inode_operations; |
| 22 | 22 | ||
| 23 | /*================ Variable-like macros ================*/ | 23 | /*================ Variable-like macros ================*/ |
| 24 | 24 | ||
| @@ -612,7 +612,7 @@ static const struct file_operations hfs_file_operations = { | |||
| 612 | .release = hfs_file_release, | 612 | .release = hfs_file_release, |
| 613 | }; | 613 | }; |
| 614 | 614 | ||
| 615 | static struct inode_operations hfs_file_inode_operations = { | 615 | static const struct inode_operations hfs_file_inode_operations = { |
| 616 | .lookup = hfs_file_lookup, | 616 | .lookup = hfs_file_lookup, |
| 617 | .truncate = hfs_file_truncate, | 617 | .truncate = hfs_file_truncate, |
| 618 | .setattr = hfs_inode_setattr, | 618 | .setattr = hfs_inode_setattr, |
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index e886ac8460d3..78137007ccc1 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
| @@ -471,7 +471,7 @@ static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 471 | return res; | 471 | return res; |
