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 6
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 <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
d54b1fdb1d
commit
00977a59b9
@@ -846,7 +846,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
|
||||
return errno;
|
||||
}
|
||||
|
||||
static struct file_operations bpp_fops = {
|
||||
static const struct file_operations bpp_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = bpp_read,
|
||||
.write = bpp_write,
|
||||
|
||||
@@ -459,7 +459,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct file_operations wd_fops = {
|
||||
static const struct file_operations wd_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = wd_ioctl,
|
||||
.compat_ioctl = wd_compat_ioctl,
|
||||
|
||||
@@ -166,7 +166,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
return error;
|
||||
}
|
||||
|
||||
static struct file_operations d7s_fops = {
|
||||
static const struct file_operations d7s_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.unlocked_ioctl = d7s_ioctl,
|
||||
.compat_ioctl = d7s_ioctl,
|
||||
|
||||
@@ -705,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations envctrl_fops = {
|
||||
static const struct file_operations envctrl_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = envctrl_read,
|
||||
.unlocked_ioctl = envctrl_ioctl,
|
||||
|
||||
@@ -142,7 +142,7 @@ flash_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations flash_fops = {
|
||||
static const struct file_operations flash_fops = {
|
||||
/* no write to the Flash, use mmap
|
||||
* and play flash dependent tricks.
|
||||
*/
|
||||
|
||||
@@ -431,7 +431,7 @@ static int jsf_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations jsf_fops = {
|
||||
static const struct file_operations jsf_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = jsf_lseek,
|
||||
.read = jsf_read,
|
||||
|
||||
@@ -704,7 +704,7 @@ static int openprom_release(struct inode * inode, struct file * file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations openprom_fops = {
|
||||
static const struct file_operations openprom_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.ioctl = openprom_ioctl,
|
||||
|
||||
@@ -193,7 +193,7 @@ static ssize_t riowd_write(struct file *file, const char __user *buf, size_t cou
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations riowd_fops = {
|
||||
static const struct file_operations riowd_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = riowd_ioctl,
|
||||
.open = riowd_open,
|
||||
|
||||
@@ -233,7 +233,7 @@ static int rtc_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations rtc_fops = {
|
||||
static const struct file_operations rtc_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.ioctl = rtc_ioctl,
|
||||
|
||||
@@ -224,7 +224,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct file_operations uctrl_fops = {
|
||||
static const struct file_operations uctrl_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.ioctl = uctrl_ioctl,
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "vfc.h"
|
||||
#include <asm/vfc_ioctls.h>
|
||||
|
||||
static struct file_operations vfc_fops;
|
||||
static const struct file_operations vfc_fops;
|
||||
struct vfc_dev **vfc_dev_lst;
|
||||
static char vfcstr[]="vfc";
|
||||
static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
|
||||
@@ -633,7 +633,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
}
|
||||
|
||||
|
||||
static struct file_operations vfc_fops = {
|
||||
static const struct file_operations vfc_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.ioctl = vfc_ioctl,
|
||||
|
||||
@@ -197,7 +197,7 @@ static struct class_device_attribute *twa_host_attrs[] = {
|
||||
};
|
||||
|
||||
/* File operations struct for character device */
|
||||
static struct file_operations twa_fops = {
|
||||
static const struct file_operations twa_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = twa_chrdev_ioctl,
|
||||
.open = twa_chrdev_open,
|
||||
|
||||
@@ -1040,7 +1040,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file)
|
||||
} /* End tw_chrdev_open() */
|
||||
|
||||
/* File operations struct for character device */
|
||||
static struct file_operations tw_fops = {
|
||||
static const struct file_operations tw_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = tw_chrdev_ioctl,
|
||||
.open = tw_chrdev_open,
|
||||
|
||||
@@ -774,7 +774,7 @@ static struct class_device_attribute *aac_attrs[] = {
|
||||
};
|
||||
|
||||
|
||||
static struct file_operations aac_cfg_fops = {
|
||||
static const struct file_operations aac_cfg_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = aac_cfg_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ static struct scsi_driver ch_template =
|
||||
},
|
||||
};
|
||||
|
||||
static struct file_operations changer_fops =
|
||||
static const struct file_operations changer_fops =
|
||||
{
|
||||
.owner = THIS_MODULE,
|
||||
.open = ch_open,
|
||||
|
||||
@@ -116,7 +116,7 @@ static int sys_tbl_len = 0;
|
||||
static adpt_hba* hba_chain = NULL;
|
||||
static int hba_count = 0;
|
||||
|
||||
static struct file_operations adpt_fops = {
|
||||
static const struct file_operations adpt_fops = {
|
||||
.ioctl = adpt_ioctl,
|
||||
.open = adpt_open,
|
||||
.release = adpt_close
|
||||
|
||||
+1
-1
@@ -687,7 +687,7 @@ MODULE_AUTHOR("Achim Leubner");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
/* ioctl interface */
|
||||
static struct file_operations gdth_fops = {
|
||||
static const struct file_operations gdth_fops = {
|
||||
.ioctl = gdth_ioctl,
|
||||
.open = gdth_open,
|
||||
.release = gdth_close,
|
||||
|
||||
@@ -92,7 +92,7 @@ static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
|
||||
/*
|
||||
* The File Operations structure for the serial/ioctl interface of the driver
|
||||
*/
|
||||
static struct file_operations megadev_fops = {
|
||||
static const struct file_operations megadev_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = megadev_ioctl,
|
||||
.open = megadev_open,
|
||||
|
||||
@@ -67,7 +67,7 @@ static struct list_head adapters_list_g;
|
||||
|
||||
static wait_queue_head_t wait_q;
|
||||
|
||||
static struct file_operations lsi_fops = {
|
||||
static const struct file_operations lsi_fops = {
|
||||
.open = mraid_mm_open,
|
||||
.ioctl = mraid_mm_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
@@ -2913,7 +2913,7 @@ megasas_mgmt_compat_ioctl(struct file *file, unsigned int cmd,
|
||||
/*
|
||||
* File operations structure for management interface
|
||||
*/
|
||||
static struct file_operations megasas_mgmt_fops = {
|
||||
static const struct file_operations megasas_mgmt_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = megasas_mgmt_open,
|
||||
.release = megasas_mgmt_release,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user