diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 00:55:38 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 09:48:46 -0800 |
commit | 754661f143e70d66eae6c48532ca245aa05dec0e (patch) | |
tree | c3ed0f7f96061931e497ed92d2b21294756b4831 /fs/cifs | |
parent | 9c2e08c592cd357a8330c34def1e8ecfdcf53275 (diff) | |
download | kernel-crypto-754661f143e70d66eae6c48532ca245aa05dec0e.tar.gz kernel-crypto-754661f143e70d66eae6c48532ca245aa05dec0e.tar.xz kernel-crypto-754661f143e70d66eae6c48532ca245aa05dec0e.zip |
[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>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 6 | ||||
-rw-r--r-- | fs/cifs/cifsfs.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 93ef09971d2..481e84f5f36 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -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, diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 8aa66dcf13b..ab9e20a863f 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h @@ -42,7 +42,7 @@ extern void cifs_delete_inode(struct inode *); /* extern void cifs_write_inode(struct inode *); *//* BB not needed yet */ /* Functions related to inodes */ -extern struct inode_operations cifs_dir_inode_ops; +extern const struct inode_operations cifs_dir_inode_ops; extern int cifs_create(struct inode *, struct dentry *, int, struct nameidata *); extern struct dentry * cifs_lookup(struct inode *, struct dentry *, @@ -58,8 +58,8 @@ extern int cifs_revalidate(struct dentry *); extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *); extern int cifs_setattr(struct dentry *, struct iattr *); -extern struct inode_operations cifs_file_inode_ops; -extern struct inode_operations cifs_symlink_inode_ops; +extern const struct inode_operations cifs_file_inode_ops; +extern const struct inode_operations cifs_symlink_inode_ops; /* Functions related to files and directories */ extern const struct file_operations cifs_file_ops; |