[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
@@ -41,10 +41,10 @@
|
||||
#include "v9fs_vfs.h"
|
||||
#include "fid.h"
|
||||
|
||||
static struct inode_operations v9fs_dir_inode_operations;
|
||||
static struct inode_operations v9fs_dir_inode_operations_ext;
|
||||
static struct inode_operations v9fs_file_inode_operations;
|
||||
static struct inode_operations v9fs_symlink_inode_operations;
|
||||
static const struct inode_operations v9fs_dir_inode_operations;
|
||||
static const struct inode_operations v9fs_dir_inode_operations_ext;
|
||||
static const struct inode_operations v9fs_file_inode_operations;
|
||||
static const struct inode_operations v9fs_symlink_inode_operations;
|
||||
|
||||
/**
|
||||
* unixmode2p9mode - convert unix mode bits to plan 9
|
||||
@@ -1303,7 +1303,7 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static struct inode_operations v9fs_dir_inode_operations_ext = {
|
||||
static const struct inode_operations v9fs_dir_inode_operations_ext = {
|
||||
.create = v9fs_vfs_create,
|
||||
.lookup = v9fs_vfs_lookup,
|
||||
.symlink = v9fs_vfs_symlink,
|
||||
@@ -1318,7 +1318,7 @@ static struct inode_operations v9fs_dir_inode_operations_ext = {
|
||||
.setattr = v9fs_vfs_setattr,
|
||||
};
|
||||
|
||||
static struct inode_operations v9fs_dir_inode_operations = {
|
||||
static const struct inode_operations v9fs_dir_inode_operations = {
|
||||
.create = v9fs_vfs_create,
|
||||
.lookup = v9fs_vfs_lookup,
|
||||
.unlink = v9fs_vfs_unlink,
|
||||
@@ -1330,12 +1330,12 @@ static struct inode_operations v9fs_dir_inode_operations = {
|
||||
.setattr = v9fs_vfs_setattr,
|
||||
};
|
||||
|
||||
static struct inode_operations v9fs_file_inode_operations = {
|
||||
static const struct inode_operations v9fs_file_inode_operations = {
|
||||
.getattr = v9fs_vfs_getattr,
|
||||
.setattr = v9fs_vfs_setattr,
|
||||
};
|
||||
|
||||
static struct inode_operations v9fs_symlink_inode_operations = {
|
||||
static const struct inode_operations v9fs_symlink_inode_operations = {
|
||||
.readlink = v9fs_vfs_readlink,
|
||||
.follow_link = v9fs_vfs_follow_link,
|
||||
.put_link = v9fs_vfs_put_link,
|
||||
|
Reference in New Issue
Block a user