Commit f5e54d6e53a20cef45af7499e86164f0e0d16bb2

Authored by Christoph Hellwig
Committed by Linus Torvalds
1 parent a052b68b1e

[PATCH] mark address_space_operations const

Same as with already do with the file operations: keep them in .rodata and
prevents people from doing runtime patching.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Steven French <sfrench@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 89 changed files with 121 additions and 121 deletions Side-by-side Diff

drivers/block/loop.c
... ... @@ -210,7 +210,7 @@
210 210 {
211 211 struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
212 212 struct address_space *mapping = file->f_mapping;
213   - struct address_space_operations *aops = mapping->a_ops;
  213 + const struct address_space_operations *aops = mapping->a_ops;
214 214 pgoff_t index;
215 215 unsigned offset, bv_offs;
216 216 int len, ret;
... ... @@ -784,7 +784,7 @@
784 784  
785 785 error = -EINVAL;
786 786 if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) {
787   - struct address_space_operations *aops = mapping->a_ops;
  787 + const struct address_space_operations *aops = mapping->a_ops;
788 788 /*
789 789 * If we can't read - sorry. If we only can't write - well,
790 790 * it's going to be read-only.
... ... @@ -191,7 +191,7 @@
191 191 return 0;
192 192 }
193 193  
194   -static struct address_space_operations ramdisk_aops = {
  194 +static const struct address_space_operations ramdisk_aops = {
195 195 .readpage = ramdisk_readpage,
196 196 .prepare_write = ramdisk_prepare_write,
197 197 .commit_write = ramdisk_commit_write,
... ... @@ -38,7 +38,7 @@
38 38 */
39 39  
40 40 extern struct file_system_type v9fs_fs_type;
41   -extern struct address_space_operations v9fs_addr_operations;
  41 +extern const struct address_space_operations v9fs_addr_operations;
42 42 extern const struct file_operations v9fs_file_operations;
43 43 extern const struct file_operations v9fs_dir_operations;
44 44 extern struct dentry_operations v9fs_dentry_operations;
... ... @@ -103,7 +103,7 @@
103 103 return retval;
104 104 }
105 105  
106   -struct address_space_operations v9fs_addr_operations = {
  106 +const struct address_space_operations v9fs_addr_operations = {
107 107 .readpage = v9fs_vfs_readpage,
108 108 };
... ... @@ -72,7 +72,7 @@
72 72 return generic_block_bmap(mapping, block, adfs_get_block);
73 73 }
74 74  
75   -static struct address_space_operations adfs_aops = {
  75 +static const struct address_space_operations adfs_aops = {
76 76 .readpage = adfs_readpage,
77 77 .writepage = adfs_writepage,
78 78 .sync_page = block_sync_page,
... ... @@ -195,9 +195,9 @@
195 195 extern const struct file_operations affs_file_operations;
196 196 extern const struct file_operations affs_file_operations_ofs;
197 197 extern const struct file_operations affs_dir_operations;
198   -extern struct address_space_operations affs_symlink_aops;
199   -extern struct address_space_operations affs_aops;
200   -extern struct address_space_operations affs_aops_ofs;
  198 +extern const struct address_space_operations affs_symlink_aops;
  199 +extern const struct address_space_operations affs_aops;
  200 +extern const struct address_space_operations affs_aops_ofs;
201 201  
202 202 extern struct dentry_operations affs_dentry_operations;
203 203 extern struct dentry_operations affs_dentry_operations_intl;
... ... @@ -406,7 +406,7 @@
406 406 {
407 407 return generic_block_bmap(mapping,block,affs_get_block);
408 408 }
409   -struct address_space_operations affs_aops = {
  409 +const struct address_space_operations affs_aops = {
410 410 .readpage = affs_readpage,
411 411 .writepage = affs_writepage,
412 412 .sync_page = block_sync_page,
... ... @@ -759,7 +759,7 @@
759 759 goto done;
760 760 }
761 761  
762   -struct address_space_operations affs_aops_ofs = {
  762 +const struct address_space_operations affs_aops_ofs = {
763 763 .readpage = affs_readpage_ofs,
764 764 //.writepage = affs_writepage_ofs,
765 765 //.sync_page = affs_sync_page_ofs,
... ... @@ -66,7 +66,7 @@
66 66 return err;
67 67 }
68 68  
69   -struct address_space_operations affs_symlink_aops = {
  69 +const struct address_space_operations affs_symlink_aops = {
70 70 .readpage = affs_symlink_readpage,
71 71 };
72 72  
... ... @@ -35,7 +35,7 @@
35 35 .getattr = afs_inode_getattr,
36 36 };
37 37  
38   -struct address_space_operations afs_fs_aops = {
  38 +const struct address_space_operations afs_fs_aops = {
39 39 .readpage = afs_file_readpage,
40 40 .sync_page = block_sync_page,
41 41 .set_page_dirty = __set_page_dirty_nobuffers,
... ... @@ -69,7 +69,7 @@
69 69 /*
70 70 * file.c
71 71 */
72   -extern struct address_space_operations afs_fs_aops;
  72 +extern const struct address_space_operations afs_fs_aops;
73 73 extern struct inode_operations afs_file_inode_operations;
74 74  
75 75 #ifdef AFS_CACHING_SUPPORT
... ... @@ -73,7 +73,7 @@
73 73 .lookup = befs_lookup,
74 74 };
75 75  
76   -static struct address_space_operations befs_aops = {
  76 +static const struct address_space_operations befs_aops = {
77 77 .readpage = befs_readpage,
78 78 .sync_page = block_sync_page,
79 79 .bmap = befs_bmap,
... ... @@ -50,7 +50,7 @@
50 50 /* file.c */
51 51 extern struct inode_operations bfs_file_inops;
52 52 extern const struct file_operations bfs_file_operations;
53   -extern struct address_space_operations bfs_aops;
  53 +extern const struct address_space_operations bfs_aops;
54 54  
55 55 /* dir.c */
56 56 extern struct inode_operations bfs_dir_inops;
... ... @@ -153,7 +153,7 @@
153 153 return generic_block_bmap(mapping, block, bfs_get_block);
154 154 }
155 155  
156   -struct address_space_operations bfs_aops = {
  156 +const struct address_space_operations bfs_aops = {
157 157 .readpage = bfs_readpage,
158 158 .writepage = bfs_writepage,
159 159 .sync_page = block_sync_page,
... ... @@ -1095,7 +1095,7 @@
1095 1095 return blkdev_ioctl(file->f_mapping->host, file, cmd, arg);
1096 1096 }
1097 1097  
1098   -struct address_space_operations def_blk_aops = {
  1098 +const struct address_space_operations def_blk_aops = {
1099 1099 .readpage = blkdev_readpage,
1100 1100 .writepage = blkdev_writepage,
1101 1101 .sync_page = block_sync_page,
... ... @@ -2598,7 +2598,7 @@
2598 2598 unsigned offset = from & (PAGE_CACHE_SIZE-1);
2599 2599 unsigned to;
2600 2600 struct page *page;
2601   - struct address_space_operations *a_ops = mapping->a_ops;
  2601 + const struct address_space_operations *a_ops = mapping->a_ops;
2602 2602 char *kaddr;
2603 2603 int ret = 0;
2604 2604  
... ... @@ -32,8 +32,8 @@
32 32 #define TRUE 1
33 33 #endif
34 34  
35   -extern struct address_space_operations cifs_addr_ops;
36   -extern struct address_space_operations cifs_addr_ops_smallbuf;
  35 +extern const struct address_space_operations cifs_addr_ops;
  36 +extern const struct address_space_operations cifs_addr_ops_smallbuf;
37 37  
38 38 /* Functions related to super block operations */
39 39 extern struct super_operations cifs_super_ops;
... ... @@ -1942,7 +1942,7 @@
1942 1942 return 0;
1943 1943 }
1944 1944  
1945   -struct address_space_operations cifs_addr_ops = {
  1945 +const struct address_space_operations cifs_addr_ops = {
1946 1946 .readpage = cifs_readpage,
1947 1947 .readpages = cifs_readpages,
1948 1948 .writepage = cifs_writepage,
... ... @@ -1959,7 +1959,7 @@
1959 1959 * contain the header plus one complete page of data. Otherwise, we need
1960 1960 * to leave cifs_readpages out of the address space operations.
1961 1961 */
1962   -struct address_space_operations cifs_addr_ops_smallbuf = {
  1962 +const struct address_space_operations cifs_addr_ops_smallbuf = {
1963 1963 .readpage = cifs_readpage,
1964 1964 .writepage = cifs_writepage,
1965 1965 .writepages = cifs_writepages,
... ... @@ -50,7 +50,7 @@
50 50 return error;
51 51 }
52 52  
53   -struct address_space_operations coda_symlink_aops = {
  53 +const struct address_space_operations coda_symlink_aops = {
54 54 .readpage = coda_symlink_filler,
55 55 };
... ... @@ -38,7 +38,7 @@
38 38  
39 39 extern struct super_block * configfs_sb;
40 40  
41   -static struct address_space_operations configfs_aops = {
  41 +static const struct address_space_operations configfs_aops = {
42 42 .readpage = simple_readpage,
43 43 .prepare_write = simple_prepare_write,
44 44 .commit_write = simple_commit_write
... ... @@ -30,7 +30,7 @@
30 30 static struct super_operations cramfs_ops;
31 31 static struct inode_operations cramfs_dir_inode_operations;
32 32 static const struct file_operations cramfs_directory_operations;
33   -static struct address_space_operations cramfs_aops;
  33 +static const struct address_space_operations cramfs_aops;
34 34  
35 35 static DEFINE_MUTEX(read_mutex);
36 36  
... ... @@ -501,7 +501,7 @@
501 501 return 0;
502 502 }
503 503  
504   -static struct address_space_operations cramfs_aops = {
  504 +static const struct address_space_operations cramfs_aops = {
505 505 .readpage = cramfs_readpage
506 506 };
507 507  
... ... @@ -21,7 +21,7 @@
21 21 {
22 22 return generic_block_bmap(mapping,block,efs_get_block);
23 23 }
24   -static struct address_space_operations efs_aops = {
  24 +static const struct address_space_operations efs_aops = {
25 25 .readpage = efs_readpage,
26 26 .sync_page = block_sync_page,
27 27 .bmap = _efs_bmap
... ... @@ -53,7 +53,7 @@
53 53 return err;
54 54 }
55 55  
56   -struct address_space_operations efs_symlink_aops = {
  56 +const struct address_space_operations efs_symlink_aops = {
57 57 .readpage = efs_symlink_readpage
58 58 };
... ... @@ -162,9 +162,9 @@
162 162 extern const struct file_operations ext2_xip_file_operations;
163 163  
164 164 /* inode.c */
165   -extern struct address_space_operations ext2_aops;
166   -extern struct address_space_operations ext2_aops_xip;
167   -extern struct address_space_operations ext2_nobh_aops;
  165 +extern const struct address_space_operations ext2_aops;
  166 +extern const struct address_space_operations ext2_aops_xip;
  167 +extern const struct address_space_operations ext2_nobh_aops;
168 168  
169 169 /* namei.c */
170 170 extern struct inode_operations ext2_dir_inode_operations;
... ... @@ -684,7 +684,7 @@
684 684 return mpage_writepages(mapping, wbc, ext2_get_block);
685 685 }
686 686  
687   -struct address_space_operations ext2_aops = {
  687 +const struct address_space_operations ext2_aops = {
688 688 .readpage = ext2_readpage,
689 689 .readpages = ext2_readpages,
690 690 .writepage = ext2_writepage,
691 691  
... ... @@ -697,12 +697,12 @@
697 697 .migratepage = buffer_migrate_page,
698 698 };
699 699  
700   -struct address_space_operations ext2_aops_xip = {
  700 +const struct address_space_operations ext2_aops_xip = {
701 701 .bmap = ext2_bmap,
702 702 .get_xip_page = ext2_get_xip_page,
703 703 };
704 704  
705   -struct address_space_operations ext2_nobh_aops = {
  705 +const struct address_space_operations ext2_nobh_aops = {
706 706 .readpage = ext2_readpage,
707 707 .readpages = ext2_readpages,
708 708 .writepage = ext2_nobh_writepage,
... ... @@ -1698,7 +1698,7 @@
1698 1698 return __set_page_dirty_nobuffers(page);
1699 1699 }
1700 1700  
1701   -static struct address_space_operations ext3_ordered_aops = {
  1701 +static const struct address_space_operations ext3_ordered_aops = {
1702 1702 .readpage = ext3_readpage,
1703 1703 .readpages = ext3_readpages,
1704 1704 .writepage = ext3_ordered_writepage,
... ... @@ -1712,7 +1712,7 @@
1712 1712 .migratepage = buffer_migrate_page,
1713 1713 };
1714 1714  
1715   -static struct address_space_operations ext3_writeback_aops = {
  1715 +static const struct address_space_operations ext3_writeback_aops = {
1716 1716 .readpage = ext3_readpage,
1717 1717 .readpages = ext3_readpages,
1718 1718 .writepage = ext3_writeback_writepage,
... ... @@ -1726,7 +1726,7 @@
1726 1726 .migratepage = buffer_migrate_page,
1727 1727 };
1728 1728  
1729   -static struct address_space_operations ext3_journalled_aops = {
  1729 +static const struct address_space_operations ext3_journalled_aops = {
1730 1730 .readpage = ext3_readpage,
1731 1731 .readpages = ext3_readpages,
1732 1732 .writepage = ext3_journalled_writepage,
... ... @@ -196,7 +196,7 @@
196 196 return generic_block_bmap(mapping, block, fat_get_block);
197 197 }
198 198  
199   -static struct address_space_operations fat_aops = {
  199 +static const struct address_space_operations fat_aops = {
200 200 .readpage = fat_readpage,
201 201 .readpages = fat_readpages,
202 202 .writepage = fat_writepage,
fs/freevxfs/vxfs_immed.c
... ... @@ -56,7 +56,7 @@
56 56 /*
57 57 * Adress space operations for immed files and directories.
58 58 */
59   -struct address_space_operations vxfs_immed_aops = {
  59 +const struct address_space_operations vxfs_immed_aops = {
60 60 .readpage = vxfs_immed_readpage,
61 61 };
62 62  
fs/freevxfs/vxfs_inode.c
... ... @@ -41,8 +41,8 @@
41 41 #include "vxfs_extern.h"
42 42  
43 43  
44   -extern struct address_space_operations vxfs_aops;
45   -extern struct address_space_operations vxfs_immed_aops;
  44 +extern const struct address_space_operations vxfs_aops;
  45 +extern const struct address_space_operations vxfs_immed_aops;
46 46  
47 47 extern struct inode_operations vxfs_immed_symlink_iops;
48 48  
... ... @@ -295,7 +295,7 @@
295 295 {
296 296 struct super_block *sbp = ip->i_sb;
297 297 struct vxfs_inode_info *vip;
298   - struct address_space_operations *aops;
  298 + const struct address_space_operations *aops;
299 299 ino_t ino = ip->i_ino;
300 300  
301 301 if (!(vip = __vxfs_iget(ino, VXFS_SBI(sbp)->vsi_ilist)))
fs/freevxfs/vxfs_subr.c
... ... @@ -42,7 +42,7 @@
42 42 static int vxfs_readpage(struct file *, struct page *);
43 43 static sector_t vxfs_bmap(struct address_space *, sector_t);
44 44  
45   -struct address_space_operations vxfs_aops = {
  45 +const struct address_space_operations vxfs_aops = {
46 46 .readpage = vxfs_readpage,
47 47 .bmap = vxfs_bmap,
48 48 .sync_page = block_sync_page,
... ... @@ -770,7 +770,7 @@
770 770 /* no mmap and sendfile */
771 771 };
772 772  
773   -static struct address_space_operations fuse_file_aops = {
  773 +static const struct address_space_operations fuse_file_aops = {
774 774 .readpage = fuse_readpage,
775 775 .prepare_write = fuse_prepare_write,
776 776 .commit_write = fuse_commit_write,
... ... @@ -182,8 +182,8 @@
182 182 extern int hfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
183 183  
184 184 /* inode.c */
185   -extern struct address_space_operations hfs_aops;
186   -extern struct address_space_operations hfs_btree_aops;
  185 +extern const struct address_space_operations hfs_aops;
  186 +extern const struct address_space_operations hfs_btree_aops;
187 187  
188 188 extern struct inode *hfs_new_inode(struct inode *, struct qstr *, int);
189 189 extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *);
... ... @@ -114,7 +114,7 @@
114 114 return mpage_writepages(mapping, wbc, hfs_get_block);
115 115 }
116 116  
117   -struct address_space_operations hfs_btree_aops = {
  117 +const struct address_space_operations hfs_btree_aops = {
118 118 .readpage = hfs_readpage,
119 119 .writepage = hfs_writepage,
120 120 .sync_page = block_sync_page,
... ... @@ -124,7 +124,7 @@
124 124 .releasepage = hfs_releasepage,
125 125 };
126 126  
127   -struct address_space_operations hfs_aops = {
  127 +const struct address_space_operations hfs_aops = {
128 128 .readpage = hfs_readpage,
129 129 .writepage = hfs_writepage,
130 130 .sync_page = block_sync_page,
fs/hfsplus/hfsplus_fs.h
... ... @@ -323,8 +323,8 @@
323 323 void hfsplus_file_truncate(struct inode *);
324 324  
325 325 /* inode.c */
326   -extern struct address_space_operations hfsplus_aops;
327   -extern struct address_space_operations hfsplus_btree_aops;
  326 +extern const struct address_space_operations hfsplus_aops;
  327 +extern const struct address_space_operations hfsplus_btree_aops;
328 328  
329 329 void hfsplus_inode_read_fork(struct inode *, struct hfsplus_fork_raw *);
330 330 void hfsplus_inode_write_fork(struct inode *, struct hfsplus_fork_raw *);
... ... @@ -109,7 +109,7 @@
109 109 return mpage_writepages(mapping, wbc, hfsplus_get_block);
110 110 }
111 111  
112   -struct address_space_operations hfsplus_btree_aops = {
  112 +const struct address_space_operations hfsplus_btree_aops = {
113 113 .readpage = hfsplus_readpage,
114 114 .writepage = hfsplus_writepage,
115 115 .sync_page = block_sync_page,
... ... @@ -119,7 +119,7 @@
119 119 .releasepage = hfsplus_releasepage,
120 120 };
121 121  
122   -struct address_space_operations hfsplus_aops = {
  122 +const struct address_space_operations hfsplus_aops = {
123 123 .readpage = hfsplus_readpage,
124 124 .writepage = hfsplus_writepage,
125 125 .sync_page = block_sync_page,
fs/hostfs/hostfs_kern.c
... ... @@ -54,7 +54,7 @@
54 54  
55 55 static struct inode_operations hostfs_iops;
56 56 static struct inode_operations hostfs_dir_iops;
57   -static struct address_space_operations hostfs_link_aops;
  57 +static const struct address_space_operations hostfs_link_aops;
58 58  
59 59 #ifndef MODULE
60 60 static int __init hostfs_args(char *options, int *add)
... ... @@ -518,7 +518,7 @@
518 518 return(err);
519 519 }
520 520  
521   -static struct address_space_operations hostfs_aops = {
  521 +static const struct address_space_operations hostfs_aops = {
522 522 .writepage = hostfs_writepage,
523 523 .readpage = hostfs_readpage,
524 524 .set_page_dirty = __set_page_dirty_nobuffers,
... ... @@ -935,7 +935,7 @@
935 935 return(err);
936 936 }
937 937  
938   -static struct address_space_operations hostfs_link_aops = {
  938 +static const struct address_space_operations hostfs_link_aops = {
939 939 .readpage = hostfs_link_readpage,
940 940 };
941 941  
... ... @@ -99,7 +99,7 @@
99 99 {
100 100 return generic_block_bmap(mapping,block,hpfs_get_block);
101 101 }
102   -struct address_space_operations hpfs_aops = {
  102 +const struct address_space_operations hpfs_aops = {
103 103 .readpage = hpfs_readpage,
104 104 .writepage = hpfs_writepage,
105 105 .sync_page = block_sync_page,
... ... @@ -268,7 +268,7 @@
268 268 int hpfs_file_fsync(struct file *, struct dentry *, int);
269 269 extern const struct file_operations hpfs_file_ops;
270 270 extern struct inode_operations hpfs_file_iops;
271   -extern struct address_space_operations hpfs_aops;
  271 +extern const struct address_space_operations hpfs_aops;
272 272  
273 273 /* inode.c */
274 274  
... ... @@ -304,7 +304,7 @@
304 304 /* namei.c */
305 305  
306 306 extern struct inode_operations hpfs_dir_iops;
307   -extern struct address_space_operations hpfs_symlink_aops;
  307 +extern const struct address_space_operations hpfs_symlink_aops;
308 308  
309 309 static inline struct hpfs_inode_info *hpfs_i(struct inode *inode)
310 310 {
... ... @@ -538,7 +538,7 @@
538 538 return err;
539 539 }
540 540  
541   -struct address_space_operations hpfs_symlink_aops = {
  541 +const struct address_space_operations hpfs_symlink_aops = {
542 542 .readpage = hpfs_symlink_readpage
543 543 };
544 544  
fs/hugetlbfs/inode.c
... ... @@ -34,7 +34,7 @@
34 34 #define HUGETLBFS_MAGIC 0x958458f6
35 35  
36 36 static struct super_operations hugetlbfs_ops;
37   -static struct address_space_operations hugetlbfs_aops;
  37 +static const struct address_space_operations hugetlbfs_aops;
38 38 const struct file_operations hugetlbfs_file_operations;
39 39 static struct inode_operations hugetlbfs_dir_inode_operations;
40 40 static struct inode_operations hugetlbfs_inode_operations;
... ... @@ -547,7 +547,7 @@
547 547 kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode));
548 548 }
549 549  
550   -static struct address_space_operations hugetlbfs_aops = {
  550 +static const struct address_space_operations hugetlbfs_aops = {
551 551 .readpage = hugetlbfs_readpage,
552 552 .prepare_write = hugetlbfs_prepare_write,
553 553 .commit_write = hugetlbfs_commit_write,
... ... @@ -102,7 +102,7 @@
102 102  
103 103 static struct inode *alloc_inode(struct super_block *sb)
104 104 {
105   - static struct address_space_operations empty_aops;
  105 + static const struct address_space_operations empty_aops;
106 106 static struct inode_operations empty_iops;
107 107 static const struct file_operations empty_fops;
108 108 struct inode *inode;
... ... @@ -312,7 +312,7 @@
312 312 return err;
313 313 }
314 314  
315   -struct address_space_operations zisofs_aops = {
  315 +const struct address_space_operations zisofs_aops = {
316 316 .readpage = zisofs_readpage,
317 317 /* No sync_page operation supported? */
318 318 /* No bmap operation supported */
... ... @@ -1054,7 +1054,7 @@
1054 1054 return generic_block_bmap(mapping,block,isofs_get_block);
1055 1055 }
1056 1056  
1057   -static struct address_space_operations isofs_aops = {
  1057 +static const struct address_space_operations isofs_aops = {
1058 1058 .readpage = isofs_readpage,
1059 1059 .sync_page = block_sync_page,
1060 1060 .bmap = _isofs_bmap
... ... @@ -176,6 +176,6 @@
176 176  
177 177 extern struct inode_operations isofs_dir_inode_operations;
178 178 extern const struct file_operations isofs_dir_operations;
179   -extern struct address_space_operations isofs_symlink_aops;
  179 +extern const struct address_space_operations isofs_symlink_aops;
180 180 extern struct export_operations isofs_export_ops;
... ... @@ -754,7 +754,7 @@
754 754 return -EIO;
755 755 }
756 756  
757   -struct address_space_operations isofs_symlink_aops = {
  757 +const struct address_space_operations isofs_symlink_aops = {
758 758 .readpage = rock_ridge_symlink_readpage
759 759 };
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 #ifdef CONFIG_ZISOFS
18   -extern struct address_space_operations zisofs_aops;
  18 +extern const struct address_space_operations zisofs_aops;
19 19 extern int __init zisofs_init(void);
20 20 extern void zisofs_cleanup(void);
21 21 #endif
... ... @@ -59,7 +59,7 @@
59 59 static struct inode_operations jffs_file_inode_operations;
60 60 static const struct file_operations jffs_dir_operations;
61 61 static struct inode_operations jffs_dir_inode_operations;
62   -static struct address_space_operations jffs_address_operations;
  62 +static const struct address_space_operations jffs_address_operations;
63 63  
64 64 kmem_cache_t *node_cache = NULL;
65 65 kmem_cache_t *fm_cache = NULL;
... ... @@ -1614,7 +1614,7 @@
1614 1614 } /* jffs_ioctl() */
1615 1615  
1616 1616  
1617   -static struct address_space_operations jffs_address_operations = {
  1617 +static const struct address_space_operations jffs_address_operations = {
1618 1618 .readpage = jffs_readpage,
1619 1619 .prepare_write = jffs_prepare_write,
1620 1620 .commit_write = jffs_commit_write,
... ... @@ -62,7 +62,7 @@
62 62 .removexattr = jffs2_removexattr
63 63 };
64 64  
65   -struct address_space_operations jffs2_file_address_operations =
  65 +const struct address_space_operations jffs2_file_address_operations =
66 66 {
67 67 .readpage = jffs2_readpage,
68 68 .prepare_write =jffs2_prepare_write,
... ... @@ -158,7 +158,7 @@
158 158 /* file.c */
159 159 extern const struct file_operations jffs2_file_operations;
160 160 extern struct inode_operations jffs2_file_inode_operations;
161   -extern struct address_space_operations jffs2_file_address_operations;
  161 +extern const struct address_space_operations jffs2_file_address_operations;
162 162 int jffs2_fsync(struct file *, struct dentry *, int);
163 163 int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg);
164 164  
... ... @@ -305,7 +305,7 @@
305 305 offset, nr_segs, jfs_get_block, NULL);
306 306 }
307 307  
308   -struct address_space_operations jfs_aops = {
  308 +const struct address_space_operations jfs_aops = {
309 309 .readpage = jfs_readpage,
310 310 .readpages = jfs_readpages,
311 311 .writepage = jfs_writepage,
... ... @@ -33,7 +33,7 @@
33 33 extern struct dentry *jfs_get_parent(struct dentry *dentry);
34 34 extern void jfs_set_inode_flags(struct inode *);
35 35  
36   -extern struct address_space_operations jfs_aops;
  36 +extern const struct address_space_operations jfs_aops;
37 37 extern struct inode_operations jfs_dir_inode_operations;
38 38 extern const struct file_operations jfs_dir_operations;
39 39 extern struct inode_operations jfs_file_inode_operations;
fs/jfs/jfs_metapage.c
... ... @@ -577,7 +577,7 @@
577 577 metapage_releasepage(page, 0);
578 578 }
579 579  
580   -struct address_space_operations jfs_metapage_aops = {
  580 +const struct address_space_operations jfs_metapage_aops = {
581 581 .readpage = metapage_readpage,
582 582 .writepage = metapage_writepage,
583 583 .sync_page = block_sync_page,
fs/jfs/jfs_metapage.h
... ... @@ -139,7 +139,7 @@
139 139 put_metapage(mp);
140 140 }
141 141  
142   -extern struct address_space_operations jfs_metapage_aops;
  142 +extern const struct address_space_operations jfs_metapage_aops;
143 143  
144 144 /*
145 145 * This routines invalidate all pages for an extent.
... ... @@ -335,7 +335,7 @@
335 335 {
336 336 return generic_block_bmap(mapping,block,minix_get_block);
337 337 }
338   -static struct address_space_operations minix_aops = {
  338 +static const struct address_space_operations minix_aops = {
339 339 .readpage = minix_readpage,
340 340 .writepage = minix_writepage,
341 341 .sync_page = block_sync_page,
... ... @@ -105,7 +105,7 @@
105 105  
106 106 extern struct dentry_operations ncp_root_dentry_operations;
107 107 #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
108   -extern struct address_space_operations ncp_symlink_aops;
  108 +extern const struct address_space_operations ncp_symlink_aops;
109 109 extern int ncp_symlink(struct inode*, struct dentry*, const char*);
110 110 #endif
111 111  
... ... @@ -99,7 +99,7 @@
99 99 /*
100 100 * symlinks can't do much...
101 101 */
102   -struct address_space_operations ncp_symlink_aops = {
  102 +const struct address_space_operations ncp_symlink_aops = {
103 103 .readpage = ncp_symlink_readpage,
104 104 };
105 105  
... ... @@ -315,7 +315,7 @@
315 315 return !nfs_wb_page(page->mapping->host, page);
316 316 }
317 317  
318   -struct address_space_operations nfs_file_aops = {
  318 +const struct address_space_operations nfs_file_aops = {
319 319 .readpage = nfs_readpage,
320 320 .readpages = nfs_readpages,
321 321 .set_page_dirty = __set_page_dirty_nobuffers,
... ... @@ -1544,7 +1544,7 @@
1544 1544 /**
1545 1545 * ntfs_aops - general address space operations for inodes and attributes
1546 1546 */
1547   -struct address_space_operations ntfs_aops = {
  1547 +const struct address_space_operations ntfs_aops = {
1548 1548 .readpage = ntfs_readpage, /* Fill page with data. */
1549 1549 .sync_page = block_sync_page, /* Currently, just unplugs the
1550 1550 disk request queue. */
... ... @@ -1560,7 +1560,7 @@
1560 1560 * ntfs_mst_aops - general address space operations for mst protecteed inodes
1561 1561 * and attributes
1562 1562 */
1563   -struct address_space_operations ntfs_mst_aops = {
  1563 +const struct address_space_operations ntfs_mst_aops = {
1564 1564 .readpage = ntfs_readpage, /* Fill page with data. */
1565 1565 .sync_page = block_sync_page, /* Currently, just unplugs the
1566 1566 disk request queue. */
... ... @@ -57,8 +57,8 @@
57 57 extern struct kmem_cache *ntfs_index_ctx_cache;
58 58  
59 59 /* The various operations structs defined throughout the driver files. */
60   -extern struct address_space_operations ntfs_aops;
61   -extern struct address_space_operations ntfs_mst_aops;
  60 +extern const struct address_space_operations ntfs_aops;
  61 +extern const struct address_space_operations ntfs_mst_aops;
62 62  
63 63 extern const struct file_operations ntfs_file_ops;
64 64 extern struct inode_operations ntfs_file_inode_ops;
... ... @@ -666,7 +666,7 @@
666 666 return ret;
667 667 }
668 668  
669   -struct address_space_operations ocfs2_aops = {
  669 +const struct address_space_operations ocfs2_aops = {
670 670 .readpage = ocfs2_readpage,
671 671 .writepage = ocfs2_writepage,
672 672 .prepare_write = ocfs2_prepare_write,
... ... @@ -114,7 +114,7 @@
114 114  
115 115 extern kmem_cache_t *ocfs2_inode_cache;
116 116  
117   -extern struct address_space_operations ocfs2_aops;
  117 +extern const struct address_space_operations ocfs2_aops;
118 118  
119 119 struct buffer_head *ocfs2_bread(struct inode *inode, int block,
120 120 int *err, int reada);
... ... @@ -450,7 +450,7 @@
450 450 {
451 451 return generic_block_bmap(mapping,block,qnx4_get_block);
452 452 }
453   -static struct address_space_operations qnx4_aops = {
  453 +static const struct address_space_operations qnx4_aops = {
454 454 .readpage = qnx4_readpage,
455 455 .writepage = qnx4_writepage,
456 456 .sync_page = block_sync_page,
... ... @@ -26,7 +26,7 @@
26 26  
27 27 #include <linux/fs.h>
28 28  
29   -struct address_space_operations ramfs_aops = {
  29 +const struct address_space_operations ramfs_aops = {
30 30 .readpage = simple_readpage,
31 31 .prepare_write = simple_prepare_write,
32 32 .commit_write = simple_commit_write
fs/ramfs/file-nommu.c
... ... @@ -27,7 +27,7 @@
27 27  
28 28 static int ramfs_nommu_setattr(struct dentry *, struct iattr *);
29 29  
30   -struct address_space_operations ramfs_aops = {
  30 +const struct address_space_operations ramfs_aops = {
31 31 .readpage = simple_readpage,
32 32 .prepare_write = simple_prepare_write,
33 33 .commit_write = simple_commit_write
... ... @@ -10,7 +10,7 @@
10 10 */
11 11  
12 12  
13   -extern struct address_space_operations ramfs_aops;
  13 +extern const struct address_space_operations ramfs_aops;
14 14 extern const struct file_operations ramfs_file_operations;
15 15 extern struct inode_operations ramfs_file_inode_operations;
... ... @@ -2996,7 +2996,7 @@
2996 2996 return error;
2997 2997 }
2998 2998  
2999   -struct address_space_operations reiserfs_address_space_operations = {
  2999 +const struct address_space_operations reiserfs_address_space_operations = {
3000 3000 .writepage = reiserfs_writepage,
3001 3001 .readpage = reiserfs_readpage,
3002 3002 .readpages = reiserfs_readpages,
... ... @@ -459,7 +459,7 @@
459 459  
460 460 /* Mapping from our types to the kernel */
461 461  
462   -static struct address_space_operations romfs_aops = {
  462 +static const struct address_space_operations romfs_aops = {
463 463 .readpage = romfs_readpage
464 464 };
465 465  
... ... @@ -306,7 +306,7 @@
306 306 return status;
307 307 }
308 308  
309   -struct address_space_operations smb_file_aops = {
  309 +const struct address_space_operations smb_file_aops = {
310 310 .readpage = smb_readpage,
311 311 .writepage = smb_writepage,
312 312 .prepare_write = smb_prepare_write,
... ... @@ -63,7 +63,7 @@
63 63 extern int smb_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat);
64 64 extern int smb_notify_change(struct dentry *dentry, struct iattr *attr);
65 65 /* file.c */
66   -extern struct address_space_operations smb_file_aops;
  66 +extern const struct address_space_operations smb_file_aops;
67 67 extern const struct file_operations smb_file_operations;
68 68 extern struct inode_operations smb_file_inode_operations;
69 69 /* ioctl.c */
... ... @@ -16,7 +16,7 @@
16 16  
17 17 extern struct super_block * sysfs_sb;
18 18  
19   -static struct address_space_operations sysfs_aops = {
  19 +static const struct address_space_operations sysfs_aops = {
20 20 .readpage = simple_readpage,
21 21 .prepare_write = simple_prepare_write,
22 22 .commit_write = simple_commit_write
... ... @@ -465,7 +465,7 @@
465 465 {
466 466 return generic_block_bmap(mapping,block,get_block);
467 467 }
468   -struct address_space_operations sysv_aops = {
  468 +const struct address_space_operations sysv_aops = {
469 469 .readpage = sysv_readpage,
470 470 .writepage = sysv_writepage,
471 471 .sync_page = block_sync_page,
... ... @@ -161,7 +161,7 @@
161 161 extern struct inode_operations sysv_fast_symlink_inode_operations;
162 162 extern const struct file_operations sysv_file_operations;
163 163 extern const struct file_operations sysv_dir_operations;
164   -extern struct address_space_operations sysv_aops;
  164 +extern const struct address_space_operations sysv_aops;
165 165 extern struct super_operations sysv_sops;
166 166 extern struct dentry_operations sysv_dentry_operations;
167 167  
... ... @@ -95,7 +95,7 @@
95 95 return 0;
96 96 }
97 97  
98   -struct address_space_operations udf_adinicb_aops = {
  98 +const struct address_space_operations udf_adinicb_aops = {
99 99 .readpage = udf_adinicb_readpage,
100 100 .writepage = udf_adinicb_writepage,
101 101 .sync_page = block_sync_page,
... ... @@ -132,7 +132,7 @@
132 132 return generic_block_bmap(mapping,block,udf_get_block);
133 133 }
134 134  
135   -struct address_space_operations udf_aops = {
  135 +const struct address_space_operations udf_aops = {
136 136 .readpage = udf_readpage,
137 137 .writepage = udf_writepage,
138 138 .sync_page = block_sync_page,
... ... @@ -113,7 +113,7 @@
113 113 /*
114 114 * symlinks can't do much...
115 115 */
116   -struct address_space_operations udf_symlink_aops = {
  116 +const struct address_space_operations udf_symlink_aops = {
117 117 .readpage = udf_symlink_filler,
118 118 };
... ... @@ -47,9 +47,9 @@
47 47 extern const struct file_operations udf_dir_operations;
48 48 extern struct inode_operations udf_file_inode_operations;
49 49 extern const struct file_operations udf_file_operations;
50   -extern struct address_space_operations udf_aops;
51   -extern struct address_space_operations udf_adinicb_aops;
52   -extern struct address_space_operations udf_symlink_aops;
  50 +extern const struct address_space_operations udf_aops;
  51 +extern const struct address_space_operations udf_adinicb_aops;
  52 +extern const struct address_space_operations udf_symlink_aops;
53 53  
54 54 struct udf_fileident_bh
55 55 {
... ... @@ -574,7 +574,7 @@
574 574 {
575 575 return generic_block_bmap(mapping,block,ufs_getfrag_block);
576 576 }
577   -struct address_space_operations ufs_aops = {
  577 +const struct address_space_operations ufs_aops = {
578 578 .readpage = ufs_readpage,
579 579 .writepage = ufs_writepage,
580 580 .sync_page = block_sync_page,
fs/xfs/linux-2.6/xfs_aops.c
... ... @@ -1454,7 +1454,7 @@
1454 1454 block_invalidatepage(page, offset);
1455 1455 }
1456 1456  
1457   -struct address_space_operations xfs_address_space_operations = {
  1457 +const struct address_space_operations xfs_address_space_operations = {
1458 1458 .readpage = xfs_vm_readpage,
1459 1459 .readpages = xfs_vm_readpages,
1460 1460 .writepage = xfs_vm_writepage,
fs/xfs/linux-2.6/xfs_aops.h
... ... @@ -40,7 +40,7 @@
40 40 struct work_struct io_work; /* xfsdatad work queue */
41 41 } xfs_ioend_t;
42 42  
43   -extern struct address_space_operations xfs_address_space_operations;
  43 +extern const struct address_space_operations xfs_address_space_operations;
44 44 extern int xfs_get_blocks(struct inode *, sector_t, struct buffer_head *, int);
45 45  
46 46 #endif /* __XFS_AOPS_H__ */
fs/xfs/linux-2.6/xfs_buf.c
... ... @@ -1520,7 +1520,7 @@
1520 1520 struct backing_dev_info *bdi;
1521 1521 struct inode *inode;
1522 1522 struct address_space *mapping;
1523   - static struct address_space_operations mapping_aops = {
  1523 + static const struct address_space_operations mapping_aops = {
1524 1524 .sync_page = block_sync_page,
1525 1525 .migratepage = fail_migrate_page,
1526 1526 };
include/linux/coda_linux.h
... ... @@ -27,8 +27,8 @@
27 27 extern struct inode_operations coda_file_inode_operations;
28 28 extern struct inode_operations coda_ioctl_inode_operations;
29 29  
30   -extern struct address_space_operations coda_file_aops;
31   -extern struct address_space_operations coda_symlink_aops;
  30 +extern const struct address_space_operations coda_file_aops;
  31 +extern const struct address_space_operations coda_symlink_aops;
32 32  
33 33 extern const struct file_operations coda_dir_operations;
34 34 extern const struct file_operations coda_file_operations;
include/linux/efs_fs.h
... ... @@ -38,7 +38,7 @@
38 38  
39 39 extern struct inode_operations efs_dir_inode_operations;
40 40 extern const struct file_operations efs_dir_operations;
41   -extern struct address_space_operations efs_symlink_aops;
  41 +extern const struct address_space_operations efs_symlink_aops;
42 42  
43 43 extern void efs_read_inode(struct inode *);
44 44 extern efs_block_t efs_map_block(struct inode *, efs_block_t);
... ... @@ -392,7 +392,7 @@
392 392 unsigned int truncate_count; /* Cover race condition with truncate */
393 393 unsigned long nrpages; /* number of total pages */
394 394 pgoff_t writeback_index;/* writeback starts here */
395   - struct address_space_operations *a_ops; /* methods */
  395 + const struct address_space_operations *a_ops; /* methods */
396 396 unsigned long flags; /* error bits/gfp mask */
397 397 struct backing_dev_info *backing_dev_info; /* device readahead, etc */
398 398 spinlock_t private_lock; /* for use by the address_space */
... ... @@ -1405,7 +1405,7 @@
1405 1405 extern void bdput(struct block_device *);
1406 1406 extern struct block_device *open_by_devnum(dev_t, unsigned);
1407 1407 extern const struct file_operations def_blk_fops;
1408   -extern struct address_space_operations def_blk_aops;
  1408 +extern const struct address_space_operations def_blk_aops;
1409 1409 extern const struct file_operations def_chr_fops;
1410 1410 extern const struct file_operations bad_sock_fops;
1411 1411 extern const struct file_operations def_fifo_fops;
include/linux/nfs_fs.h
... ... @@ -335,7 +335,7 @@
335 335 extern struct inode_operations nfs3_file_inode_operations;
336 336 #endif /* CONFIG_NFS_V3 */
337 337 extern const struct file_operations nfs_file_operations;
338   -extern struct address_space_operations nfs_file_aops;
  338 +extern const struct address_space_operations nfs_file_aops;
339 339  
340 340 static inline struct rpc_cred *nfs_file_cred(struct file *file)
341 341 {
include/linux/reiserfs_fs.h
... ... @@ -1973,7 +1973,7 @@
1973 1973 /* file.c */
1974 1974 extern struct inode_operations reiserfs_file_inode_operations;
1975 1975 extern const struct file_operations reiserfs_file_operations;
1976   -extern struct address_space_operations reiserfs_address_space_operations;
  1976 +extern const struct address_space_operations reiserfs_address_space_operations;
1977 1977  
1978 1978 /* fix_nodes.c */
1979 1979  
include/linux/ufs_fs.h
... ... @@ -966,7 +966,7 @@
966 966 extern struct inode_operations ufs_file_inode_operations;
967 967 extern const struct file_operations ufs_file_operations;
968 968  
969   -extern struct address_space_operations ufs_aops;
  969 +extern const struct address_space_operations ufs_aops;
970 970  
971 971 /* ialloc.c */
972 972 extern void ufs_free_inode (struct inode *inode);
... ... @@ -2069,7 +2069,7 @@
2069 2069 {
2070 2070 struct file *file = iocb->ki_filp;
2071 2071 struct address_space * mapping = file->f_mapping;
2072   - struct address_space_operations *a_ops = mapping->a_ops;
  2072 + const struct address_space_operations *a_ops = mapping->a_ops;
2073 2073 struct inode *inode = mapping->host;
2074 2074 long status = 0;
2075 2075 struct page *page;
... ... @@ -2219,7 +2219,7 @@
2219 2219 unsigned long nr_segs, loff_t *ppos)
2220 2220 {
2221 2221 struct file *file = iocb->ki_filp;
2222   - struct address_space * mapping = file->f_mapping;
  2222 + const struct address_space * mapping = file->f_mapping;
2223 2223 size_t ocount; /* original count */
2224 2224 size_t count; /* after file limit checks */
2225 2225 struct inode *inode = mapping->host;
... ... @@ -273,7 +273,7 @@
273 273 size_t count, loff_t pos, loff_t *ppos)
274 274 {
275 275 struct address_space * mapping = filp->f_mapping;
276   - struct address_space_operations *a_ops = mapping->a_ops;
  276 + const struct address_space_operations *a_ops = mapping->a_ops;
277 277 struct inode *inode = mapping->host;
278 278 long status = 0;
279 279 struct page *page;
... ... @@ -174,7 +174,7 @@
174 174 }
175 175  
176 176 static struct super_operations shmem_ops;
177   -static struct address_space_operations shmem_aops;
  177 +static const struct address_space_operations shmem_aops;
178 178 static struct file_operations shmem_file_operations;
179 179 static struct inode_operations shmem_inode_operations;
180 180 static struct inode_operations shmem_dir_inode_operations;
... ... @@ -2162,7 +2162,7 @@
2162 2162 printk(KERN_INFO "shmem_inode_cache: not all structures were freed\n");
2163 2163 }
2164 2164  
2165   -static struct address_space_operations shmem_aops = {
  2165 +static const struct address_space_operations shmem_aops = {
2166 2166 .writepage = shmem_writepage,
2167 2167 .set_page_dirty = __set_page_dirty_nobuffers,
2168 2168 #ifdef CONFIG_TMPFS
... ... @@ -24,7 +24,7 @@
24 24 * vmscan's shrink_list, to make sync_page look nicer, and to allow
25 25 * future use of radix_tree tags in the swap cache.
26 26 */
27   -static struct address_space_operations swap_aops = {
  27 +static const struct address_space_operations swap_aops = {
28 28 .writepage = swap_writepage,
29 29 .sync_page = block_sync_page,
30 30 .set_page_dirty = __set_page_dirty_nobuffers,