You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[PATCH] mark struct file_operations const 2
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. [akpm@osdl.org: sparc64 fix] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
540473208f
commit
5dfe4c964a
@@ -1711,7 +1711,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
|
||||
}
|
||||
|
||||
|
||||
static struct file_operations mixer_fops =
|
||||
static const struct file_operations mixer_fops =
|
||||
{
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = sound_lseek,
|
||||
@@ -2298,7 +2298,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
|
||||
|
||||
|
||||
|
||||
static struct file_operations sq_fops =
|
||||
static const struct file_operations sq_fops =
|
||||
{
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = sound_lseek,
|
||||
@@ -2433,7 +2433,7 @@ static ssize_t state_read(struct file *file, char *buf, size_t count,
|
||||
}
|
||||
|
||||
|
||||
static struct file_operations state_fops =
|
||||
static const struct file_operations state_fops =
|
||||
{
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = sound_lseek,
|
||||
|
||||
Reference in New Issue
Block a user