[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>
This commit is contained in:
committed by
Linus Torvalds
parent
754661f143
commit
92e1d5be91
@ -1115,7 +1115,7 @@ static int gfs2_removexattr(struct dentry *dentry, const char *name)
|
||||
return gfs2_ea_remove(GFS2_I(dentry->d_inode), &er);
|
||||
}
|
||||
|
||||
struct inode_operations gfs2_file_iops = {
|
||||
const struct inode_operations gfs2_file_iops = {
|
||||
.permission = gfs2_permission,
|
||||
.setattr = gfs2_setattr,
|
||||
.getattr = gfs2_getattr,
|
||||
@ -1125,7 +1125,7 @@ struct inode_operations gfs2_file_iops = {
|
||||
.removexattr = gfs2_removexattr,
|
||||
};
|
||||
|
||||
struct inode_operations gfs2_dev_iops = {
|
||||
const struct inode_operations gfs2_dev_iops = {
|
||||
.permission = gfs2_permission,
|
||||
.setattr = gfs2_setattr,
|
||||
.getattr = gfs2_getattr,
|
||||
@ -1135,7 +1135,7 @@ struct inode_operations gfs2_dev_iops = {
|
||||
.removexattr = gfs2_removexattr,
|
||||
};
|
||||
|
||||
struct inode_operations gfs2_dir_iops = {
|
||||
const struct inode_operations gfs2_dir_iops = {
|
||||
.create = gfs2_create,
|
||||
.lookup = gfs2_lookup,
|
||||
.link = gfs2_link,
|
||||
@ -1154,7 +1154,7 @@ struct inode_operations gfs2_dir_iops = {
|
||||
.removexattr = gfs2_removexattr,
|
||||
};
|
||||
|
||||
struct inode_operations gfs2_symlink_iops = {
|
||||
const struct inode_operations gfs2_symlink_iops = {
|
||||
.readlink = gfs2_readlink,
|
||||
.follow_link = gfs2_follow_link,
|
||||
.permission = gfs2_permission,
|
||||
|
Reference in New Issue
Block a user