Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b6f5d20 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds
Browse files

[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: default avatarArjan van de Ven <arjan@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 99ac48f5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ static struct super_operations ibmasmfs_s_ops = {
	.drop_inode	= generic_delete_inode,
};

static struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;

static struct file_system_type ibmasmfs_type = {
	.owner          = THIS_MODULE,
+2 −2
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@

extern struct file_system_type v9fs_fs_type;
extern struct address_space_operations v9fs_addr_operations;
extern struct file_operations v9fs_file_operations;
extern struct file_operations v9fs_dir_operations;
extern const struct file_operations v9fs_file_operations;
extern const struct file_operations v9fs_dir_operations;
extern struct dentry_operations v9fs_dentry_operations;

struct inode *v9fs_get_inode(struct super_block *sb, int mode);
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
	return 0;
}

struct file_operations v9fs_dir_operations = {
const struct file_operations v9fs_dir_operations = {
	.read = generic_read_dir,
	.readdir = v9fs_dir_readdir,
	.open = v9fs_file_open,
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
	return total;
}

struct file_operations v9fs_file_operations = {
const struct file_operations v9fs_file_operations = {
	.llseek = generic_file_llseek,
	.read = v9fs_file_read,
	.write = v9fs_file_write,
+2 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ void __adfs_error(struct super_block *sb, const char *function,

/* dir_*.c */
extern struct inode_operations adfs_dir_inode_operations;
extern struct file_operations adfs_dir_operations;
extern const struct file_operations adfs_dir_operations;
extern struct dentry_operations adfs_dentry_operations;
extern struct adfs_dir_ops adfs_f_dir_ops;
extern struct adfs_dir_ops adfs_fplus_dir_ops;
@@ -94,7 +94,7 @@ extern int adfs_dir_update(struct super_block *sb, struct object_info *obj);

/* file.c */
extern struct inode_operations adfs_file_inode_operations;
extern struct file_operations adfs_file_operations;
extern const struct file_operations adfs_file_operations;

static inline __u32 signed_asl(__u32 val, signed int shift)
{
Loading