aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/linux/coda_linux.h6
-rw-r--r--include/linux/crash_dump.h2
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/ext3_fs.h4
-rw-r--r--include/linux/fs.h20
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/msdos_fs.h4
-rw-r--r--include/linux/ncp_fs.h4
-rw-r--r--include/linux/nfs_fs.h4
-rw-r--r--include/linux/proc_fs.h6
-rw-r--r--include/linux/qnx4_fs.h4
-rw-r--r--include/linux/ramfs.h2
-rw-r--r--include/linux/reiserfs_fs.h4
-rw-r--r--include/linux/ufs_fs.h4
14 files changed, 34 insertions, 34 deletions
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index cc621ec409d8..b3ecf8f71d97 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -30,9 +30,9 @@ extern struct inode_operations coda_ioctl_inode_operations;
30extern struct address_space_operations coda_file_aops; 30extern struct address_space_operations coda_file_aops;
31extern struct address_space_operations coda_symlink_aops; 31extern struct address_space_operations coda_symlink_aops;
32 32
33extern struct file_operations coda_dir_operations; 33extern const struct file_operations coda_dir_operations;
34extern struct file_operations coda_file_operations; 34extern const struct file_operations coda_file_operations;
35extern struct file_operations coda_ioctl_operations; 35extern const struct file_operations coda_ioctl_operations;
36 36
37/* operations shared over more than one file */ 37/* operations shared over more than one file */
38int coda_open(struct inode *i, struct file *f); 38int coda_open(struct inode *i, struct file *f);
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 534d750d922d..32503657f14f 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -11,7 +11,7 @@
11extern unsigned long long elfcorehdr_addr; 11extern unsigned long long elfcorehdr_addr;
12extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, 12extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
13 unsigned long, int); 13 unsigned long, int);
14extern struct file_operations proc_vmcore_operations; 14extern const struct file_operations proc_vmcore_operations;
15extern struct proc_dir_entry *proc_vmcore; 15extern struct proc_dir_entry *proc_vmcore;
16 16
17#endif /* CONFIG_CRASH_DUMP */ 17#endif /* CONFIG_CRASH_DUMP */
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index 28f368c526fb..fbfa6b52e2fb 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -37,7 +37,7 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
37struct statfs; 37struct statfs;
38 38
39extern struct inode_operations efs_dir_inode_operations; 39extern struct inode_operations efs_dir_inode_operations;
40extern struct file_operations efs_dir_operations; 40extern const struct file_operations efs_dir_operations;
41extern struct address_space_operations efs_symlink_aops; 41extern struct address_space_operations efs_symlink_aops;
42 42
43extern void efs_read_inode(struct inode *); 43extern void efs_read_inode(struct inode *);
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 8bb4f842cded..3ade6a4e3bdd 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -833,11 +833,11 @@ do { \
833 */ 833 */
834 834
835/* dir.c */ 835/* dir.c */
836extern struct file_operations ext3_dir_operations; 836extern const struct file_operations ext3_dir_operations;
837 837
838/* file.c */ 838/* file.c */
839extern struct inode_operations ext3_file_inode_operations; 839extern struct inode_operations ext3_file_inode_operations;
840extern struct file_operations ext3_file_operations; 840extern const struct file_operations ext3_file_operations;
841 841
842/* namei.c */ 842/* namei.c */
843extern struct inode_operations ext3_dir_inode_operations; 843extern struct inode_operations ext3_dir_inode_operations;
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);
1390extern void bd_forget(struct inode *inode); 1390extern void bd_forget(struct inode *inode);
1391extern void bdput(struct block_device *); 1391extern void bdput(struct block_device *);
1392extern struct block_device *open_by_devnum(dev_t, unsigned); 1392extern struct block_device *open_by_devnum(dev_t, unsigned);
1393extern struct file_operations def_blk_fops; 1393extern const struct file_operations def_blk_fops;
1394extern struct address_space_operations def_blk_aops; 1394extern struct address_space_operations def_blk_aops;
1395extern struct file_operations def_chr_fops; 1395extern const struct file_operations def_chr_fops;
1396extern struct file_operations bad_sock_fops; 1396extern const struct file_operations bad_sock_fops;
1397extern struct file_operations def_fifo_fops; 1397extern const struct file_operations def_fifo_fops;
1398extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1398extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1399extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1399extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1400extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1400extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1444,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
1444extern void make_bad_inode(struct inode *); 1444extern void make_bad_inode(struct inode *);
1445extern int is_bad_inode(struct inode *); 1445extern int is_bad_inode(struct inode *);
1446 1446
1447extern struct file_operations read_fifo_fops; 1447extern const struct file_operations read_fifo_fops;
1448extern struct file_operations write_fifo_fops; 1448extern const struct file_operations write_fifo_fops;
1449extern struct file_operations rdwr_fifo_fops; 1449extern const struct file_operations rdwr_fifo_fops;
1450 1450
1451extern int fs_may_remount_ro(struct super_block *); 1451extern 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
1691extern struct file_operations generic_ro_fops; 1691extern 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
1745extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1745extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1746extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 1746extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1747extern struct file_operations simple_dir_operations; 1747extern const struct file_operations simple_dir_operations;
1748extern struct inode_operations simple_dir_inode_operations; 1748extern struct inode_operations simple_dir_inode_operations;
1749struct tree_descr { char *name; struct file_operations *ops; int mode; }; 1749struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1750struct dentry *d_alloc_name(struct dentry *, const char *); 1750struct dentry *d_alloc_name(struct dentry *, const char *);
1751extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1751extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
1752extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); 1752extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index d6f1019625af..4c5e610fe442 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -154,7 +154,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
154 return sb->s_fs_info; 154 return sb->s_fs_info;
155} 155}
156 156
157extern struct file_operations hugetlbfs_file_operations; 157extern const struct file_operations hugetlbfs_file_operations;
158extern struct vm_operations_struct hugetlb_vm_ops; 158extern struct vm_operations_struct hugetlb_vm_ops;
159struct file *hugetlb_zero_setup(size_t); 159struct file *hugetlb_zero_setup(size_t);
160int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, 160int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info,
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 53cee1581650..d9035c73e5d1 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -334,7 +334,7 @@ extern int fat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
334 unsigned long *mapped_blocks); 334 unsigned long *mapped_blocks);
335 335
336/* fat/dir.c */ 336/* fat/dir.c */
337extern struct file_operations fat_dir_operations; 337extern const struct file_operations fat_dir_operations;
338extern int fat_search_long(struct inode *inode, const unsigned char *name, 338extern int fat_search_long(struct inode *inode, const unsigned char *name,
339 int name_len, struct fat_slot_info *sinfo); 339 int name_len, struct fat_slot_info *sinfo);
340extern int fat_dir_empty(struct inode *dir); 340extern int fat_dir_empty(struct inode *dir);
@@ -397,7 +397,7 @@ extern int fat_count_free_clusters(struct super_block *sb);
397/* fat/file.c */ 397/* fat/file.c */
398extern int fat_generic_ioctl(struct inode *inode, struct file *filp, 398extern int fat_generic_ioctl(struct inode *inode, struct file *filp,
399 unsigned int cmd, unsigned long arg); 399 unsigned int cmd, unsigned long arg);
400extern struct file_operations fat_file_operations; 400extern const struct file_operations fat_file_operations;
401extern struct inode_operations fat_file_inode_operations; 401extern struct inode_operations fat_file_inode_operations;
402extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); 402extern int fat_notify_change(struct dentry * dentry, struct iattr * attr);
403extern void fat_truncate(struct inode *inode); 403extern void fat_truncate(struct inode *inode);
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index e01342568530..96dc237b8f03 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -209,7 +209,7 @@ void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
209 209
210/* linux/fs/ncpfs/dir.c */ 210/* linux/fs/ncpfs/dir.c */
211extern struct inode_operations ncp_dir_inode_operations; 211extern struct inode_operations ncp_dir_inode_operations;
212extern struct file_operations ncp_dir_operations; 212extern const struct file_operations ncp_dir_operations;
213int ncp_conn_logged_in(struct super_block *); 213int ncp_conn_logged_in(struct super_block *);
214int ncp_date_dos2unix(__le16 time, __le16 date); 214int ncp_date_dos2unix(__le16 time, __le16 date);
215void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); 215void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
@@ -230,7 +230,7 @@ void ncp_unlock_server(struct ncp_server *server);
230 230
231/* linux/fs/ncpfs/file.c */ 231/* linux/fs/ncpfs/file.c */
232extern struct inode_operations ncp_file_inode_operations; 232extern struct inode_operations ncp_file_inode_operations;
233extern struct file_operations ncp_file_operations; 233extern const struct file_operations ncp_file_operations;
234int ncp_make_open(struct inode *, int); 234int ncp_make_open(struct inode *, int);
235 235
236/* linux/fs/ncpfs/mmap.c */ 236/* linux/fs/ncpfs/mmap.c */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index cbebd7d1b9e8..c71227dd4389 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -324,7 +324,7 @@ extern struct inode_operations nfs_file_inode_operations;
324#ifdef CONFIG_NFS_V3 324#ifdef CONFIG_NFS_V3
325extern struct inode_operations nfs3_file_inode_operations; 325extern struct inode_operations nfs3_file_inode_operations;
326#endif /* CONFIG_NFS_V3 */ 326#endif /* CONFIG_NFS_V3 */
327extern struct file_operations nfs_file_operations; 327extern const struct file_operations nfs_file_operations;
328extern struct address_space_operations nfs_file_aops; 328extern struct address_space_operations nfs_file_aops;
329 329
330static inline struct rpc_cred *nfs_file_cred(struct file *file) 330static inline struct rpc_cred *nfs_file_cred(struct file *file)
@@ -371,7 +371,7 @@ extern struct inode_operations nfs_dir_inode_operations;
371#ifdef CONFIG_NFS_V3 371#ifdef CONFIG_NFS_V3
372extern struct inode_operations nfs3_dir_inode_operations; 372extern struct inode_operations nfs3_dir_inode_operations;
373#endif /* CONFIG_NFS_V3 */ 373#endif /* CONFIG_NFS_V3 */
374extern struct file_operations nfs_dir_operations; 374extern const struct file_operations nfs_dir_operations;
375extern struct dentry_operations nfs_dentry_operations; 375extern struct dentry_operations nfs_dentry_operations;
376 376
377extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); 377extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr);
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 6d03d025fcd5..135871df9911 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -128,9 +128,9 @@ extern int proc_match(int, const char *,struct proc_dir_entry *);
128extern int proc_readdir(struct file *, void *, filldir_t); 128extern int proc_readdir(struct file *, void *, filldir_t);
129extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); 129extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *);
130 130
131extern struct file_operations proc_kcore_operations; 131extern const struct file_operations proc_kcore_operations;
132extern struct file_operations proc_kmsg_operations; 132extern const struct file_operations proc_kmsg_operations;
133extern struct file_operations ppc_htab_operations; 133extern const struct file_operations ppc_htab_operations;
134 134
135/* 135/*
136 * proc_tty.c 136 * proc_tty.c
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index fc610bb0f733..27f49c85d5d6 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -118,8 +118,8 @@ extern struct buffer_head *qnx4_bread(struct inode *, int, int);
118 118
119extern struct inode_operations qnx4_file_inode_operations; 119extern struct inode_operations qnx4_file_inode_operations;
120extern struct inode_operations qnx4_dir_inode_operations; 120extern struct inode_operations qnx4_dir_inode_operations;
121extern struct file_operations qnx4_file_operations; 121extern const struct file_operations qnx4_file_operations;
122extern struct file_operations qnx4_dir_operations; 122extern const struct file_operations qnx4_dir_operations;
123extern int qnx4_is_free(struct super_block *sb, long block); 123extern int qnx4_is_free(struct super_block *sb, long block);
124extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy); 124extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy);
125extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd); 125extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 953b6df5d037..78ecfa28b1c2 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -15,7 +15,7 @@ extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
15extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); 15extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
16#endif 16#endif
17 17
18extern struct file_operations ramfs_file_operations; 18extern const struct file_operations ramfs_file_operations;
19extern struct vm_operations_struct generic_file_vm_ops; 19extern struct vm_operations_struct generic_file_vm_ops;
20 20
21#endif 21#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 912f1b7cb18f..5676c4210e2c 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1960,7 +1960,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
1960extern struct inode_operations reiserfs_dir_inode_operations; 1960extern struct inode_operations reiserfs_dir_inode_operations;
1961extern struct inode_operations reiserfs_symlink_inode_operations; 1961extern struct inode_operations reiserfs_symlink_inode_operations;
1962extern struct inode_operations reiserfs_special_inode_operations; 1962extern struct inode_operations reiserfs_special_inode_operations;
1963extern struct file_operations reiserfs_dir_operations; 1963extern const struct file_operations reiserfs_dir_operations;
1964 1964
1965/* tail_conversion.c */ 1965/* tail_conversion.c */
1966int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, 1966int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
@@ -1972,7 +1972,7 @@ void reiserfs_unmap_buffer(struct buffer_head *);
1972 1972
1973/* file.c */ 1973/* file.c */
1974extern struct inode_operations reiserfs_file_inode_operations; 1974extern struct inode_operations reiserfs_file_inode_operations;
1975extern struct file_operations reiserfs_file_operations; 1975extern const struct file_operations reiserfs_file_operations;
1976extern struct address_space_operations reiserfs_address_space_operations; 1976extern struct address_space_operations reiserfs_address_space_operations;
1977 1977
1978/* fix_nodes.c */ 1978/* fix_nodes.c */
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index b0ffe4356e5a..843aeaaa79d4 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -895,7 +895,7 @@ extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_h
895 895
896/* file.c */ 896/* file.c */
897extern struct inode_operations ufs_file_inode_operations; 897extern struct inode_operations ufs_file_inode_operations;
898extern struct file_operations ufs_file_operations; 898extern const struct file_operations ufs_file_operations;
899 899
900extern struct address_space_operations ufs_aops; 900extern struct address_space_operations ufs_aops;
901 901
@@ -915,7 +915,7 @@ extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
915extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); 915extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
916 916
917/* namei.c */ 917/* namei.c */
918extern struct file_operations ufs_dir_operations; 918extern const struct file_operations ufs_dir_operations;
919 919
920/* super.c */ 920/* super.c */
921extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); 921extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));