aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-06-28 07:26:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-28 17:59:04 -0400
commitf5e54d6e53a20cef45af7499e86164f0e0d16bb2 (patch)
treecb92acbb89b84796261bf5563182261ec5654127 /mm
parenta052b68b1e7a31f1e6a721290035e9deb0f6fed9 (diff)
[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>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c4
-rw-r--r--mm/filemap_xip.c2
-rw-r--r--mm/shmem.c4
-rw-r--r--mm/swap_state.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index d504d6e98886..4082b3b3cea7 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2069,7 +2069,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
2069{ 2069{
2070 struct file *file = iocb->ki_filp; 2070 struct file *file = iocb->ki_filp;
2071 struct address_space * mapping = file->f_mapping; 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 struct inode *inode = mapping->host; 2073 struct inode *inode = mapping->host;
2074 long status = 0; 2074 long status = 0;
2075 struct page *page; 2075 struct page *page;
@@ -2219,7 +2219,7 @@ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
2219 unsigned long nr_segs, loff_t *ppos) 2219 unsigned long nr_segs, loff_t *ppos)
2220{ 2220{
2221 struct file *file = iocb->ki_filp; 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 size_t ocount; /* original count */ 2223 size_t ocount; /* original count */
2224 size_t count; /* after file limit checks */ 2224 size_t count; /* after file limit checks */
2225 struct inode *inode = mapping->host; 2225 struct inode *inode = mapping->host;
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index b960ac8e5918..b4fd0d7c9bfb 100644
--- a/mm/filemap_xip.c
+++ b/mm/filemap_xip.c
@@ -273,7 +273,7 @@ __xip_file_write(struct file *filp, const char __user *buf,
273 size_t count, loff_t pos, loff_t *ppos) 273 size_t count, loff_t pos, loff_t *ppos)
274{ 274{
275 struct address_space * mapping = filp->f_mapping; 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 struct inode *inode = mapping->host; 277 struct inode *inode = mapping->host;
278 long status = 0; 278 long status = 0;
279 struct page *page; 279 struct page *page;
diff --git a/mm/shmem.c b/mm/shmem.c
index 38bc3334f263..ea64c07cbe72 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -174,7 +174,7 @@ static inline void shmem_unacct_blocks(unsigned long flags, long pages)
174} 174}
175 175
176static struct super_operations shmem_ops; 176static struct super_operations shmem_ops;
177static struct address_space_operations shmem_aops; 177static const struct address_space_operations shmem_aops;
178static struct file_operations shmem_file_operations; 178static struct file_operations shmem_file_operations;
179static struct inode_operations shmem_inode_operations; 179static struct inode_operations shmem_inode_operations;
180static struct inode_operations shmem_dir_inode_operations; 180static struct inode_operations shmem_dir_inode_operations;
@@ -2162,7 +2162,7 @@ static void destroy_inodecache(void)
2162 printk(KERN_INFO "shmem_inode_cache: not all structures were freed\n"); 2162 printk(KERN_INFO "shmem_inode_cache: not all structures were freed\n");
2163} 2163}
2164 2164
2165static struct address_space_operations shmem_aops = { 2165static const struct address_space_operations shmem_aops = {
2166 .writepage = shmem_writepage, 2166 .writepage = shmem_writepage,
2167 .set_page_dirty = __set_page_dirty_nobuffers, 2167 .set_page_dirty = __set_page_dirty_nobuffers,
2168#ifdef CONFIG_TMPFS 2168#ifdef CONFIG_TMPFS
diff --git a/mm/swap_state.c b/mm/swap_state.c
index e0e1583f32c2..7535211bb495 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -24,7 +24,7 @@
24 * vmscan's shrink_list, to make sync_page look nicer, and to allow 24 * vmscan's shrink_list, to make sync_page look nicer, and to allow
25 * future use of radix_tree tags in the swap cache. 25 * future use of radix_tree tags in the swap cache.
26 */ 26 */
27static struct address_space_operations swap_aops = { 27static const struct address_space_operations swap_aops = {
28 .writepage = swap_writepage, 28 .writepage = swap_writepage,
29 .sync_page = block_sync_page, 29 .sync_page = block_sync_page,
30 .set_page_dirty = __set_page_dirty_nobuffers, 30 .set_page_dirty = __set_page_dirty_nobuffers,