[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: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
99ac48f54a
commit
4b6f5d20b0
@@ -134,7 +134,7 @@ static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size
|
||||
return simple_transaction_read(file, buf, size, pos);
|
||||
}
|
||||
|
||||
static struct file_operations transaction_ops = {
|
||||
static const struct file_operations transaction_ops = {
|
||||
.write = nfsctl_transaction_write,
|
||||
.read = nfsctl_transaction_read,
|
||||
.release = simple_transaction_release,
|
||||
@@ -146,7 +146,7 @@ static int exports_open(struct inode *inode, struct file *file)
|
||||
return seq_open(file, &nfs_exports_op);
|
||||
}
|
||||
|
||||
static struct file_operations exports_operations = {
|
||||
static const struct file_operations exports_operations = {
|
||||
.open = exports_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
|
Reference in New Issue
Block a user