diff options
author | Christoph Hellwig <hch@lst.de> | 2006-06-28 07:26:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-28 17:59:04 -0400 |
commit | f5e54d6e53a20cef45af7499e86164f0e0d16bb2 (patch) | |
tree | cb92acbb89b84796261bf5563182261ec5654127 /drivers | |
parent | a052b68b1e7a31f1e6a721290035e9deb0f6fed9 (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 'drivers')
-rw-r--r-- | drivers/block/loop.c | 4 | ||||
-rw-r--r-- | drivers/block/rd.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 3c74ea729fc7..18dd026f470d 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -210,7 +210,7 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec, | |||
210 | { | 210 | { |
211 | struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */ | 211 | struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */ |
212 | struct address_space *mapping = file->f_mapping; | 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 | pgoff_t index; | 214 | pgoff_t index; |
215 | unsigned offset, bv_offs; | 215 | unsigned offset, bv_offs; |
216 | int len, ret; | 216 | int len, ret; |
@@ -784,7 +784,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, | |||
784 | 784 | ||
785 | error = -EINVAL; | 785 | error = -EINVAL; |
786 | if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) { | 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 | * If we can't read - sorry. If we only can't write - well, | 789 | * If we can't read - sorry. If we only can't write - well, |
790 | * it's going to be read-only. | 790 | * it's going to be read-only. |
diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 940bfd7951e5..0378da04cfa2 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c | |||
@@ -191,7 +191,7 @@ static int ramdisk_set_page_dirty(struct page *page) | |||
191 | return 0; | 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 | .readpage = ramdisk_readpage, | 195 | .readpage = ramdisk_readpage, |
196 | .prepare_write = ramdisk_prepare_write, | 196 | .prepare_write = ramdisk_prepare_write, |
197 | .commit_write = ramdisk_commit_write, | 197 | .commit_write = ramdisk_commit_write, |