diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-28 04:56:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 12:16:06 -0500 |
commit | 4b6f5d20b04dcbc3d888555522b90ba6d36c4106 (patch) | |
tree | 420f271eaef7d3def7d4433b151c3cb6d7a54770 /include/linux/fs.h | |
parent | 99ac48f54a91d02140c497edc31dc57d4bc5c85d (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 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index ef355bc73714..408fe89498f4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1390,11 +1390,11 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1390 | extern void bd_forget(struct inode *inode); | 1390 | extern void bd_forget(struct inode *inode); |
1391 | extern void bdput(struct block_device *); | 1391 | extern void bdput(struct block_device *); |
1392 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1392 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1393 | extern struct file_operations def_blk_fops; | 1393 | extern const struct file_operations def_blk_fops; |
1394 | extern struct address_space_operations def_blk_aops; | 1394 | extern struct address_space_operations def_blk_aops; |
1395 | extern struct file_operations def_chr_fops; | 1395 | extern const struct file_operations def_chr_fops; |
1396 | extern struct file_operations bad_sock_fops; | 1396 | extern const struct file_operations bad_sock_fops; |
1397 | extern struct file_operations def_fifo_fops; | 1397 | extern const struct file_operations def_fifo_fops; |
1398 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1398 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
1399 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1399 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
1400 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1400 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
@@ -1444,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t); | |||
1444 | extern void make_bad_inode(struct inode *); | 1444 | extern void make_bad_inode(struct inode *); |
1445 | extern int is_bad_inode(struct inode *); | 1445 | extern int is_bad_inode(struct inode *); |
1446 | 1446 | ||
1447 | extern struct file_operations read_fifo_fops; | 1447 | extern const struct file_operations read_fifo_fops; |
1448 | extern struct file_operations write_fifo_fops; | 1448 | extern const struct file_operations write_fifo_fops; |
1449 | extern struct file_operations rdwr_fifo_fops; | 1449 | extern const struct file_operations rdwr_fifo_fops; |
1450 | 1450 | ||
1451 | extern int fs_may_remount_ro(struct super_block *); | 1451 | extern int fs_may_remount_ro(struct super_block *); |
1452 | 1452 | ||
@@ -1688,7 +1688,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |||
1688 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | 1688 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | extern struct file_operations generic_ro_fops; | 1691 | extern const struct file_operations generic_ro_fops; |
1692 | 1692 | ||
1693 | #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) | 1693 | #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) |
1694 | 1694 | ||
@@ -1744,9 +1744,9 @@ extern int simple_commit_write(struct file *file, struct page *page, | |||
1744 | 1744 | ||
1745 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | 1745 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); |
1746 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 1746 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
1747 | extern struct file_operations simple_dir_operations; | 1747 | extern const struct file_operations simple_dir_operations; |
1748 | extern struct inode_operations simple_dir_inode_operations; | 1748 | extern struct inode_operations simple_dir_inode_operations; |
1749 | struct tree_descr { char *name; struct file_operations *ops; int mode; }; | 1749 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; |
1750 | struct dentry *d_alloc_name(struct dentry *, const char *); | 1750 | struct dentry *d_alloc_name(struct dentry *, const char *); |
1751 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); | 1751 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); |
1752 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); | 1752 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); |