]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
[PATCH] mark struct file_operations const 6
authorArjan van de Ven <arjan@linux.intel.com>
Mon, 12 Feb 2007 08:55:34 +0000 (00:55 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:45 +0000 (09:48 -0800)
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>
45 files changed:
drivers/sbus/char/bpp.c
drivers/sbus/char/cpwatchdog.c
drivers/sbus/char/display7seg.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/jsflash.c
drivers/sbus/char/openprom.c
drivers/sbus/char/riowatchdog.c
drivers/sbus/char/rtc.c
drivers/sbus/char/uctrl.c
drivers/sbus/char/vfc_dev.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/aacraid/linit.c
drivers/scsi/ch.c
drivers/scsi/dpt_i2o.c
drivers/scsi/gdth.c
drivers/scsi/megaraid.c
drivers/scsi/megaraid/megaraid_mm.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/osst.c
drivers/scsi/scsi_proc.c
drivers/scsi/scsi_tgt_if.c
drivers/scsi/st.c
drivers/telephony/ixj.c
drivers/telephony/phonedev.c
drivers/usb/misc/adutux.c
drivers/usb/misc/ftdi-elan.c
drivers/video/mbx/mbxdebugfs.c
drivers/zorro/proc.c
fs/debugfs/file.c
fs/dlm/debug_fs.c
fs/dlm/user.c
fs/gfs2/locking/dlm/plock.c
fs/nfs/client.c
fs/ocfs2/dlm/dlmfs.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/internal.h
fs/proc/nommu.c
fs/proc/proc_misc.c
fs/proc/proc_tty.c
fs/proc/root.c
fs/proc/task_mmu.c
fs/proc/task_nommu.c

index ac7d1258efee13610244b8e7a81feaf4a0348c7f..a39ee80c9715749b7a1089fa99260128557fe8e9 100644 (file)
@@ -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,
index ad1c7db96cb4d8eb7bc38f561ff5535f3dd168c7..0cfd1e4c032c479c3ac7c5be5122e0195c4e45d9 100644 (file)
@@ -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,
index a4909e0c7f83877d435869735fa8ecffd30d3808..2d14a29effe4783645c520014d2f85fcb7897401 100644 (file)
@@ -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,
index fff4660cdf96e34880f7242d0fdecc588c05536a..2cea4f5d2084b13f85da8114ef554ced2c47b5d9 100644 (file)
@@ -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,
index fa2418f7ad393c78af158a4540fa80cf6213d297..6e99507aeb12c23fba03c52a56697f58d0d216c9 100644 (file)
@@ -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.
         */
index 14631ac11bc7744e95b0276eee662671ca5a522a..512857a23169b4645e1228b7fb46159015cc72df 100644 (file)
@@ -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,
index 4e2a0e2dcc2e9da9bdde64f2582588694d06f22f..e8776230782b28669606da71a427e591497142ed 100644 (file)
@@ -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,
index 2a9cc82044292d074b5b3a35d3e8d86f06a43587..a2fc6b8c1334a830dc2808cdc32b8beefd42fbe2 100644 (file)
@@ -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,
index 9b988baf0b5191304ca00ac042851b055f002bd7..94d185829119bcd7e85a18b4cffd55d4046b4321 100644 (file)
@@ -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,
index b30372f17f1cb94d9ee924d79ff49ac4b78e4a31..4d1a505e9e74e0bfe090fa557656dce8796ff178 100644 (file)
@@ -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,
index 386e7de0b7e3c47a38efdda9ed01def8fc6839d6..37a04a0cecfa9449cdc6e1547e77a97eafa9d90c 100644 (file)
@@ -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,
index b091a0fc4eb09fba778206bb9fa53890c524f54f..eb766c3af1c816f30b61c43c0e30a9914c1160c5 100644 (file)
@@ -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,
index e1b44d6c0c32e52e3741b10606573facd6d2d938..bf5d63e1beeeb441ff2f4a82dae2813ef5502964 100644 (file)
@@ -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,
index a9734e08fe28a7cf35d01727a0ab509c0aff7da3..0f948c2fb6097a7585e8b144699fca5799ed3659 100644 (file)
@@ -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
index f6caa43077680b3a87d1621e3006f40883a1eb35..d02759f1346988245509e0bdb64afc92ba952e1b 100644 (file)
@@ -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,
index 365db537a28da81ddee1d7a1403a50ddc02a0383..cd36e81b2d9348223847dea27dd37c61cf6b7dd0 100644 (file)
@@ -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
index 4c698a71f66ff0b54c6dda5c3859f3b96ff04331..a1992928e6710ec4ff4dc2a0ab5f93a10b4e7bfa 100644 (file)
@@ -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,
index 77d9d3804ccfd02094a4aba9054081c233ed8427..808a1b8c40431946982847dd446223e396f87b8d 100644 (file)
@@ -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,
index c1ff20c4747d960351561c8a954f46ece69cd94c..f33a678f0897d749788ec7e2ed35e742019f1c18 100644 (file)
@@ -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
index b5bdd0d7a8bf09b508c361713d1bf4ff2526de6b..15e24fcc84f3b871f9f69c0621419ea91d61e60c 100644 (file)
@@ -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,
index bd6bbf61adb8e082ed99a6407e232531677df892..9668b73872c785e419e656919abc5bdc5424a2a3 100644 (file)
@@ -5522,7 +5522,7 @@ __setup("osst=", osst_setup);
 
 #endif
 
-static struct file_operations osst_fops = {
+static const struct file_operations osst_fops = {
        .owner =        THIS_MODULE,
        .read =         osst_read,
        .write =        osst_write,
index 524a5f7a5193d0a0275120bf5743196c78153a26..69d6e9b198c42fa6aceb7ebace35e19f305deffc 100644 (file)
@@ -308,7 +308,7 @@ static int proc_scsi_open(struct inode *inode, struct file *file)
        return single_open(file, proc_scsi_show, NULL);
 }
 
-static struct file_operations proc_scsi_operations = {
+static const struct file_operations proc_scsi_operations = {
        .open           = proc_scsi_open,
        .read           = seq_read,
        .write          = proc_scsi_write,
index 37bbfbdb870f7adbffb9f688d02898db14c8f2ef..f2344ab8deff882b3dc00f20351626562c0085f3 100644 (file)
@@ -280,7 +280,7 @@ static int tgt_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations tgt_fops = {
+static const struct file_operations tgt_fops = {
        .owner          = THIS_MODULE,
        .open           = tgt_open,
        .poll           = tgt_poll,
index 16e279be4a3e17dd4422192ffa473b9b285d15a1..3d2e02381e92257618050314a2e358957e204221 100644 (file)
@@ -3864,7 +3864,7 @@ __setup("st=", st_setup);
 
 #endif
 
-static struct file_operations st_fops =
+static const struct file_operations st_fops =
 {
        .owner =        THIS_MODULE,
        .read =         st_read,
index 58deaac5b373ef654c65adc9dae0c345f7598dc7..71cb64e41a1bb6721e47c63de681af7baa0655cf 100644 (file)
@@ -6663,7 +6663,7 @@ static int ixj_fasync(int fd, struct file *file_p, int mode)
        return fasync_helper(fd, file_p, mode, &j->async_queue);
 }
 
-static struct file_operations ixj_fops =
+static const struct file_operations ixj_fops =
 {
         .owner          = THIS_MODULE,
         .read           = ixj_enhanced_read,
index e41f49afd0f4792dfe8e3b0290b398590a90d886..4d8c2a5b3297fdb2447f764ac8f5974277d936fd 100644 (file)
@@ -127,7 +127,7 @@ void phone_unregister_device(struct phone_device *pfd)
 }
 
 
-static struct file_operations phone_fops =
+static const struct file_operations phone_fops =
 {
        .owner          = THIS_MODULE,
        .open           = phone_open,
index af2934e016a7e76313816ba480e81a060de5a4b4..75bfab95ab3c4b1a1478c16ac6f0f921ab1663e5 100644 (file)
@@ -644,7 +644,7 @@ exit:
 }
 
 /* file operations needed when we register this driver */
-static struct file_operations adu_fops = {
+static const struct file_operations adu_fops = {
        .owner = THIS_MODULE,
        .read  = adu_read,
        .write = adu_write,
index 41c0161abdb9eb0dc18ab216b4da10fd40e87001..0c1d66ddb8125fcc04461fd51be5cb4bac89778c 100644 (file)
@@ -1209,7 +1209,7 @@ error_1:
        return retval;
 }
 
-static struct file_operations ftdi_elan_fops = {
+static const struct file_operations ftdi_elan_fops = {
         .owner = THIS_MODULE,
         .llseek = no_llseek,
         .ioctl = ftdi_elan_ioctl,
index 472a3ca3d92d18af8826310609172d459ef704bf..15b8b3c4330ec3b3aca5813a985ef87101dcb295 100644 (file)
@@ -170,37 +170,37 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf,
 }
 
 
-static struct file_operations sysconf_fops = {
+static const struct file_operations sysconf_fops = {
        .read = sysconf_read_file,
        .write = write_file_dummy,
        .open = open_file_generic,
 };
 
-static struct file_operations clock_fops = {
+static const struct file_operations clock_fops = {
        .read = clock_read_file,
        .write = write_file_dummy,
        .open = open_file_generic,
 };
 
-static struct file_operations display_fops = {
+static const struct file_operations display_fops = {
        .read = display_read_file,
        .write = write_file_dummy,
        .open = open_file_generic,
 };
 
-static struct file_operations gsctl_fops = {
+static const struct file_operations gsctl_fops = {
        .read = gsctl_read_file,
        .write = write_file_dummy,
        .open = open_file_generic,
 };
 
-static struct file_operations sdram_fops = {
+static const struct file_operations sdram_fops = {
        .read = sdram_read_file,
        .write = write_file_dummy,
        .open = open_file_generic,
 };
 
-static struct file_operations misc_fops = {
+static const struct file_operations misc_fops = {
        .read = misc_read_file,
        .write = write_file_dummy,
        .open = open_file_generic,
index 60b05bc1564254ab49af9c6b284d96888828e7bb..b3ce8859a586e58a6beb69b5aaa6fa4a86b7e288 100644 (file)
@@ -75,7 +75,7 @@ proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *
        return nbytes;
 }
 
-static struct file_operations proc_bus_zorro_operations = {
+static const struct file_operations proc_bus_zorro_operations = {
        .llseek         = proc_bus_zorro_lseek,
        .read           = proc_bus_zorro_read,
 };
index bf3901ab1744b25355ca54ea82deb578f8aeffc0..8d130cc8532248893f2bf5e9af3cf152ad08d3b5 100644 (file)
@@ -254,7 +254,7 @@ static ssize_t read_file_blob(struct file *file, char __user *user_buf,
                        blob->size);
 }
 
-static struct file_operations fops_blob = {
+static const struct file_operations fops_blob = {
        .read =         read_file_blob,
        .open =         default_open,
 };
index ca94a837a5bba1d92b0478ecfced67c2538aab89..61ba670b9e025fde7f8cedb28fd96ceee483de67 100644 (file)
@@ -287,7 +287,7 @@ static int rsb_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations rsb_fops = {
+static const struct file_operations rsb_fops = {
        .owner   = THIS_MODULE,
        .open    = rsb_open,
        .read    = seq_read,
@@ -331,7 +331,7 @@ static ssize_t waiters_read(struct file *file, char __user *userbuf,
        return rv;
 }
 
-static struct file_operations waiters_fops = {
+static const struct file_operations waiters_fops = {
        .owner   = THIS_MODULE,
        .open    = waiters_open,
        .read    = waiters_read
index d378b7fe2a1ea6d4dc7846a6e95e46dff051f8b0..40db61dc95f2550f09d592bcd2b2e751fca85291 100644 (file)
@@ -25,7 +25,7 @@
 
 static const char *name_prefix="dlm";
 static struct miscdevice ctl_device;
-static struct file_operations device_fops;
+static const struct file_operations device_fops;
 
 #ifdef CONFIG_COMPAT
 
@@ -759,7 +759,7 @@ static int ctl_device_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations device_fops = {
+static const struct file_operations device_fops = {
        .open    = device_open,
        .release = device_close,
        .read    = device_read,
@@ -768,7 +768,7 @@ static struct file_operations device_fops = {
        .owner   = THIS_MODULE,
 };
 
-static struct file_operations ctl_device_fops = {
+static const struct file_operations ctl_device_fops = {
        .open    = ctl_device_open,
        .release = ctl_device_close,
        .write   = device_write,
index 3799f19b282f06b422ecff9cc9b02b37acdd00dc..1dd4215b83d02133592033949bced668548102cc 100644 (file)
@@ -264,7 +264,7 @@ static unsigned int dev_poll(struct file *file, poll_table *wait)
        return 0;
 }
 
-static struct file_operations dev_fops = {
+static const struct file_operations dev_fops = {
        .read    = dev_read,
        .write   = dev_write,
        .poll    = dev_poll,
index 23ab145daa2d2289cd6721457b3f555a9d16cbaf..ae9f36e393cf0a857064bdff9809d13226eb4905 100644 (file)
@@ -1173,7 +1173,7 @@ static struct seq_operations nfs_server_list_ops = {
        .show   = nfs_server_list_show,
 };
 
-static struct file_operations nfs_server_list_fops = {
+static const struct file_operations nfs_server_list_fops = {
        .open           = nfs_server_list_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -1193,7 +1193,7 @@ static struct seq_operations nfs_volume_list_ops = {
        .show   = nfs_volume_list_show,
 };
 
-static struct file_operations nfs_volume_list_fops = {
+static const struct file_operations nfs_volume_list_fops = {
        .open           = nfs_volume_list_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index b7f0ba97a1a2ff6acc8d7a76659704838073b0d6..30826242bf51463027724acd9550bff8301cc4e1 100644 (file)
@@ -62,7 +62,7 @@
 #include "cluster/masklog.h"
 
 static struct super_operations dlmfs_ops;
-static struct file_operations dlmfs_file_operations;
+static const struct file_operations dlmfs_file_operations;
 static struct inode_operations dlmfs_dir_inode_operations;
 static struct inode_operations dlmfs_root_inode_operations;
 static struct inode_operations dlmfs_file_inode_operations;
@@ -540,7 +540,7 @@ static int dlmfs_fill_super(struct super_block * sb,
        return 0;
 }
 
-static struct file_operations dlmfs_file_operations = {
+static const struct file_operations dlmfs_file_operations = {
        .open           = dlmfs_file_open,
        .release        = dlmfs_file_release,
        .read           = dlmfs_file_read,
index 7fb37d6f2864859b82cb12062706f462af00ec28..7b1ded63fa63b494f904b65840449c82fb5f20d8 100644 (file)
@@ -94,7 +94,7 @@ struct pid_entry {
        char *name;
        mode_t mode;
        struct inode_operations *iop;
-       struct file_operations *fop;
+       const struct file_operations *fop;
        union proc_op op;
 };
 
@@ -424,7 +424,7 @@ static unsigned mounts_poll(struct file *file, poll_table *wait)
        return res;
 }
 
-static struct file_operations proc_mounts_operations = {
+static const struct file_operations proc_mounts_operations = {
        .open           = mounts_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -462,7 +462,7 @@ static int mountstats_open(struct inode *inode, struct file *file)
        return ret;
 }
 
-static struct file_operations proc_mountstats_operations = {
+static const struct file_operations proc_mountstats_operations = {
        .open           = mountstats_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -501,7 +501,7 @@ out_no_task:
        return length;
 }
 
-static struct file_operations proc_info_file_operations = {
+static const struct file_operations proc_info_file_operations = {
        .read           = proc_info_read,
 };
 
@@ -646,7 +646,7 @@ static loff_t mem_lseek(struct file * file, loff_t offset, int orig)
        return file->f_pos;
 }
 
-static struct file_operations proc_mem_operations = {
+static const struct file_operations proc_mem_operations = {
        .llseek         = mem_lseek,
        .read           = mem_read,
        .write          = mem_write,
@@ -710,7 +710,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
        return end - buffer;
 }
 
-static struct file_operations proc_oom_adjust_operations = {
+static const struct file_operations proc_oom_adjust_operations = {
        .read           = oom_adjust_read,
        .write          = oom_adjust_write,
 };
@@ -777,7 +777,7 @@ out_free_page:
        return length;
 }
 
-static struct file_operations proc_loginuid_operations = {
+static const struct file_operations proc_loginuid_operations = {
        .read           = proc_loginuid_read,
        .write          = proc_loginuid_write,
 };
@@ -849,7 +849,7 @@ out_no_task:
        return result;
 }
 
-static struct file_operations proc_seccomp_operations = {
+static const struct file_operations proc_seccomp_operations = {
        .read           = seccomp_read,
        .write          = seccomp_write,
 };
@@ -908,7 +908,7 @@ static ssize_t proc_fault_inject_write(struct file * file,
        return end - buffer;
 }
 
-static struct file_operations proc_fault_inject_operations = {
+static const struct file_operations proc_fault_inject_operations = {
        .read           = proc_fault_inject_read,
        .write          = proc_fault_inject_write,
 };
@@ -1408,7 +1408,7 @@ out_no_task:
        return retval;
 }
 
-static struct file_operations proc_fd_operations = {
+static const struct file_operations proc_fd_operations = {
        .read           = generic_read_dir,
        .readdir        = proc_readfd,
 };
@@ -1623,7 +1623,7 @@ out_no_task:
        return length;
 }
 
-static struct file_operations proc_pid_attr_operations = {
+static const struct file_operations proc_pid_attr_operations = {
        .read           = proc_pid_attr_read,
        .write          = proc_pid_attr_write,
 };
@@ -1644,7 +1644,7 @@ static int proc_attr_dir_readdir(struct file * filp,
                                   attr_dir_stuff,ARRAY_SIZE(attr_dir_stuff));
 }
 
-static struct file_operations proc_attr_dir_operations = {
+static const struct file_operations proc_attr_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = proc_attr_dir_readdir,
 };
@@ -1834,7 +1834,7 @@ static int proc_pid_io_accounting(struct task_struct *task, char *buffer)
 /*
  * Thread groups
  */
-static struct file_operations proc_task_operations;
+static const struct file_operations proc_task_operations;
 static struct inode_operations proc_task_inode_operations;
 
 static struct pid_entry tgid_base_stuff[] = {
@@ -1894,7 +1894,7 @@ static int proc_tgid_base_readdir(struct file * filp,
                                   tgid_base_stuff,ARRAY_SIZE(tgid_base_stuff));
 }
 
-static struct file_operations proc_tgid_base_operations = {
+static const struct file_operations proc_tgid_base_operations = {
        .read           = generic_read_dir,
        .readdir        = proc_tgid_base_readdir,
 };
@@ -2177,7 +2177,7 @@ static struct dentry *proc_tid_base_lookup(struct inode *dir, struct dentry *den
                                  tid_base_stuff, ARRAY_SIZE(tid_base_stuff));
 }
 
-static struct file_operations proc_tid_base_operations = {
+static const struct file_operations proc_tid_base_operations = {
        .read           = generic_read_dir,
        .readdir        = proc_tid_base_readdir,
 };
@@ -2414,7 +2414,7 @@ static struct inode_operations proc_task_inode_operations = {
        .setattr        = proc_setattr,
 };
 
-static struct file_operations proc_task_operations = {
+static const struct file_operations proc_task_operations = {
        .read           = generic_read_dir,
        .readdir        = proc_task_readdir,
 };
index 853cb877d5f3e42b2c617f972a6292bc03912ee8..aa52f1080e626ccbfda328707cdf70d3301124ba 100644 (file)
@@ -39,7 +39,7 @@ int proc_match(int len, const char *name, struct proc_dir_entry *de)
        return !memcmp(name, de->name, len);
 }
 
-static struct file_operations proc_file_operations = {
+static const struct file_operations proc_file_operations = {
        .llseek         = proc_file_lseek,
        .read           = proc_file_read,
        .write          = proc_file_write,
@@ -497,7 +497,7 @@ out:        unlock_kernel();
  * use the in-memory "struct proc_dir_entry" tree to parse
  * the /proc directory.
  */
-static struct file_operations proc_dir_operations = {
+static const struct file_operations proc_dir_operations = {
        .read                   = generic_read_dir,
        .readdir                = proc_readdir,
 };
index 987c773dbb20a04f002ac03ae5f8ee522ba57cce..277dcd66ebe20eab6d87d1f99ab2b21aab8ddcf9 100644 (file)
@@ -38,13 +38,13 @@ extern int proc_tgid_stat(struct task_struct *, char *);
 extern int proc_pid_status(struct task_struct *, char *);
 extern int proc_pid_statm(struct task_struct *, char *);
 
-extern struct file_operations proc_maps_operations;
-extern struct file_operations proc_numa_maps_operations;
-extern struct file_operations proc_smaps_operations;
+extern const struct file_operations proc_maps_operations;
+extern const struct file_operations proc_numa_maps_operations;
+extern const struct file_operations proc_smaps_operations;
 
-extern struct file_operations proc_maps_operations;
-extern struct file_operations proc_numa_maps_operations;
-extern struct file_operations proc_smaps_operations;
+extern const struct file_operations proc_maps_operations;
+extern const struct file_operations proc_numa_maps_operations;
+extern const struct file_operations proc_smaps_operations;
 
 
 void free_proc_entry(struct proc_dir_entry *de);
index 5ec67257e5f92426e94f41c40f1d42a36692583a..22f789de390941797102693a7a80c635a7f381ce 100644 (file)
@@ -128,7 +128,7 @@ static int proc_nommu_vma_list_open(struct inode *inode, struct file *file)
        return seq_open(file, &proc_nommu_vma_list_seqop);
 }
 
-static struct file_operations proc_nommu_vma_list_operations = {
+static const struct file_operations proc_nommu_vma_list_operations = {
        .open    = proc_nommu_vma_list_open,
        .read    = seq_read,
        .llseek  = seq_lseek,
index 5e2d4359c2927b6ad851a6607f5c955eec64d8ae..e2c4c0a5c90d40ff8ac2d28715956a8cbf65dd6c 100644 (file)
@@ -223,7 +223,7 @@ static int fragmentation_open(struct inode *inode, struct file *file)
        return seq_open(file, &fragmentation_op);
 }
 
-static struct file_operations fragmentation_file_operations = {
+static const struct file_operations fragmentation_file_operations = {
        .open           = fragmentation_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -236,7 +236,7 @@ static int zoneinfo_open(struct inode *inode, struct file *file)
        return seq_open(file, &zoneinfo_op);
 }
 
-static struct file_operations proc_zoneinfo_file_operations = {
+static const struct file_operations proc_zoneinfo_file_operations = {
        .open           = zoneinfo_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -261,7 +261,7 @@ static int cpuinfo_open(struct inode *inode, struct file *file)
        return seq_open(file, &cpuinfo_op);
 }
 
-static struct file_operations proc_cpuinfo_operations = {
+static const struct file_operations proc_cpuinfo_operations = {
        .open           = cpuinfo_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -320,7 +320,7 @@ static int devinfo_open(struct inode *inode, struct file *filp)
        return seq_open(filp, &devinfo_ops);
 }
 
-static struct file_operations proc_devinfo_operations = {
+static const struct file_operations proc_devinfo_operations = {
        .open           = devinfo_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -332,7 +332,7 @@ static int vmstat_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &vmstat_op);
 }
-static struct file_operations proc_vmstat_file_operations = {
+static const struct file_operations proc_vmstat_file_operations = {
        .open           = vmstat_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -363,7 +363,7 @@ static int partitions_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &partitions_op);
 }
-static struct file_operations proc_partitions_operations = {
+static const struct file_operations proc_partitions_operations = {
        .open           = partitions_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -375,7 +375,7 @@ static int diskstats_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &diskstats_op);
 }
-static struct file_operations proc_diskstats_operations = {
+static const struct file_operations proc_diskstats_operations = {
        .open           = diskstats_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -389,7 +389,7 @@ static int modules_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &modules_op);
 }
-static struct file_operations proc_modules_operations = {
+static const struct file_operations proc_modules_operations = {
        .open           = modules_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -404,7 +404,7 @@ static int slabinfo_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &slabinfo_op);
 }
-static struct file_operations proc_slabinfo_operations = {
+static const struct file_operations proc_slabinfo_operations = {
        .open           = slabinfo_open,
        .read           = seq_read,
        .write          = slabinfo_write,
@@ -438,7 +438,7 @@ static int slabstats_release(struct inode *inode, struct file *file)
        return seq_release(inode, file);
 }
 
-static struct file_operations proc_slabstats_operations = {
+static const struct file_operations proc_slabstats_operations = {
        .open           = slabstats_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -551,7 +551,7 @@ static int stat_open(struct inode *inode, struct file *file)
                kfree(buf);
        return res;
 }
-static struct file_operations proc_stat_operations = {
+static const struct file_operations proc_stat_operations = {
        .open           = stat_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -593,7 +593,7 @@ static int interrupts_open(struct inode *inode, struct file *filp)
        return seq_open(filp, &int_seq_ops);
 }
 
-static struct file_operations proc_interrupts_operations = {
+static const struct file_operations proc_interrupts_operations = {
        .open           = interrupts_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -650,7 +650,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
        return count;
 }
 
-static struct file_operations proc_sysrq_trigger_operations = {
+static const struct file_operations proc_sysrq_trigger_operations = {
        .write          = write_sysrq_trigger,
 };
 #endif
index 15c4455b09eb33200adcc2c6984123fd7592083d..c1bbfbeb035e4e5b72a9eb64a1bdb507496b93ce 100644 (file)
@@ -138,7 +138,7 @@ static int tty_drivers_open(struct inode *inode, struct file *file)
        return seq_open(file, &tty_drivers_op);
 }
 
-static struct file_operations proc_tty_drivers_operations = {
+static const struct file_operations proc_tty_drivers_operations = {
        .open           = tty_drivers_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 64d242b6dcfac60e2aa16b24f85f2d2dbb239836..81c92e967a98b27f915631882f9c5d341a234a1d 100644 (file)
@@ -136,7 +136,7 @@ static int proc_root_readdir(struct file * filp,
  * <pid> directories. Thus we don't use the generic
  * directory handling functions for that..
  */
-static struct file_operations proc_root_operations = {
+static const struct file_operations proc_root_operations = {
        .read            = generic_read_dir,
        .readdir         = proc_root_readdir,
 };
index 55ade0d1562160000060c0b35b860b6ff018229a..7445980c8022fa10fd1371a5ecd3be4720cbe7bf 100644 (file)
@@ -434,7 +434,7 @@ static int maps_open(struct inode *inode, struct file *file)
        return do_maps_open(inode, file, &proc_pid_maps_op);
 }
 
-struct file_operations proc_maps_operations = {
+const struct file_operations proc_maps_operations = {
        .open           = maps_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -456,7 +456,7 @@ static int numa_maps_open(struct inode *inode, struct file *file)
        return do_maps_open(inode, file, &proc_pid_numa_maps_op);
 }
 
-struct file_operations proc_numa_maps_operations = {
+const struct file_operations proc_numa_maps_operations = {
        .open           = numa_maps_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -469,7 +469,7 @@ static int smaps_open(struct inode *inode, struct file *file)
        return do_maps_open(inode, file, &proc_pid_smaps_op);
 }
 
-struct file_operations proc_smaps_operations = {
+const struct file_operations proc_smaps_operations = {
        .open           = smaps_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index fcc5caf93f554594aa3a9873abef5c22b67abfa6..7cddf6b8635aa612362042e4b3609a270a61555c 100644 (file)
@@ -220,7 +220,7 @@ static int maps_open(struct inode *inode, struct file *file)
        return ret;
 }
 
-struct file_operations proc_maps_operations = {
+const struct file_operations proc_maps_operations = {
        .open           = maps_open,
        .read           = seq_read,
        .llseek         = seq_lseek,