mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
99ac48f54a
commit
4b6f5d20b0
139 files changed
+225
-225
No files matched your search
@@ -384,7 +384,7 @@ int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync)
|
||||
return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync);
|
||||
}
|
||||
|
||||
static struct file_operations hostfs_file_fops = {
|
||||
static const struct file_operations hostfs_file_fops = {
|
||||
.llseek = generic_file_llseek,
|
||||
.read = generic_file_read,
|
||||
.sendfile = generic_file_sendfile,
|
||||
@@ -399,7 +399,7 @@ static struct file_operations hostfs_file_fops = {
|
||||
.fsync = hostfs_fsync,
|
||||
};
|
||||
|
||||
static struct file_operations hostfs_dir_fops = {
|
||||
static const struct file_operations hostfs_dir_fops = {
|
||||
.llseek = generic_file_llseek,
|
||||
.readdir = hostfs_readdir,
|
||||
.read = generic_read_dir,
|
||||
|
||||
Reference in new issue
Block a user