[PATCH] mark struct inode_operations const 1
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>
This commit is contained in:
committed by
Linus Torvalds
parent
9c2e08c592
commit
754661f143
@@ -533,7 +533,7 @@ static struct file_system_type cifs_fs_type = {
|
||||
.kill_sb = kill_anon_super,
|
||||
/* .fs_flags */
|
||||
};
|
||||
struct inode_operations cifs_dir_inode_ops = {
|
||||
const struct inode_operations cifs_dir_inode_ops = {
|
||||
.create = cifs_create,
|
||||
.lookup = cifs_lookup,
|
||||
.getattr = cifs_getattr,
|
||||
@@ -555,7 +555,7 @@ struct inode_operations cifs_dir_inode_ops = {
|
||||
#endif
|
||||
};
|
||||
|
||||
struct inode_operations cifs_file_inode_ops = {
|
||||
const struct inode_operations cifs_file_inode_ops = {
|
||||
/* revalidate:cifs_revalidate, */
|
||||
.setattr = cifs_setattr,
|
||||
.getattr = cifs_getattr, /* do we need this anymore? */
|
||||
@@ -569,7 +569,7 @@ struct inode_operations cifs_file_inode_ops = {
|
||||
#endif
|
||||
};
|
||||
|
||||
struct inode_operations cifs_symlink_inode_ops = {
|
||||
const struct inode_operations cifs_symlink_inode_ops = {
|
||||
.readlink = generic_readlink,
|
||||
.follow_link = cifs_follow_link,
|
||||
.put_link = cifs_put_link,
|
||||
|
Reference in New Issue
Block a user