Commit 00977a59b951207d38380c75f03a36829950265c
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
- 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
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
... | ... | @@ -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
drivers/scsi/ch.c
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 |
drivers/scsi/gdth.c
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
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, |
drivers/scsi/osst.c
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
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
... | ... | @@ -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
fs/debugfs/file.c
fs/dlm/debug_fs.c
... | ... | @@ -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 |
fs/dlm/user.c
... | ... | @@ -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
fs/nfs/client.c
... | ... | @@ -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, |
fs/proc/base.c
... | ... | @@ -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 | }; |
fs/proc/generic.c
... | ... | @@ -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 | }; |
fs/proc/internal.h
... | ... | @@ -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); |
fs/proc/nommu.c
... | ... | @@ -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, |
fs/proc/proc_misc.c
... | ... | @@ -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 |
fs/proc/proc_tty.c
... | ... | @@ -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, |
fs/proc/root.c
... | ... | @@ -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 | }; |
fs/proc/task_mmu.c
... | ... | @@ -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