aboutsummaryrefslogtreecommitdiffstats
path: root/fs/devfs/base.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-03-28 04:56:42 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-28 12:16:06 -0500
commit4b6f5d20b04dcbc3d888555522b90ba6d36c4106 (patch)
tree420f271eaef7d3def7d4433b151c3cb6d7a54770 /fs/devfs/base.c
parent99ac48f54a91d02140c497edc31dc57d4bc5c85d (diff)
[PATCH] Make most file operations structs in fs/ const
This is a conversion to make the various file_operations structs in fs/ const. Basically a regexp job, with a few manual fixups The goal is both to increase correctness (harder to accidentally write to shared datastructures) and reducing the false sharing of cachelines with things that get dirty in .data (while .rodata is nicely read only and thus cache clean) Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/devfs/base.c')
-rw-r--r--fs/devfs/base.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index b621521e09d4..52f5059c4f31 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -856,14 +856,14 @@ static int devfsd_close(struct inode *inode, struct file *file);
856#ifdef CONFIG_DEVFS_DEBUG 856#ifdef CONFIG_DEVFS_DEBUG
857static ssize_t stat_read(struct file *file, char __user *buf, size_t len, 857static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
858 loff_t * ppos); 858 loff_t * ppos);
859static struct file_operations stat_fops = { 859static const struct file_operations stat_fops = {
860 .open = nonseekable_open, 860 .open = nonseekable_open,
861 .read = stat_read, 861 .read = stat_read,
862}; 862};
863#endif 863#endif
864 864
865/* Devfs daemon file operations */ 865/* Devfs daemon file operations */
866static struct file_operations devfsd_fops = { 866static const struct file_operations devfsd_fops = {
867 .open = nonseekable_open, 867 .open = nonseekable_open,
868 .read = devfsd_read, 868 .read = devfsd_read,
869 .ioctl = devfsd_ioctl, 869 .ioctl = devfsd_ioctl,
@@ -1842,8 +1842,8 @@ static int try_modload(struct devfs_entry *parent, struct fs_info *fs_info,
1842 1842
1843static struct inode_operations devfs_iops; 1843static struct inode_operations devfs_iops;
1844static struct inode_operations devfs_dir_iops; 1844static struct inode_operations devfs_dir_iops;
1845static struct file_operations devfs_fops; 1845static const struct file_operations devfs_fops;
1846static struct file_operations devfs_dir_fops; 1846static const struct file_operations devfs_dir_fops;
1847static struct inode_operations devfs_symlink_iops; 1847static struct inode_operations devfs_symlink_iops;
1848 1848
1849static int devfs_notify_change(struct dentry *dentry, struct iattr *iattr) 1849static int devfs_notify_change(struct dentry *dentry, struct iattr *iattr)
@@ -2061,11 +2061,11 @@ static int devfs_open(struct inode *inode, struct file *file)
2061 return err; 2061 return err;
2062} /* End Function devfs_open */ 2062} /* End Function devfs_open */
2063 2063
2064static struct file_operations devfs_fops = { 2064static const struct file_operations devfs_fops = {
2065 .open = devfs_open, 2065 .open = devfs_open,
2066}; 2066};
2067 2067
2068static struct file_operations devfs_dir_fops = { 2068static const struct file_operations devfs_dir_fops = {
2069 .read = generic_read_dir, 2069 .read = generic_read_dir,
2070 .readdir = devfs_readdir, 2070 .readdir = devfs_readdir,
2071}; 2071};