From 9c2e08c592cd357a8330c34def1e8ecfdcf53275 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:37 -0800 Subject: [PATCH] mark struct file_operations const 9 Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- security/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'security/inode.c') diff --git a/security/inode.c b/security/inode.c index 9b16e14f3a80..d7ecf89fbc74 100644 --- a/security/inode.c +++ b/security/inode.c @@ -50,7 +50,7 @@ static int default_open(struct inode *inode, struct file *file) return 0; } -static struct file_operations default_file_ops = { +static const struct file_operations default_file_ops = { .read = default_read_file, .write = default_write_file, .open = default_open, @@ -215,7 +215,7 @@ static int create_by_name(const char *name, mode_t mode, */ struct dentry *securityfs_create_file(const char *name, mode_t mode, struct dentry *parent, void *data, - struct file_operations *fops) + const struct file_operations *fops) { struct dentry *dentry = NULL; int error; -- cgit