Commit f5e54d6e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds
Browse files

[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: default avatarChristoph Hellwig <hch@lst.de>
Cc: Steven French <sfrench@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a052b68b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec,
{
	struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
	struct address_space *mapping = file->f_mapping;
	struct address_space_operations *aops = mapping->a_ops;
	const struct address_space_operations *aops = mapping->a_ops;
	pgoff_t index;
	unsigned offset, bv_offs;
	int len, ret;
@@ -784,7 +784,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,

	error = -EINVAL;
	if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) {
		struct address_space_operations *aops = mapping->a_ops;
		const struct address_space_operations *aops = mapping->a_ops;
		/*
		 * If we can't read - sorry. If we only can't write - well,
		 * it's going to be read-only.
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static int ramdisk_set_page_dirty(struct page *page)
	return 0;
}

static struct address_space_operations ramdisk_aops = {
static const struct address_space_operations ramdisk_aops = {
	.readpage	= ramdisk_readpage,
	.prepare_write	= ramdisk_prepare_write,
	.commit_write	= ramdisk_commit_write,
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
 */

extern struct file_system_type v9fs_fs_type;
extern struct address_space_operations v9fs_addr_operations;
extern const struct address_space_operations v9fs_addr_operations;
extern const struct file_operations v9fs_file_operations;
extern const struct file_operations v9fs_dir_operations;
extern struct dentry_operations v9fs_dentry_operations;
+1 −1
Original line number Diff line number Diff line
@@ -103,6 +103,6 @@ static int v9fs_vfs_readpage(struct file *filp, struct page *page)
	return retval;
}

struct address_space_operations v9fs_addr_operations = {
const struct address_space_operations v9fs_addr_operations = {
      .readpage = v9fs_vfs_readpage,
};
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ static sector_t _adfs_bmap(struct address_space *mapping, sector_t block)
	return generic_block_bmap(mapping, block, adfs_get_block);
}

static struct address_space_operations adfs_aops = {
static const struct address_space_operations adfs_aops = {
	.readpage	= adfs_readpage,
	.writepage	= adfs_writepage,
	.sync_page	= block_sync_page,
Loading