Commit 00977a59b951207d38380c75f03a36829950265c

Authored by Arjan van de Ven
Committed by Linus Torvalds
1 parent d54b1fdb1d

[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>

Showing 45 changed files with 91 additions and 91 deletions Side-by-side Diff

drivers/sbus/char/bpp.c
... ... @@ -846,7 +846,7 @@
846 846 return errno;
847 847 }
848 848  
849   -static struct file_operations bpp_fops = {
  849 +static const struct file_operations bpp_fops = {
850 850 .owner = THIS_MODULE,
851 851 .read = bpp_read,
852 852 .write = bpp_write,
drivers/sbus/char/cpwatchdog.c
... ... @@ -459,7 +459,7 @@
459 459 return IRQ_HANDLED;
460 460 }
461 461  
462   -static struct file_operations wd_fops = {
  462 +static const struct file_operations wd_fops = {
463 463 .owner = THIS_MODULE,
464 464 .ioctl = wd_ioctl,
465 465 .compat_ioctl = wd_compat_ioctl,
drivers/sbus/char/display7seg.c
... ... @@ -166,7 +166,7 @@
166 166 return error;
167 167 }
168 168  
169   -static struct file_operations d7s_fops = {
  169 +static const struct file_operations d7s_fops = {
170 170 .owner = THIS_MODULE,
171 171 .unlocked_ioctl = d7s_ioctl,
172 172 .compat_ioctl = d7s_ioctl,
drivers/sbus/char/envctrl.c
... ... @@ -705,7 +705,7 @@
705 705 return 0;
706 706 }
707 707  
708   -static struct file_operations envctrl_fops = {
  708 +static const struct file_operations envctrl_fops = {
709 709 .owner = THIS_MODULE,
710 710 .read = envctrl_read,
711 711 .unlocked_ioctl = envctrl_ioctl,
drivers/sbus/char/flash.c
... ... @@ -142,7 +142,7 @@
142 142 return 0;
143 143 }
144 144  
145   -static struct file_operations flash_fops = {
  145 +static const struct file_operations flash_fops = {
146 146 /* no write to the Flash, use mmap
147 147 * and play flash dependent tricks.
148 148 */
drivers/sbus/char/jsflash.c
... ... @@ -431,7 +431,7 @@
431 431 return 0;
432 432 }
433 433  
434   -static struct file_operations jsf_fops = {
  434 +static const struct file_operations jsf_fops = {
435 435 .owner = THIS_MODULE,
436 436 .llseek = jsf_lseek,
437 437 .read = jsf_read,
drivers/sbus/char/openprom.c
... ... @@ -704,7 +704,7 @@
704 704 return 0;
705 705 }
706 706  
707   -static struct file_operations openprom_fops = {
  707 +static const struct file_operations openprom_fops = {
708 708 .owner = THIS_MODULE,
709 709 .llseek = no_llseek,
710 710 .ioctl = openprom_ioctl,
drivers/sbus/char/riowatchdog.c
... ... @@ -193,7 +193,7 @@
193 193 return 0;
194 194 }
195 195  
196   -static struct file_operations riowd_fops = {
  196 +static const struct file_operations riowd_fops = {
197 197 .owner = THIS_MODULE,
198 198 .ioctl = riowd_ioctl,
199 199 .open = riowd_open,
drivers/sbus/char/rtc.c
... ... @@ -233,7 +233,7 @@
233 233 return 0;
234 234 }
235 235  
236   -static struct file_operations rtc_fops = {
  236 +static const struct file_operations rtc_fops = {
237 237 .owner = THIS_MODULE,
238 238 .llseek = no_llseek,
239 239 .ioctl = rtc_ioctl,
drivers/sbus/char/uctrl.c
... ... @@ -224,7 +224,7 @@
224 224 return IRQ_HANDLED;
225 225 }
226 226  
227   -static struct file_operations uctrl_fops = {
  227 +static const struct file_operations uctrl_fops = {
228 228 .owner = THIS_MODULE,
229 229 .llseek = no_llseek,
230 230 .ioctl = uctrl_ioctl,
drivers/sbus/char/vfc_dev.c
... ... @@ -44,7 +44,7 @@
44 44 #include "vfc.h"
45 45 #include <asm/vfc_ioctls.h>
46 46  
47   -static struct file_operations vfc_fops;
  47 +static const struct file_operations vfc_fops;
48 48 struct vfc_dev **vfc_dev_lst;
49 49 static char vfcstr[]="vfc";
50 50 static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
... ... @@ -633,7 +633,7 @@
633 633 }
634 634  
635 635  
636   -static struct file_operations vfc_fops = {
  636 +static const struct file_operations vfc_fops = {
637 637 .owner = THIS_MODULE,
638 638 .llseek = no_llseek,
639 639 .ioctl = vfc_ioctl,
drivers/scsi/3w-9xxx.c
... ... @@ -197,7 +197,7 @@
197 197 };
198 198  
199 199 /* File operations struct for character device */
200   -static struct file_operations twa_fops = {
  200 +static const struct file_operations twa_fops = {
201 201 .owner = THIS_MODULE,
202 202 .ioctl = twa_chrdev_ioctl,
203 203 .open = twa_chrdev_open,
drivers/scsi/3w-xxxx.c
... ... @@ -1040,7 +1040,7 @@
1040 1040 } /* End tw_chrdev_open() */
1041 1041  
1042 1042 /* File operations struct for character device */
1043   -static struct file_operations tw_fops = {
  1043 +static const struct file_operations tw_fops = {
1044 1044 .owner = THIS_MODULE,
1045 1045 .ioctl = tw_chrdev_ioctl,
1046 1046 .open = tw_chrdev_open,
drivers/scsi/aacraid/linit.c
... ... @@ -774,7 +774,7 @@
774 774 };
775 775  
776 776  
777   -static struct file_operations aac_cfg_fops = {
  777 +static const struct file_operations aac_cfg_fops = {
778 778 .owner = THIS_MODULE,
779 779 .ioctl = aac_cfg_ioctl,
780 780 #ifdef CONFIG_COMPAT
... ... @@ -129,7 +129,7 @@
129 129 },
130 130 };
131 131  
132   -static struct file_operations changer_fops =
  132 +static const struct file_operations changer_fops =
133 133 {
134 134 .owner = THIS_MODULE,
135 135 .open = ch_open,
drivers/scsi/dpt_i2o.c
... ... @@ -116,7 +116,7 @@
116 116 static adpt_hba* hba_chain = NULL;
117 117 static int hba_count = 0;
118 118  
119   -static struct file_operations adpt_fops = {
  119 +static const struct file_operations adpt_fops = {
120 120 .ioctl = adpt_ioctl,
121 121 .open = adpt_open,
122 122 .release = adpt_close
... ... @@ -687,7 +687,7 @@
687 687 MODULE_LICENSE("GPL");
688 688  
689 689 /* ioctl interface */
690   -static struct file_operations gdth_fops = {
  690 +static const struct file_operations gdth_fops = {
691 691 .ioctl = gdth_ioctl,
692 692 .open = gdth_open,
693 693 .release = gdth_close,
drivers/scsi/megaraid.c
... ... @@ -92,7 +92,7 @@
92 92 /*
93 93 * The File Operations structure for the serial/ioctl interface of the driver
94 94 */
95   -static struct file_operations megadev_fops = {
  95 +static const struct file_operations megadev_fops = {
96 96 .owner = THIS_MODULE,
97 97 .ioctl = megadev_ioctl,
98 98 .open = megadev_open,
drivers/scsi/megaraid/megaraid_mm.c
... ... @@ -67,7 +67,7 @@
67 67  
68 68 static wait_queue_head_t wait_q;
69 69  
70   -static struct file_operations lsi_fops = {
  70 +static const struct file_operations lsi_fops = {
71 71 .open = mraid_mm_open,
72 72 .ioctl = mraid_mm_ioctl,
73 73 #ifdef CONFIG_COMPAT
drivers/scsi/megaraid/megaraid_sas.c
... ... @@ -2913,7 +2913,7 @@
2913 2913 /*
2914 2914 * File operations structure for management interface
2915 2915 */
2916   -static struct file_operations megasas_mgmt_fops = {
  2916 +static const struct file_operations megasas_mgmt_fops = {
2917 2917 .owner = THIS_MODULE,
2918 2918 .open = megasas_mgmt_open,
2919 2919 .release = megasas_mgmt_release,
... ... @@ -5522,7 +5522,7 @@
5522 5522  
5523 5523 #endif
5524 5524  
5525   -static struct file_operations osst_fops = {
  5525 +static const struct file_operations osst_fops = {
5526 5526 .owner = THIS_MODULE,
5527 5527 .read = osst_read,
5528 5528 .write = osst_write,
drivers/scsi/scsi_proc.c
... ... @@ -308,7 +308,7 @@
308 308 return single_open(file, proc_scsi_show, NULL);
309 309 }
310 310  
311   -static struct file_operations proc_scsi_operations = {
  311 +static const struct file_operations proc_scsi_operations = {
312 312 .open = proc_scsi_open,
313 313 .read = seq_read,
314 314 .write = proc_scsi_write,
drivers/scsi/scsi_tgt_if.c
... ... @@ -280,7 +280,7 @@
280 280 return 0;
281 281 }
282 282  
283   -static struct file_operations tgt_fops = {
  283 +static const struct file_operations tgt_fops = {
284 284 .owner = THIS_MODULE,
285 285 .open = tgt_open,
286 286 .poll = tgt_poll,
... ... @@ -3864,7 +3864,7 @@
3864 3864  
3865 3865 #endif
3866 3866  
3867   -static struct file_operations st_fops =
  3867 +static const struct file_operations st_fops =
3868 3868 {
3869 3869 .owner = THIS_MODULE,
3870 3870 .read = st_read,
drivers/telephony/ixj.c
... ... @@ -6663,7 +6663,7 @@
6663 6663 return fasync_helper(fd, file_p, mode, &j->async_queue);
6664 6664 }
6665 6665  
6666   -static struct file_operations ixj_fops =
  6666 +static const struct file_operations ixj_fops =
6667 6667 {
6668 6668 .owner = THIS_MODULE,
6669 6669 .read = ixj_enhanced_read,
drivers/telephony/phonedev.c
... ... @@ -127,7 +127,7 @@
127 127 }
128 128  
129 129  
130   -static struct file_operations phone_fops =
  130 +static const struct file_operations phone_fops =
131 131 {
132 132 .owner = THIS_MODULE,
133 133 .open = phone_open,
drivers/usb/misc/adutux.c
... ... @@ -644,7 +644,7 @@
644 644 }
645 645  
646 646 /* file operations needed when we register this driver */
647   -static struct file_operations adu_fops = {
  647 +static const struct file_operations adu_fops = {
648 648 .owner = THIS_MODULE,
649 649 .read = adu_read,
650 650 .write = adu_write,
drivers/usb/misc/ftdi-elan.c
... ... @@ -1209,7 +1209,7 @@
1209 1209 return retval;
1210 1210 }
1211 1211  
1212   -static struct file_operations ftdi_elan_fops = {
  1212 +static const struct file_operations ftdi_elan_fops = {
1213 1213 .owner = THIS_MODULE,
1214 1214 .llseek = no_llseek,
1215 1215 .ioctl = ftdi_elan_ioctl,
drivers/video/mbx/mbxdebugfs.c
... ... @@ -170,37 +170,37 @@
170 170 }
171 171  
172 172  
173   -static struct file_operations sysconf_fops = {
  173 +static const struct file_operations sysconf_fops = {
174 174 .read = sysconf_read_file,
175 175 .write = write_file_dummy,
176 176 .open = open_file_generic,
177 177 };
178 178  
179   -static struct file_operations clock_fops = {
  179 +static const struct file_operations clock_fops = {
180 180 .read = clock_read_file,
181 181 .write = write_file_dummy,
182 182 .open = open_file_generic,
183 183 };
184 184  
185   -static struct file_operations display_fops = {
  185 +static const struct file_operations display_fops = {
186 186 .read = display_read_file,
187 187 .write = write_file_dummy,
188 188 .open = open_file_generic,
189 189 };
190 190  
191   -static struct file_operations gsctl_fops = {
  191 +static const struct file_operations gsctl_fops = {
192 192 .read = gsctl_read_file,
193 193 .write = write_file_dummy,
194 194 .open = open_file_generic,
195 195 };
196 196  
197   -static struct file_operations sdram_fops = {
  197 +static const struct file_operations sdram_fops = {
198 198 .read = sdram_read_file,
199 199 .write = write_file_dummy,
200 200 .open = open_file_generic,
201 201 };
202 202  
203   -static struct file_operations misc_fops = {
  203 +static const struct file_operations misc_fops = {
204 204 .read = misc_read_file,
205 205 .write = write_file_dummy,
206 206 .open = open_file_generic,
drivers/zorro/proc.c
... ... @@ -75,7 +75,7 @@
75 75 return nbytes;
76 76 }
77 77  
78   -static struct file_operations proc_bus_zorro_operations = {
  78 +static const struct file_operations proc_bus_zorro_operations = {
79 79 .llseek = proc_bus_zorro_lseek,
80 80 .read = proc_bus_zorro_read,
81 81 };
... ... @@ -254,7 +254,7 @@
254 254 blob->size);
255 255 }
256 256  
257   -static struct file_operations fops_blob = {
  257 +static const struct file_operations fops_blob = {
258 258 .read = read_file_blob,
259 259 .open = default_open,
260 260 };
... ... @@ -287,7 +287,7 @@
287 287 return 0;
288 288 }
289 289  
290   -static struct file_operations rsb_fops = {
  290 +static const struct file_operations rsb_fops = {
291 291 .owner = THIS_MODULE,
292 292 .open = rsb_open,
293 293 .read = seq_read,
... ... @@ -331,7 +331,7 @@
331 331 return rv;
332 332 }
333 333  
334   -static struct file_operations waiters_fops = {
  334 +static const struct file_operations waiters_fops = {
335 335 .owner = THIS_MODULE,
336 336 .open = waiters_open,
337 337 .read = waiters_read
... ... @@ -25,7 +25,7 @@
25 25  
26 26 static const char *name_prefix="dlm";
27 27 static struct miscdevice ctl_device;
28   -static struct file_operations device_fops;
  28 +static const struct file_operations device_fops;
29 29  
30 30 #ifdef CONFIG_COMPAT
31 31  
... ... @@ -759,7 +759,7 @@
759 759 return 0;
760 760 }
761 761  
762   -static struct file_operations device_fops = {
  762 +static const struct file_operations device_fops = {
763 763 .open = device_open,
764 764 .release = device_close,
765 765 .read = device_read,
... ... @@ -768,7 +768,7 @@
768 768 .owner = THIS_MODULE,
769 769 };
770 770  
771   -static struct file_operations ctl_device_fops = {
  771 +static const struct file_operations ctl_device_fops = {
772 772 .open = ctl_device_open,
773 773 .release = ctl_device_close,
774 774 .write = device_write,
fs/gfs2/locking/dlm/plock.c
... ... @@ -264,7 +264,7 @@
264 264 return 0;
265 265 }
266 266  
267   -static struct file_operations dev_fops = {
  267 +static const struct file_operations dev_fops = {
268 268 .read = dev_read,
269 269 .write = dev_write,
270 270 .poll = dev_poll,
... ... @@ -1173,7 +1173,7 @@
1173 1173 .show = nfs_server_list_show,
1174 1174 };
1175 1175  
1176   -static struct file_operations nfs_server_list_fops = {
  1176 +static const struct file_operations nfs_server_list_fops = {
1177 1177 .open = nfs_server_list_open,
1178 1178 .read = seq_read,
1179 1179 .llseek = seq_lseek,
... ... @@ -1193,7 +1193,7 @@
1193 1193 .show = nfs_volume_list_show,
1194 1194 };
1195 1195  
1196   -static struct file_operations nfs_volume_list_fops = {
  1196 +static const struct file_operations nfs_volume_list_fops = {
1197 1197 .open = nfs_volume_list_open,
1198 1198 .read = seq_read,
1199 1199 .llseek = seq_lseek,
fs/ocfs2/dlm/dlmfs.c
... ... @@ -62,7 +62,7 @@
62 62 #include "cluster/masklog.h"
63 63  
64 64 static struct super_operations dlmfs_ops;
65   -static struct file_operations dlmfs_file_operations;
  65 +static const struct file_operations dlmfs_file_operations;
66 66 static struct inode_operations dlmfs_dir_inode_operations;
67 67 static struct inode_operations dlmfs_root_inode_operations;
68 68 static struct inode_operations dlmfs_file_inode_operations;
... ... @@ -540,7 +540,7 @@
540 540 return 0;
541 541 }
542 542  
543   -static struct file_operations dlmfs_file_operations = {
  543 +static const struct file_operations dlmfs_file_operations = {
544 544 .open = dlmfs_file_open,
545 545 .release = dlmfs_file_release,
546 546 .read = dlmfs_file_read,
... ... @@ -94,7 +94,7 @@
94 94 char *name;
95 95 mode_t mode;
96 96 struct inode_operations *iop;
97   - struct file_operations *fop;
  97 + const struct file_operations *fop;
98 98 union proc_op op;
99 99 };
100 100  
... ... @@ -424,7 +424,7 @@
424 424 return res;
425 425 }
426 426  
427   -static struct file_operations proc_mounts_operations = {
  427 +static const struct file_operations proc_mounts_operations = {
428 428 .open = mounts_open,
429 429 .read = seq_read,
430 430 .llseek = seq_lseek,
... ... @@ -462,7 +462,7 @@
462 462 return ret;
463 463 }
464 464  
465   -static struct file_operations proc_mountstats_operations = {
  465 +static const struct file_operations proc_mountstats_operations = {
466 466 .open = mountstats_open,
467 467 .read = seq_read,
468 468 .llseek = seq_lseek,
... ... @@ -501,7 +501,7 @@
501 501 return length;
502 502 }
503 503  
504   -static struct file_operations proc_info_file_operations = {
  504 +static const struct file_operations proc_info_file_operations = {
505 505 .read = proc_info_read,
506 506 };
507 507  
... ... @@ -646,7 +646,7 @@
646 646 return file->f_pos;
647 647 }
648 648  
649   -static struct file_operations proc_mem_operations = {
  649 +static const struct file_operations proc_mem_operations = {
650 650 .llseek = mem_lseek,
651 651 .read = mem_read,
652 652 .write = mem_write,
... ... @@ -710,7 +710,7 @@
710 710 return end - buffer;
711 711 }
712 712  
713   -static struct file_operations proc_oom_adjust_operations = {
  713 +static const struct file_operations proc_oom_adjust_operations = {
714 714 .read = oom_adjust_read,
715 715 .write = oom_adjust_write,
716 716 };
... ... @@ -777,7 +777,7 @@
777 777 return length;
778 778 }
779 779  
780   -static struct file_operations proc_loginuid_operations = {
  780 +static const struct file_operations proc_loginuid_operations = {
781 781 .read = proc_loginuid_read,
782 782 .write = proc_loginuid_write,
783 783 };
... ... @@ -849,7 +849,7 @@
849 849 return result;
850 850 }
851 851  
852   -static struct file_operations proc_seccomp_operations = {
  852 +static const struct file_operations proc_seccomp_operations = {
853 853 .read = seccomp_read,
854 854 .write = seccomp_write,
855 855 };
... ... @@ -908,7 +908,7 @@
908 908 return end - buffer;
909 909 }
910 910  
911   -static struct file_operations proc_fault_inject_operations = {
  911 +static const struct file_operations proc_fault_inject_operations = {
912 912 .read = proc_fault_inject_read,
913 913 .write = proc_fault_inject_write,
914 914 };
... ... @@ -1408,7 +1408,7 @@
1408 1408 return retval;
1409 1409 }
1410 1410  
1411   -static struct file_operations proc_fd_operations = {
  1411 +static const struct file_operations proc_fd_operations = {
1412 1412 .read = generic_read_dir,
1413 1413 .readdir = proc_readfd,
1414 1414 };
... ... @@ -1623,7 +1623,7 @@
1623 1623 return length;
1624 1624 }
1625 1625  
1626   -static struct file_operations proc_pid_attr_operations = {
  1626 +static const struct file_operations proc_pid_attr_operations = {
1627 1627 .read = proc_pid_attr_read,
1628 1628 .write = proc_pid_attr_write,
1629 1629 };
... ... @@ -1644,7 +1644,7 @@
1644 1644 attr_dir_stuff,ARRAY_SIZE(attr_dir_stuff));
1645 1645 }
1646 1646  
1647   -static struct file_operations proc_attr_dir_operations = {
  1647 +static const struct file_operations proc_attr_dir_operations = {
1648 1648 .read = generic_read_dir,
1649 1649 .readdir = proc_attr_dir_readdir,
1650 1650 };
... ... @@ -1834,7 +1834,7 @@
1834 1834 /*
1835 1835 * Thread groups
1836 1836 */
1837   -static struct file_operations proc_task_operations;
  1837 +static const struct file_operations proc_task_operations;
1838 1838 static struct inode_operations proc_task_inode_operations;
1839 1839  
1840 1840 static struct pid_entry tgid_base_stuff[] = {
... ... @@ -1894,7 +1894,7 @@
1894 1894 tgid_base_stuff,ARRAY_SIZE(tgid_base_stuff));
1895 1895 }
1896 1896  
1897   -static struct file_operations proc_tgid_base_operations = {
  1897 +static const struct file_operations proc_tgid_base_operations = {
1898 1898 .read = generic_read_dir,
1899 1899 .readdir = proc_tgid_base_readdir,
1900 1900 };
... ... @@ -2177,7 +2177,7 @@
2177 2177 tid_base_stuff, ARRAY_SIZE(tid_base_stuff));
2178 2178 }
2179 2179  
2180   -static struct file_operations proc_tid_base_operations = {
  2180 +static const struct file_operations proc_tid_base_operations = {
2181 2181 .read = generic_read_dir,
2182 2182 .readdir = proc_tid_base_readdir,
2183 2183 };
... ... @@ -2414,7 +2414,7 @@
2414 2414 .setattr = proc_setattr,
2415 2415 };
2416 2416  
2417   -static struct file_operations proc_task_operations = {
  2417 +static const struct file_operations proc_task_operations = {
2418 2418 .read = generic_read_dir,
2419 2419 .readdir = proc_task_readdir,
2420 2420 };
... ... @@ -39,7 +39,7 @@
39 39 return !memcmp(name, de->name, len);
40 40 }
41 41  
42   -static struct file_operations proc_file_operations = {
  42 +static const struct file_operations proc_file_operations = {
43 43 .llseek = proc_file_lseek,
44 44 .read = proc_file_read,
45 45 .write = proc_file_write,
... ... @@ -497,7 +497,7 @@
497 497 * use the in-memory "struct proc_dir_entry" tree to parse
498 498 * the /proc directory.
499 499 */
500   -static struct file_operations proc_dir_operations = {
  500 +static const struct file_operations proc_dir_operations = {
501 501 .read = generic_read_dir,
502 502 .readdir = proc_readdir,
503 503 };
... ... @@ -38,13 +38,13 @@
38 38 extern int proc_pid_status(struct task_struct *, char *);
39 39 extern int proc_pid_statm(struct task_struct *, char *);
40 40  
41   -extern struct file_operations proc_maps_operations;
42   -extern struct file_operations proc_numa_maps_operations;
43   -extern struct file_operations proc_smaps_operations;
  41 +extern const struct file_operations proc_maps_operations;
  42 +extern const struct file_operations proc_numa_maps_operations;
  43 +extern const struct file_operations proc_smaps_operations;
44 44  
45   -extern struct file_operations proc_maps_operations;
46   -extern struct file_operations proc_numa_maps_operations;
47   -extern struct file_operations proc_smaps_operations;
  45 +extern const struct file_operations proc_maps_operations;
  46 +extern const struct file_operations proc_numa_maps_operations;
  47 +extern const struct file_operations proc_smaps_operations;
48 48  
49 49  
50 50 void free_proc_entry(struct proc_dir_entry *de);
... ... @@ -128,7 +128,7 @@
128 128 return seq_open(file, &proc_nommu_vma_list_seqop);
129 129 }
130 130  
131   -static struct file_operations proc_nommu_vma_list_operations = {
  131 +static const struct file_operations proc_nommu_vma_list_operations = {
132 132 .open = proc_nommu_vma_list_open,
133 133 .read = seq_read,
134 134 .llseek = seq_lseek,
... ... @@ -223,7 +223,7 @@
223 223 return seq_open(file, &fragmentation_op);
224 224 }
225 225  
226   -static struct file_operations fragmentation_file_operations = {
  226 +static const struct file_operations fragmentation_file_operations = {
227 227 .open = fragmentation_open,
228 228 .read = seq_read,
229 229 .llseek = seq_lseek,
... ... @@ -236,7 +236,7 @@
236 236 return seq_open(file, &zoneinfo_op);
237 237 }
238 238  
239   -static struct file_operations proc_zoneinfo_file_operations = {
  239 +static const struct file_operations proc_zoneinfo_file_operations = {
240 240 .open = zoneinfo_open,
241 241 .read = seq_read,
242 242 .llseek = seq_lseek,
... ... @@ -261,7 +261,7 @@
261 261 return seq_open(file, &cpuinfo_op);
262 262 }
263 263  
264   -static struct file_operations proc_cpuinfo_operations = {
  264 +static const struct file_operations proc_cpuinfo_operations = {
265 265 .open = cpuinfo_open,
266 266 .read = seq_read,
267 267 .llseek = seq_lseek,
... ... @@ -320,7 +320,7 @@
320 320 return seq_open(filp, &devinfo_ops);
321 321 }
322 322  
323   -static struct file_operations proc_devinfo_operations = {
  323 +static const struct file_operations proc_devinfo_operations = {
324 324 .open = devinfo_open,
325 325 .read = seq_read,
326 326 .llseek = seq_lseek,
... ... @@ -332,7 +332,7 @@
332 332 {
333 333 return seq_open(file, &vmstat_op);
334 334 }
335   -static struct file_operations proc_vmstat_file_operations = {
  335 +static const struct file_operations proc_vmstat_file_operations = {
336 336 .open = vmstat_open,
337 337 .read = seq_read,
338 338 .llseek = seq_lseek,
... ... @@ -363,7 +363,7 @@
363 363 {
364 364 return seq_open(file, &partitions_op);
365 365 }
366   -static struct file_operations proc_partitions_operations = {
  366 +static const struct file_operations proc_partitions_operations = {
367 367 .open = partitions_open,
368 368 .read = seq_read,
369 369 .llseek = seq_lseek,
... ... @@ -375,7 +375,7 @@
375 375 {
376 376 return seq_open(file, &diskstats_op);
377 377 }
378   -static struct file_operations proc_diskstats_operations = {
  378 +static const struct file_operations proc_diskstats_operations = {
379 379 .open = diskstats_open,
380 380 .read = seq_read,
381 381 .llseek = seq_lseek,
... ... @@ -389,7 +389,7 @@
389 389 {
390 390 return seq_open(file, &modules_op);
391 391 }
392   -static struct file_operations proc_modules_operations = {
  392 +static const struct file_operations proc_modules_operations = {
393 393 .open = modules_open,
394 394 .read = seq_read,
395 395 .llseek = seq_lseek,
... ... @@ -404,7 +404,7 @@
404 404 {
405 405 return seq_open(file, &slabinfo_op);
406 406 }
407   -static struct file_operations proc_slabinfo_operations = {
  407 +static const struct file_operations proc_slabinfo_operations = {
408 408 .open = slabinfo_open,
409 409 .read = seq_read,
410 410 .write = slabinfo_write,
... ... @@ -438,7 +438,7 @@
438 438 return seq_release(inode, file);
439 439 }
440 440  
441   -static struct file_operations proc_slabstats_operations = {
  441 +static const struct file_operations proc_slabstats_operations = {
442 442 .open = slabstats_open,
443 443 .read = seq_read,
444 444 .llseek = seq_lseek,
... ... @@ -551,7 +551,7 @@
551 551 kfree(buf);
552 552 return res;
553 553 }
554   -static struct file_operations proc_stat_operations = {
  554 +static const struct file_operations proc_stat_operations = {
555 555 .open = stat_open,
556 556 .read = seq_read,
557 557 .llseek = seq_lseek,
... ... @@ -593,7 +593,7 @@
593 593 return seq_open(filp, &int_seq_ops);
594 594 }
595 595  
596   -static struct file_operations proc_interrupts_operations = {
  596 +static const struct file_operations proc_interrupts_operations = {
597 597 .open = interrupts_open,
598 598 .read = seq_read,
599 599 .llseek = seq_lseek,
... ... @@ -650,7 +650,7 @@
650 650 return count;
651 651 }
652 652  
653   -static struct file_operations proc_sysrq_trigger_operations = {
  653 +static const struct file_operations proc_sysrq_trigger_operations = {
654 654 .write = write_sysrq_trigger,
655 655 };
656 656 #endif
... ... @@ -138,7 +138,7 @@
138 138 return seq_open(file, &tty_drivers_op);
139 139 }
140 140  
141   -static struct file_operations proc_tty_drivers_operations = {
  141 +static const struct file_operations proc_tty_drivers_operations = {
142 142 .open = tty_drivers_open,
143 143 .read = seq_read,
144 144 .llseek = seq_lseek,
... ... @@ -136,7 +136,7 @@
136 136 * <pid> directories. Thus we don't use the generic
137 137 * directory handling functions for that..
138 138 */
139   -static struct file_operations proc_root_operations = {
  139 +static const struct file_operations proc_root_operations = {
140 140 .read = generic_read_dir,
141 141 .readdir = proc_root_readdir,
142 142 };
... ... @@ -434,7 +434,7 @@
434 434 return do_maps_open(inode, file, &proc_pid_maps_op);
435 435 }
436 436  
437   -struct file_operations proc_maps_operations = {
  437 +const struct file_operations proc_maps_operations = {
438 438 .open = maps_open,
439 439 .read = seq_read,
440 440 .llseek = seq_lseek,
... ... @@ -456,7 +456,7 @@
456 456 return do_maps_open(inode, file, &proc_pid_numa_maps_op);
457 457 }
458 458  
459   -struct file_operations proc_numa_maps_operations = {
  459 +const struct file_operations proc_numa_maps_operations = {
460 460 .open = numa_maps_open,
461 461 .read = seq_read,
462 462 .llseek = seq_lseek,
... ... @@ -469,7 +469,7 @@
469 469 return do_maps_open(inode, file, &proc_pid_smaps_op);
470 470 }
471 471  
472   -struct file_operations proc_smaps_operations = {
  472 +const struct file_operations proc_smaps_operations = {
473 473 .open = smaps_open,
474 474 .read = seq_read,
475 475 .llseek = seq_lseek,
fs/proc/task_nommu.c
... ... @@ -220,7 +220,7 @@
220 220 return ret;
221 221 }
222 222  
223   -struct file_operations proc_maps_operations = {
  223 +const struct file_operations proc_maps_operations = {
224 224 .open = maps_open,
225 225 .read = seq_read,
226 226 .llseek = seq_lseek,