aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:40 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commitc5ef1c42c51b1b5b4a401a6517bdda30933ddbaf (patch)
treee1a9804a8af427f700aaba4b386cf8679b317e83 /include/linux/fs.h
parent92e1d5be91a0e3ffa5c4697eeb09b2aa22792122 (diff)
[PATCH] mark struct inode_operations const 3
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 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 990adcbc0df2..bab891bb2270 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -551,7 +551,7 @@ struct inode {
551 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 551 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
552 struct mutex i_mutex; 552 struct mutex i_mutex;
553 struct rw_semaphore i_alloc_sem; 553 struct rw_semaphore i_alloc_sem;
554 struct inode_operations *i_op; 554 const struct inode_operations *i_op;
555 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 555 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
556 struct super_block *i_sb; 556 struct super_block *i_sb;
557 struct file_lock *i_flock; 557 struct file_lock *i_flock;
@@ -1828,7 +1828,7 @@ extern void page_put_link(struct dentry *, struct nameidata *, void *);
1828extern int __page_symlink(struct inode *inode, const char *symname, int len, 1828extern int __page_symlink(struct inode *inode, const char *symname, int len,
1829 gfp_t gfp_mask); 1829 gfp_t gfp_mask);
1830extern int page_symlink(struct inode *inode, const char *symname, int len); 1830extern int page_symlink(struct inode *inode, const char *symname, int len);
1831extern struct inode_operations page_symlink_inode_operations; 1831extern const struct inode_operations page_symlink_inode_operations;
1832extern int generic_readlink(struct dentry *, char __user *, int); 1832extern int generic_readlink(struct dentry *, char __user *, int);
1833extern void generic_fillattr(struct inode *, struct kstat *); 1833extern void generic_fillattr(struct inode *, struct kstat *);
1834extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 1834extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
@@ -1873,7 +1873,7 @@ extern int simple_commit_write(struct file *file, struct page *page,
1873extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1873extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1874extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 1874extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1875extern const struct file_operations simple_dir_operations; 1875extern const struct file_operations simple_dir_operations;
1876extern struct inode_operations simple_dir_inode_operations; 1876extern const struct inode_operations simple_dir_inode_operations;
1877struct tree_descr { char *name; const struct file_operations *ops; int mode; }; 1877struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1878struct dentry *d_alloc_name(struct dentry *, const char *); 1878struct dentry *d_alloc_name(struct dentry *, const char *);
1879extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1879extern int simple_fill_super(struct super_block *, int, struct tree_descr *);