diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2009-10-01 18:43:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-01 19:11:11 -0400 |
commit | 828c09509b9695271bcbdc53e9fc9a6a737148d2 (patch) | |
tree | 072ffad6f02db7bf4095e07e2b90247cfa042998 | |
parent | 1c4115e595dec42aa0e81ba47ef46e35b34ed428 (diff) |
const: constify remaining file_operations
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
57 files changed, 110 insertions, 95 deletions
diff --git a/arch/arm/mach-ns9xxx/clock.c b/arch/arm/mach-ns9xxx/clock.c index 44ed20d4a388..cf81cbc57544 100644 --- a/arch/arm/mach-ns9xxx/clock.c +++ b/arch/arm/mach-ns9xxx/clock.c | |||
@@ -195,7 +195,7 @@ static int clk_debugfs_open(struct inode *inode, struct file *file) | |||
195 | return single_open(file, clk_debugfs_show, NULL); | 195 | return single_open(file, clk_debugfs_show, NULL); |
196 | } | 196 | } |
197 | 197 | ||
198 | static struct file_operations clk_debugfs_operations = { | 198 | static const struct file_operations clk_debugfs_operations = { |
199 | .open = clk_debugfs_open, | 199 | .open = clk_debugfs_open, |
200 | .read = seq_read, | 200 | .read = seq_read, |
201 | .llseek = seq_lseek, | 201 | .llseek = seq_lseek, |
diff --git a/arch/blackfin/mach-bf561/coreb.c b/arch/blackfin/mach-bf561/coreb.c index 93635a766f9c..1e60a92dd602 100644 --- a/arch/blackfin/mach-bf561/coreb.c +++ b/arch/blackfin/mach-bf561/coreb.c | |||
@@ -48,7 +48,7 @@ coreb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned l | |||
48 | return ret; | 48 | return ret; |
49 | } | 49 | } |
50 | 50 | ||
51 | static struct file_operations coreb_fops = { | 51 | static const struct file_operations coreb_fops = { |
52 | .owner = THIS_MODULE, | 52 | .owner = THIS_MODULE, |
53 | .ioctl = coreb_ioctl, | 53 | .ioctl = coreb_ioctl, |
54 | }; | 54 | }; |
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index 6cc1a0319a5d..562b9a7feae7 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -244,7 +244,7 @@ static unsigned sync_serial_prescale_shadow; | |||
244 | 244 | ||
245 | #define NUMBER_OF_PORTS 2 | 245 | #define NUMBER_OF_PORTS 2 |
246 | 246 | ||
247 | static struct file_operations sync_serial_fops = { | 247 | static const struct file_operations sync_serial_fops = { |
248 | .owner = THIS_MODULE, | 248 | .owner = THIS_MODULE, |
249 | .write = sync_serial_write, | 249 | .write = sync_serial_write, |
250 | .read = sync_serial_read, | 250 | .read = sync_serial_read, |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index fe1fde893887..d89ab80498ed 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -855,7 +855,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) | |||
855 | return 0; | 855 | return 0; |
856 | } | 856 | } |
857 | 857 | ||
858 | struct file_operations gpio_fops = { | 858 | static const struct file_operations gpio_fops = { |
859 | .owner = THIS_MODULE, | 859 | .owner = THIS_MODULE, |
860 | .poll = gpio_poll, | 860 | .poll = gpio_poll, |
861 | .ioctl = gpio_ioctl, | 861 | .ioctl = gpio_ioctl, |
diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c index 47ee603f558e..2aa371e30079 100644 --- a/arch/powerpc/kvm/timing.c +++ b/arch/powerpc/kvm/timing.c | |||
@@ -201,7 +201,7 @@ static int kvmppc_exit_timing_open(struct inode *inode, struct file *file) | |||
201 | return single_open(file, kvmppc_exit_timing_show, inode->i_private); | 201 | return single_open(file, kvmppc_exit_timing_show, inode->i_private); |
202 | } | 202 | } |
203 | 203 | ||
204 | static struct file_operations kvmppc_exit_timing_fops = { | 204 | static const struct file_operations kvmppc_exit_timing_fops = { |
205 | .owner = THIS_MODULE, | 205 | .owner = THIS_MODULE, |
206 | .open = kvmppc_exit_timing_open, | 206 | .open = kvmppc_exit_timing_open, |
207 | .read = seq_read, | 207 | .read = seq_read, |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 961309446170..884e8bcec499 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -147,7 +147,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \ | |||
147 | __simple_attr_check_format(__fmt, 0ull); \ | 147 | __simple_attr_check_format(__fmt, 0ull); \ |
148 | return spufs_attr_open(inode, file, __get, __set, __fmt); \ | 148 | return spufs_attr_open(inode, file, __get, __set, __fmt); \ |
149 | } \ | 149 | } \ |
150 | static struct file_operations __fops = { \ | 150 | static const struct file_operations __fops = { \ |
151 | .owner = THIS_MODULE, \ | 151 | .owner = THIS_MODULE, \ |
152 | .open = __fops ## _open, \ | 152 | .open = __fops ## _open, \ |
153 | .release = spufs_attr_release, \ | 153 | .release = spufs_attr_release, \ |
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c index ab69925d579b..937a544a236d 100644 --- a/arch/powerpc/platforms/pseries/dtl.c +++ b/arch/powerpc/platforms/pseries/dtl.c | |||
@@ -209,7 +209,7 @@ static ssize_t dtl_file_read(struct file *filp, char __user *buf, size_t len, | |||
209 | return n_read * sizeof(struct dtl_entry); | 209 | return n_read * sizeof(struct dtl_entry); |
210 | } | 210 | } |
211 | 211 | ||
212 | static struct file_operations dtl_fops = { | 212 | static const struct file_operations dtl_fops = { |
213 | .open = dtl_file_open, | 213 | .open = dtl_file_open, |
214 | .release = dtl_file_release, | 214 | .release = dtl_file_release, |
215 | .read = dtl_file_read, | 215 | .read = dtl_file_read, |
diff --git a/arch/x86/xen/debugfs.c b/arch/x86/xen/debugfs.c index b53225d2cac3..e133ce25e290 100644 --- a/arch/x86/xen/debugfs.c +++ b/arch/x86/xen/debugfs.c | |||
@@ -100,7 +100,7 @@ static int xen_array_release(struct inode *inode, struct file *file) | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static struct file_operations u32_array_fops = { | 103 | static const struct file_operations u32_array_fops = { |
104 | .owner = THIS_MODULE, | 104 | .owner = THIS_MODULE, |
105 | .open = u32_array_open, | 105 | .open = u32_array_open, |
106 | .release= xen_array_release, | 106 | .release= xen_array_release, |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index a4fddb24476f..f6e54bf8dd96 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -285,7 +285,7 @@ static int acpi_video_device_brightness_open_fs(struct inode *inode, | |||
285 | struct file *file); | 285 | struct file *file); |
286 | static ssize_t acpi_video_device_write_brightness(struct file *file, | 286 | static ssize_t acpi_video_device_write_brightness(struct file *file, |
287 | const char __user *buffer, size_t count, loff_t *data); | 287 | const char __user *buffer, size_t count, loff_t *data); |
288 | static struct file_operations acpi_video_device_brightness_fops = { | 288 | static const struct file_operations acpi_video_device_brightness_fops = { |
289 | .owner = THIS_MODULE, | 289 | .owner = THIS_MODULE, |
290 | .open = acpi_video_device_brightness_open_fs, | 290 | .open = acpi_video_device_brightness_open_fs, |
291 | .read = seq_read, | 291 | .read = seq_read, |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 24c3e21ab263..1ece0b47b581 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -426,7 +426,7 @@ out: | |||
426 | return err; | 426 | return err; |
427 | } | 427 | } |
428 | 428 | ||
429 | static struct file_operations cciss_proc_fops = { | 429 | static const struct file_operations cciss_proc_fops = { |
430 | .owner = THIS_MODULE, | 430 | .owner = THIS_MODULE, |
431 | .open = cciss_seq_open, | 431 | .open = cciss_seq_open, |
432 | .read = seq_read, | 432 | .read = seq_read, |
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index aaca40283be9..4f568cb9af3f 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c | |||
@@ -393,7 +393,7 @@ static int apm_open(struct inode * inode, struct file * filp) | |||
393 | return as ? 0 : -ENOMEM; | 393 | return as ? 0 : -ENOMEM; |
394 | } | 394 | } |
395 | 395 | ||
396 | static struct file_operations apm_bios_fops = { | 396 | static const struct file_operations apm_bios_fops = { |
397 | .owner = THIS_MODULE, | 397 | .owner = THIS_MODULE, |
398 | .read = apm_read, | 398 | .read = apm_read, |
399 | .poll = apm_poll, | 399 | .poll = apm_poll, |
diff --git a/drivers/char/bfin-otp.c b/drivers/char/bfin-otp.c index e3dd24bff514..836d4f0a876f 100644 --- a/drivers/char/bfin-otp.c +++ b/drivers/char/bfin-otp.c | |||
@@ -217,7 +217,7 @@ static long bfin_otp_ioctl(struct file *filp, unsigned cmd, unsigned long arg) | |||
217 | # define bfin_otp_ioctl NULL | 217 | # define bfin_otp_ioctl NULL |
218 | #endif | 218 | #endif |
219 | 219 | ||
220 | static struct file_operations bfin_otp_fops = { | 220 | static const struct file_operations bfin_otp_fops = { |
221 | .owner = THIS_MODULE, | 221 | .owner = THIS_MODULE, |
222 | .unlocked_ioctl = bfin_otp_ioctl, | 222 | .unlocked_ioctl = bfin_otp_ioctl, |
223 | .read = bfin_otp_read, | 223 | .read = bfin_otp_read, |
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index f40ab699860f..4846d50199f3 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c | |||
@@ -559,7 +559,7 @@ static int hwicap_release(struct inode *inode, struct file *file) | |||
559 | return status; | 559 | return status; |
560 | } | 560 | } |
561 | 561 | ||
562 | static struct file_operations hwicap_fops = { | 562 | static const struct file_operations hwicap_fops = { |
563 | .owner = THIS_MODULE, | 563 | .owner = THIS_MODULE, |
564 | .write = hwicap_write, | 564 | .write = hwicap_write, |
565 | .read = hwicap_read, | 565 | .read = hwicap_read, |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index bb11a429394a..662ed923d9eb 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -1487,7 +1487,7 @@ static int gpiolib_open(struct inode *inode, struct file *file) | |||
1487 | return single_open(file, gpiolib_show, NULL); | 1487 | return single_open(file, gpiolib_show, NULL); |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | static struct file_operations gpiolib_operations = { | 1490 | static const struct file_operations gpiolib_operations = { |
1491 | .open = gpiolib_open, | 1491 | .open = gpiolib_open, |
1492 | .read = seq_read, | 1492 | .read = seq_read, |
1493 | .llseek = seq_lseek, | 1493 | .llseek = seq_lseek, |
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c index ea955edde87e..2a7a85a6dc36 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c | |||
@@ -915,7 +915,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp, | |||
915 | return ret; | 915 | return ret; |
916 | } | 916 | } |
917 | 917 | ||
918 | static struct file_operations watchdog_fops = { | 918 | static const struct file_operations watchdog_fops = { |
919 | .owner = THIS_MODULE, | 919 | .owner = THIS_MODULE, |
920 | .llseek = no_llseek, | 920 | .llseek = no_llseek, |
921 | .open = watchdog_open, | 921 | .open = watchdog_open, |
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index b4d3f7ca554f..bd1632388e4a 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c | |||
@@ -508,7 +508,7 @@ static int close(struct inode *inode, struct file *file) | |||
508 | * uses: reading and writing a character device called /dev/lguest. All the | 508 | * uses: reading and writing a character device called /dev/lguest. All the |
509 | * work happens in the read(), write() and close() routines: | 509 | * work happens in the read(), write() and close() routines: |
510 | */ | 510 | */ |
511 | static struct file_operations lguest_fops = { | 511 | static const struct file_operations lguest_fops = { |
512 | .owner = THIS_MODULE, | 512 | .owner = THIS_MODULE, |
513 | .release = close, | 513 | .release = close, |
514 | .write = write, | 514 | .write = write, |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index 3750ff48cba1..516414983593 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -1203,7 +1203,7 @@ static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) | |||
1203 | return mask; | 1203 | return mask; |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | static struct file_operations dvb_dvr_fops = { | 1206 | static const struct file_operations dvb_dvr_fops = { |
1207 | .owner = THIS_MODULE, | 1207 | .owner = THIS_MODULE, |
1208 | .read = dvb_dvr_read, | 1208 | .read = dvb_dvr_read, |
1209 | .write = dvb_dvr_write, | 1209 | .write = dvb_dvr_write, |
diff --git a/drivers/media/dvb/firewire/firedtv-ci.c b/drivers/media/dvb/firewire/firedtv-ci.c index eeb80d0ea3ff..853e04b7cb36 100644 --- a/drivers/media/dvb/firewire/firedtv-ci.c +++ b/drivers/media/dvb/firewire/firedtv-ci.c | |||
@@ -215,7 +215,7 @@ static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait) | |||
215 | return POLLIN; | 215 | return POLLIN; |
216 | } | 216 | } |
217 | 217 | ||
218 | static struct file_operations fdtv_ca_fops = { | 218 | static const struct file_operations fdtv_ca_fops = { |
219 | .owner = THIS_MODULE, | 219 | .owner = THIS_MODULE, |
220 | .ioctl = dvb_generic_ioctl, | 220 | .ioctl = dvb_generic_ioctl, |
221 | .open = dvb_generic_open, | 221 | .open = dvb_generic_open, |
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index fa57b67593ae..90a95ce8dc34 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c | |||
@@ -271,7 +271,7 @@ static unsigned int phantom_poll(struct file *file, poll_table *wait) | |||
271 | return mask; | 271 | return mask; |
272 | } | 272 | } |
273 | 273 | ||
274 | static struct file_operations phantom_file_ops = { | 274 | static const struct file_operations phantom_file_ops = { |
275 | .open = phantom_open, | 275 | .open = phantom_open, |
276 | .release = phantom_release, | 276 | .release = phantom_release, |
277 | .unlocked_ioctl = phantom_ioctl, | 277 | .unlocked_ioctl = phantom_ioctl, |
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index 300e7ba391a0..41c8fe2a928c 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -53,7 +53,6 @@ struct gru_stats_s gru_stats; | |||
53 | /* Guaranteed user available resources on each node */ | 53 | /* Guaranteed user available resources on each node */ |
54 | static int max_user_cbrs, max_user_dsr_bytes; | 54 | static int max_user_cbrs, max_user_dsr_bytes; |
55 | 55 | ||
56 | static struct file_operations gru_fops; | ||
57 | static struct miscdevice gru_miscdev; | 56 | static struct miscdevice gru_miscdev; |
58 | 57 | ||
59 | 58 | ||
@@ -426,7 +425,7 @@ static void __exit gru_exit(void) | |||
426 | gru_proc_exit(); | 425 | gru_proc_exit(); |
427 | } | 426 | } |
428 | 427 | ||
429 | static struct file_operations gru_fops = { | 428 | static const struct file_operations gru_fops = { |
430 | .owner = THIS_MODULE, | 429 | .owner = THIS_MODULE, |
431 | .unlocked_ioctl = gru_file_unlocked_ioctl, | 430 | .unlocked_ioctl = gru_file_unlocked_ioctl, |
432 | .mmap = gru_file_mmap, | 431 | .mmap = gru_file_mmap, |
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 610dbd1fcc82..96d10f40fb23 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c | |||
@@ -240,7 +240,7 @@ static int mmc_ext_csd_release(struct inode *inode, struct file *file) | |||
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
242 | 242 | ||
243 | static struct file_operations mmc_dbg_ext_csd_fops = { | 243 | static const struct file_operations mmc_dbg_ext_csd_fops = { |
244 | .open = mmc_ext_csd_open, | 244 | .open = mmc_ext_csd_open, |
245 | .read = mmc_ext_csd_read, | 245 | .read = mmc_ext_csd_read, |
246 | .release = mmc_ext_csd_release, | 246 | .release = mmc_ext_csd_release, |
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c index 1b78f639ead3..76769978285f 100644 --- a/drivers/s390/cio/qdio_debug.c +++ b/drivers/s390/cio/qdio_debug.c | |||
@@ -125,7 +125,7 @@ static int qstat_seq_open(struct inode *inode, struct file *filp) | |||
125 | filp->f_path.dentry->d_inode->i_private); | 125 | filp->f_path.dentry->d_inode->i_private); |
126 | } | 126 | } |
127 | 127 | ||
128 | static struct file_operations debugfs_fops = { | 128 | static const struct file_operations debugfs_fops = { |
129 | .owner = THIS_MODULE, | 129 | .owner = THIS_MODULE, |
130 | .open = qstat_seq_open, | 130 | .open = qstat_seq_open, |
131 | .read = seq_read, | 131 | .read = seq_read, |
diff --git a/drivers/s390/cio/qdio_perf.c b/drivers/s390/cio/qdio_perf.c index eff943923c6f..968e3c7c2632 100644 --- a/drivers/s390/cio/qdio_perf.c +++ b/drivers/s390/cio/qdio_perf.c | |||
@@ -84,7 +84,7 @@ static int qdio_perf_seq_open(struct inode *inode, struct file *filp) | |||
84 | return single_open(filp, qdio_perf_proc_show, NULL); | 84 | return single_open(filp, qdio_perf_proc_show, NULL); |
85 | } | 85 | } |
86 | 86 | ||
87 | static struct file_operations qdio_perf_proc_fops = { | 87 | static const struct file_operations qdio_perf_proc_fops = { |
88 | .owner = THIS_MODULE, | 88 | .owner = THIS_MODULE, |
89 | .open = qdio_perf_seq_open, | 89 | .open = qdio_perf_seq_open, |
90 | .read = seq_read, | 90 | .read = seq_read, |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 0cb049f5cc56..747a5e5c1276 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1317,7 +1317,7 @@ static void sg_rq_end_io(struct request *rq, int uptodate) | |||
1317 | } | 1317 | } |
1318 | } | 1318 | } |
1319 | 1319 | ||
1320 | static struct file_operations sg_fops = { | 1320 | static const struct file_operations sg_fops = { |
1321 | .owner = THIS_MODULE, | 1321 | .owner = THIS_MODULE, |
1322 | .read = sg_read, | 1322 | .read = sg_read, |
1323 | .write = sg_write, | 1323 | .write = sg_write, |
@@ -2194,9 +2194,11 @@ static int sg_proc_seq_show_int(struct seq_file *s, void *v); | |||
2194 | static int sg_proc_single_open_adio(struct inode *inode, struct file *file); | 2194 | static int sg_proc_single_open_adio(struct inode *inode, struct file *file); |
2195 | static ssize_t sg_proc_write_adio(struct file *filp, const char __user *buffer, | 2195 | static ssize_t sg_proc_write_adio(struct file *filp, const char __user *buffer, |
2196 | size_t count, loff_t *off); | 2196 | size_t count, loff_t *off); |
2197 | static struct file_operations adio_fops = { | 2197 | static const struct file_operations adio_fops = { |
2198 | /* .owner, .read and .llseek added in sg_proc_init() */ | 2198 | .owner = THIS_MODULE, |
2199 | .open = sg_proc_single_open_adio, | 2199 | .open = sg_proc_single_open_adio, |
2200 | .read = seq_read, | ||
2201 | .llseek = seq_lseek, | ||
2200 | .write = sg_proc_write_adio, | 2202 | .write = sg_proc_write_adio, |
2201 | .release = single_release, | 2203 | .release = single_release, |
2202 | }; | 2204 | }; |
@@ -2204,23 +2206,32 @@ static struct file_operations adio_fops = { | |||
2204 | static int sg_proc_single_open_dressz(struct inode *inode, struct file *file); | 2206 | static int sg_proc_single_open_dressz(struct inode *inode, struct file *file); |
2205 | static ssize_t sg_proc_write_dressz(struct file *filp, | 2207 | static ssize_t sg_proc_write_dressz(struct file *filp, |
2206 | const char __user *buffer, size_t count, loff_t *off); | 2208 | const char __user *buffer, size_t count, loff_t *off); |
2207 | static struct file_operations dressz_fops = { | 2209 | static const struct file_operations dressz_fops = { |
2210 | .owner = THIS_MODULE, | ||
2208 | .open = sg_proc_single_open_dressz, | 2211 | .open = sg_proc_single_open_dressz, |
2212 | .read = seq_read, | ||
2213 | .llseek = seq_lseek, | ||
2209 | .write = sg_proc_write_dressz, | 2214 | .write = sg_proc_write_dressz, |
2210 | .release = single_release, | 2215 | .release = single_release, |
2211 | }; | 2216 | }; |
2212 | 2217 | ||
2213 | static int sg_proc_seq_show_version(struct seq_file *s, void *v); | 2218 | static int sg_proc_seq_show_version(struct seq_file *s, void *v); |
2214 | static int sg_proc_single_open_version(struct inode *inode, struct file *file); | 2219 | static int sg_proc_single_open_version(struct inode *inode, struct file *file); |
2215 | static struct file_operations version_fops = { | 2220 | static const struct file_operations version_fops = { |
2221 | .owner = THIS_MODULE, | ||
2216 | .open = sg_proc_single_open_version, | 2222 | .open = sg_proc_single_open_version, |
2223 | .read = seq_read, | ||
2224 | .llseek = seq_lseek, | ||
2217 | .release = single_release, | 2225 | .release = single_release, |
2218 | }; | 2226 | }; |
2219 | 2227 | ||
2220 | static int sg_proc_seq_show_devhdr(struct seq_file *s, void *v); | 2228 | static int sg_proc_seq_show_devhdr(struct seq_file *s, void *v); |
2221 | static int sg_proc_single_open_devhdr(struct inode *inode, struct file *file); | 2229 | static int sg_proc_single_open_devhdr(struct inode *inode, struct file *file); |
2222 | static struct file_operations devhdr_fops = { | 2230 | static const struct file_operations devhdr_fops = { |
2231 | .owner = THIS_MODULE, | ||
2223 | .open = sg_proc_single_open_devhdr, | 2232 | .open = sg_proc_single_open_devhdr, |
2233 | .read = seq_read, | ||
2234 | .llseek = seq_lseek, | ||
2224 | .release = single_release, | 2235 | .release = single_release, |
2225 | }; | 2236 | }; |
2226 | 2237 | ||
@@ -2229,8 +2240,11 @@ static int sg_proc_open_dev(struct inode *inode, struct file *file); | |||
2229 | static void * dev_seq_start(struct seq_file *s, loff_t *pos); | 2240 | static void * dev_seq_start(struct seq_file *s, loff_t *pos); |
2230 | static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos); | 2241 | static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos); |
2231 | static void dev_seq_stop(struct seq_file *s, void *v); | 2242 | static void dev_seq_stop(struct seq_file *s, void *v); |
2232 | static struct file_operations dev_fops = { | 2243 | static const struct file_operations dev_fops = { |
2244 | .owner = THIS_MODULE, | ||
2233 | .open = sg_proc_open_dev, | 2245 | .open = sg_proc_open_dev, |
2246 | .read = seq_read, | ||
2247 | .llseek = seq_lseek, | ||
2234 | .release = seq_release, | 2248 | .release = seq_release, |
2235 | }; | 2249 | }; |
2236 | static const struct seq_operations dev_seq_ops = { | 2250 | static const struct seq_operations dev_seq_ops = { |
@@ -2242,8 +2256,11 @@ static const struct seq_operations dev_seq_ops = { | |||
2242 | 2256 | ||
2243 | static int sg_proc_seq_show_devstrs(struct seq_file *s, void *v); | 2257 | static int sg_proc_seq_show_devstrs(struct seq_file *s, void *v); |
2244 | static int sg_proc_open_devstrs(struct inode *inode, struct file *file); | 2258 | static int sg_proc_open_devstrs(struct inode *inode, struct file *file); |
2245 | static struct file_operations devstrs_fops = { | 2259 | static const struct file_operations devstrs_fops = { |
2260 | .owner = THIS_MODULE, | ||
2246 | .open = sg_proc_open_devstrs, | 2261 | .open = sg_proc_open_devstrs, |
2262 | .read = seq_read, | ||
2263 | .llseek = seq_lseek, | ||
2247 | .release = seq_release, | 2264 | .release = seq_release, |
2248 | }; | 2265 | }; |
2249 | static const struct seq_operations devstrs_seq_ops = { | 2266 | static const struct seq_operations devstrs_seq_ops = { |
@@ -2255,8 +2272,11 @@ static const struct seq_operations devstrs_seq_ops = { | |||
2255 | 2272 | ||
2256 | static int sg_proc_seq_show_debug(struct seq_file *s, void *v); | 2273 | static int sg_proc_seq_show_debug(struct seq_file *s, void *v); |
2257 | static int sg_proc_open_debug(struct inode *inode, struct file *file); | 2274 | static int sg_proc_open_debug(struct inode *inode, struct file *file); |
2258 | static struct file_operations debug_fops = { | 2275 | static const struct file_operations debug_fops = { |
2276 | .owner = THIS_MODULE, | ||
2259 | .open = sg_proc_open_debug, | 2277 | .open = sg_proc_open_debug, |
2278 | .read = seq_read, | ||
2279 | .llseek = seq_lseek, | ||
2260 | .release = seq_release, | 2280 | .release = seq_release, |
2261 | }; | 2281 | }; |
2262 | static const struct seq_operations debug_seq_ops = { | 2282 | static const struct seq_operations debug_seq_ops = { |
@@ -2269,7 +2289,7 @@ static const struct seq_operations debug_seq_ops = { | |||
2269 | 2289 | ||
2270 | struct sg_proc_leaf { | 2290 | struct sg_proc_leaf { |
2271 | const char * name; | 2291 | const char * name; |
2272 | struct file_operations * fops; | 2292 | const struct file_operations * fops; |
2273 | }; | 2293 | }; |
2274 | 2294 | ||
2275 | static struct sg_proc_leaf sg_proc_leaf_arr[] = { | 2295 | static struct sg_proc_leaf sg_proc_leaf_arr[] = { |
@@ -2295,9 +2315,6 @@ sg_proc_init(void) | |||
2295 | for (k = 0; k < num_leaves; ++k) { | 2315 | for (k = 0; k < num_leaves; ++k) { |
2296 | leaf = &sg_proc_leaf_arr[k]; | 2316 | leaf = &sg_proc_leaf_arr[k]; |
2297 | mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; | 2317 | mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; |
2298 | leaf->fops->owner = THIS_MODULE; | ||
2299 | leaf->fops->read = seq_read; | ||
2300 | leaf->fops->llseek = seq_lseek; | ||
2301 | proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); | 2318 | proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); |
2302 | } | 2319 | } |
2303 | return 0; | 2320 | return 0; |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index f921bd1109e1..5d23983f02fc 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -537,7 +537,7 @@ static int spidev_release(struct inode *inode, struct file *filp) | |||
537 | return status; | 537 | return status; |
538 | } | 538 | } |
539 | 539 | ||
540 | static struct file_operations spidev_fops = { | 540 | static const struct file_operations spidev_fops = { |
541 | .owner = THIS_MODULE, | 541 | .owner = THIS_MODULE, |
542 | /* REVISIT switch to aio primitives, so that userspace | 542 | /* REVISIT switch to aio primitives, so that userspace |
543 | * gets more complete API coverage. It'll simplify things | 543 | * gets more complete API coverage. It'll simplify things |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 333ee02e7b2b..864f0ba6a344 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -993,7 +993,7 @@ skip_io_on_zombie: | |||
993 | return retval; | 993 | return retval; |
994 | } | 994 | } |
995 | 995 | ||
996 | static struct file_operations fops = { | 996 | static const struct file_operations fops = { |
997 | .owner = THIS_MODULE, | 997 | .owner = THIS_MODULE, |
998 | .read = usbtmc_read, | 998 | .read = usbtmc_read, |
999 | .write = usbtmc_write, | 999 | .write = usbtmc_write, |
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 29500154d00c..2d867fd22413 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
@@ -875,7 +875,7 @@ printer_ioctl(struct file *fd, unsigned int code, unsigned long arg) | |||
875 | } | 875 | } |
876 | 876 | ||
877 | /* used after endpoint configuration */ | 877 | /* used after endpoint configuration */ |
878 | static struct file_operations printer_io_operations = { | 878 | static const struct file_operations printer_io_operations = { |
879 | .owner = THIS_MODULE, | 879 | .owner = THIS_MODULE, |
880 | .open = printer_open, | 880 | .open = printer_open, |
881 | .read = printer_read, | 881 | .read = printer_read, |
diff --git a/drivers/usb/host/whci/debug.c b/drivers/usb/host/whci/debug.c index cf2d45946c57..2273c815941f 100644 --- a/drivers/usb/host/whci/debug.c +++ b/drivers/usb/host/whci/debug.c | |||
@@ -134,7 +134,7 @@ static int pzl_open(struct inode *inode, struct file *file) | |||
134 | return single_open(file, pzl_print, inode->i_private); | 134 | return single_open(file, pzl_print, inode->i_private); |
135 | } | 135 | } |
136 | 136 | ||
137 | static struct file_operations di_fops = { | 137 | static const struct file_operations di_fops = { |
138 | .open = di_open, | 138 | .open = di_open, |
139 | .read = seq_read, | 139 | .read = seq_read, |
140 | .llseek = seq_lseek, | 140 | .llseek = seq_lseek, |
@@ -142,7 +142,7 @@ static struct file_operations di_fops = { | |||
142 | .owner = THIS_MODULE, | 142 | .owner = THIS_MODULE, |
143 | }; | 143 | }; |
144 | 144 | ||
145 | static struct file_operations asl_fops = { | 145 | static const struct file_operations asl_fops = { |
146 | .open = asl_open, | 146 | .open = asl_open, |
147 | .read = seq_read, | 147 | .read = seq_read, |
148 | .llseek = seq_lseek, | 148 | .llseek = seq_lseek, |
@@ -150,7 +150,7 @@ static struct file_operations asl_fops = { | |||
150 | .owner = THIS_MODULE, | 150 | .owner = THIS_MODULE, |
151 | }; | 151 | }; |
152 | 152 | ||
153 | static struct file_operations pzl_fops = { | 153 | static const struct file_operations pzl_fops = { |
154 | .open = pzl_open, | 154 | .open = pzl_open, |
155 | .read = seq_read, | 155 | .read = seq_read, |
156 | .llseek = seq_lseek, | 156 | .llseek = seq_lseek, |
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index d645f3899fe1..32d0199d0c32 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c | |||
@@ -429,8 +429,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) | |||
429 | return read_count; | 429 | return read_count; |
430 | } | 430 | } |
431 | 431 | ||
432 | static struct | 432 | static const struct file_operations usb_rio_fops = { |
433 | file_operations usb_rio_fops = { | ||
434 | .owner = THIS_MODULE, | 433 | .owner = THIS_MODULE, |
435 | .read = read_rio, | 434 | .read = read_rio, |
436 | .write = write_rio, | 435 | .write = write_rio, |
diff --git a/drivers/uwb/uwb-debug.c b/drivers/uwb/uwb-debug.c index 4a42993700c1..2eecec0c13c9 100644 --- a/drivers/uwb/uwb-debug.c +++ b/drivers/uwb/uwb-debug.c | |||
@@ -205,7 +205,7 @@ static ssize_t command_write(struct file *file, const char __user *buf, | |||
205 | return ret < 0 ? ret : len; | 205 | return ret < 0 ? ret : len; |
206 | } | 206 | } |
207 | 207 | ||
208 | static struct file_operations command_fops = { | 208 | static const struct file_operations command_fops = { |
209 | .open = command_open, | 209 | .open = command_open, |
210 | .write = command_write, | 210 | .write = command_write, |
211 | .read = NULL, | 211 | .read = NULL, |
@@ -255,7 +255,7 @@ static int reservations_open(struct inode *inode, struct file *file) | |||
255 | return single_open(file, reservations_print, inode->i_private); | 255 | return single_open(file, reservations_print, inode->i_private); |
256 | } | 256 | } |
257 | 257 | ||
258 | static struct file_operations reservations_fops = { | 258 | static const struct file_operations reservations_fops = { |
259 | .open = reservations_open, | 259 | .open = reservations_open, |
260 | .read = seq_read, | 260 | .read = seq_read, |
261 | .llseek = seq_lseek, | 261 | .llseek = seq_lseek, |
@@ -283,7 +283,7 @@ static int drp_avail_open(struct inode *inode, struct file *file) | |||
283 | return single_open(file, drp_avail_print, inode->i_private); | 283 | return single_open(file, drp_avail_print, inode->i_private); |
284 | } | 284 | } |
285 | 285 | ||
286 | static struct file_operations drp_avail_fops = { | 286 | static const struct file_operations drp_avail_fops = { |
287 | .open = drp_avail_open, | 287 | .open = drp_avail_open, |
288 | .read = seq_read, | 288 | .read = seq_read, |
289 | .llseek = seq_lseek, | 289 | .llseek = seq_lseek, |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 80599b4e42bd..4484eb3408af 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2326,7 +2326,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); | |||
2326 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, | 2326 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, |
2327 | int skip_pinned); | 2327 | int skip_pinned); |
2328 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); | 2328 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); |
2329 | extern struct file_operations btrfs_file_operations; | 2329 | extern const struct file_operations btrfs_file_operations; |
2330 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, | 2330 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, |
2331 | struct btrfs_root *root, struct inode *inode, | 2331 | struct btrfs_root *root, struct inode *inode, |
2332 | u64 start, u64 end, u64 locked_end, | 2332 | u64 start, u64 end, u64 locked_end, |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index a3492a3ad96b..9ed17dbe5c6e 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1196,7 +1196,7 @@ static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1196 | return 0; | 1196 | return 0; |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | struct file_operations btrfs_file_operations = { | 1199 | const struct file_operations btrfs_file_operations = { |
1200 | .llseek = generic_file_llseek, | 1200 | .llseek = generic_file_llseek, |
1201 | .read = do_sync_read, | 1201 | .read = do_sync_read, |
1202 | .aio_read = generic_file_aio_read, | 1202 | .aio_read = generic_file_aio_read, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e9b76bcd1c12..b9fe06d751c0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -62,7 +62,7 @@ static const struct inode_operations btrfs_special_inode_operations; | |||
62 | static const struct inode_operations btrfs_file_inode_operations; | 62 | static const struct inode_operations btrfs_file_inode_operations; |
63 | static const struct address_space_operations btrfs_aops; | 63 | static const struct address_space_operations btrfs_aops; |
64 | static const struct address_space_operations btrfs_symlink_aops; | 64 | static const struct address_space_operations btrfs_symlink_aops; |
65 | static struct file_operations btrfs_dir_file_operations; | 65 | static const struct file_operations btrfs_dir_file_operations; |
66 | static struct extent_io_ops btrfs_extent_io_ops; | 66 | static struct extent_io_ops btrfs_extent_io_ops; |
67 | 67 | ||
68 | static struct kmem_cache *btrfs_inode_cachep; | 68 | static struct kmem_cache *btrfs_inode_cachep; |
@@ -5544,7 +5544,7 @@ static const struct inode_operations btrfs_dir_ro_inode_operations = { | |||
5544 | .permission = btrfs_permission, | 5544 | .permission = btrfs_permission, |
5545 | }; | 5545 | }; |
5546 | 5546 | ||
5547 | static struct file_operations btrfs_dir_file_operations = { | 5547 | static const struct file_operations btrfs_dir_file_operations = { |
5548 | .llseek = generic_file_llseek, | 5548 | .llseek = generic_file_llseek, |
5549 | .read = generic_read_dir, | 5549 | .read = generic_read_dir, |
5550 | .readdir = btrfs_real_readdir, | 5550 | .readdir = btrfs_real_readdir, |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 761af77491f5..b0ab5219becb 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -770,7 +770,7 @@ static int jbd2_seq_info_release(struct inode *inode, struct file *file) | |||
770 | return seq_release(inode, file); | 770 | return seq_release(inode, file); |
771 | } | 771 | } |
772 | 772 | ||
773 | static struct file_operations jbd2_seq_info_fops = { | 773 | static const struct file_operations jbd2_seq_info_fops = { |
774 | .owner = THIS_MODULE, | 774 | .owner = THIS_MODULE, |
775 | .open = jbd2_seq_info_open, | 775 | .open = jbd2_seq_info_open, |
776 | .read = seq_read, | 776 | .read = seq_read, |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 00388d2a3c99..5c01fc148ce8 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -176,7 +176,7 @@ static const struct file_operations exports_operations = { | |||
176 | extern int nfsd_pool_stats_open(struct inode *inode, struct file *file); | 176 | extern int nfsd_pool_stats_open(struct inode *inode, struct file *file); |
177 | extern int nfsd_pool_stats_release(struct inode *inode, struct file *file); | 177 | extern int nfsd_pool_stats_release(struct inode *inode, struct file *file); |
178 | 178 | ||
179 | static struct file_operations pool_stats_operations = { | 179 | static const struct file_operations pool_stats_operations = { |
180 | .open = nfsd_pool_stats_open, | 180 | .open = nfsd_pool_stats_open, |
181 | .read = seq_read, | 181 | .read = seq_read, |
182 | .llseek = seq_lseek, | 182 | .llseek = seq_lseek, |
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index 1a4fa04cf071..e097099bfc8f 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c | |||
@@ -697,7 +697,7 @@ not_empty: | |||
697 | return 0; | 697 | return 0; |
698 | } | 698 | } |
699 | 699 | ||
700 | struct file_operations nilfs_dir_operations = { | 700 | const struct file_operations nilfs_dir_operations = { |
701 | .llseek = generic_file_llseek, | 701 | .llseek = generic_file_llseek, |
702 | .read = generic_read_dir, | 702 | .read = generic_read_dir, |
703 | .readdir = nilfs_readdir, | 703 | .readdir = nilfs_readdir, |
diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c index 7d7b4983dee3..30292df443ce 100644 --- a/fs/nilfs2/file.c +++ b/fs/nilfs2/file.c | |||
@@ -134,7 +134,7 @@ static int nilfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
134 | * We have mostly NULL's here: the current defaults are ok for | 134 | * We have mostly NULL's here: the current defaults are ok for |
135 | * the nilfs filesystem. | 135 | * the nilfs filesystem. |
136 | */ | 136 | */ |
137 | struct file_operations nilfs_file_operations = { | 137 | const struct file_operations nilfs_file_operations = { |
138 | .llseek = generic_file_llseek, | 138 | .llseek = generic_file_llseek, |
139 | .read = do_sync_read, | 139 | .read = do_sync_read, |
140 | .write = do_sync_write, | 140 | .write = do_sync_write, |
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index b18c4998f8d0..f6326112d647 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
@@ -433,7 +433,7 @@ static const struct address_space_operations def_mdt_aops = { | |||
433 | }; | 433 | }; |
434 | 434 | ||
435 | static const struct inode_operations def_mdt_iops; | 435 | static const struct inode_operations def_mdt_iops; |
436 | static struct file_operations def_mdt_fops; | 436 | static const struct file_operations def_mdt_fops; |
437 | 437 | ||
438 | /* | 438 | /* |
439 | * NILFS2 uses pseudo inodes for meta data files such as DAT, cpfile, sufile, | 439 | * NILFS2 uses pseudo inodes for meta data files such as DAT, cpfile, sufile, |
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index bad7368782d0..4da6f67e9a91 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
@@ -294,9 +294,9 @@ void nilfs_clear_gcdat_inode(struct the_nilfs *); | |||
294 | /* | 294 | /* |
295 | * Inodes and files operations | 295 | * Inodes and files operations |
296 | */ | 296 | */ |
297 | extern struct file_operations nilfs_dir_operations; | 297 | extern const struct file_operations nilfs_dir_operations; |
298 | extern const struct inode_operations nilfs_file_inode_operations; | 298 | extern const struct inode_operations nilfs_file_inode_operations; |
299 | extern struct file_operations nilfs_file_operations; | 299 | extern const struct file_operations nilfs_file_operations; |
300 | extern const struct address_space_operations nilfs_aops; | 300 | extern const struct address_space_operations nilfs_aops; |
301 | extern const struct inode_operations nilfs_dir_inode_operations; | 301 | extern const struct inode_operations nilfs_dir_inode_operations; |
302 | extern const struct inode_operations nilfs_special_inode_operations; | 302 | extern const struct inode_operations nilfs_special_inode_operations; |
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 09cc25d04611..c452d116b892 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -966,7 +966,7 @@ static ssize_t o2hb_debug_read(struct file *file, char __user *buf, | |||
966 | } | 966 | } |
967 | #endif /* CONFIG_DEBUG_FS */ | 967 | #endif /* CONFIG_DEBUG_FS */ |
968 | 968 | ||
969 | static struct file_operations o2hb_debug_fops = { | 969 | static const struct file_operations o2hb_debug_fops = { |
970 | .open = o2hb_debug_open, | 970 | .open = o2hb_debug_open, |
971 | .release = o2hb_debug_release, | 971 | .release = o2hb_debug_release, |
972 | .read = o2hb_debug_read, | 972 | .read = o2hb_debug_read, |
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index cfb2be708abe..da794bc07a6c 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c | |||
@@ -207,7 +207,7 @@ static int nst_fop_release(struct inode *inode, struct file *file) | |||
207 | return seq_release_private(inode, file); | 207 | return seq_release_private(inode, file); |
208 | } | 208 | } |
209 | 209 | ||
210 | static struct file_operations nst_seq_fops = { | 210 | static const struct file_operations nst_seq_fops = { |
211 | .open = nst_fop_open, | 211 | .open = nst_fop_open, |
212 | .read = seq_read, | 212 | .read = seq_read, |
213 | .llseek = seq_lseek, | 213 | .llseek = seq_lseek, |
@@ -388,7 +388,7 @@ static int sc_fop_release(struct inode *inode, struct file *file) | |||
388 | return seq_release_private(inode, file); | 388 | return seq_release_private(inode, file); |
389 | } | 389 | } |
390 | 390 | ||
391 | static struct file_operations sc_seq_fops = { | 391 | static const struct file_operations sc_seq_fops = { |
392 | .open = sc_fop_open, | 392 | .open = sc_fop_open, |
393 | .read = seq_read, | 393 | .read = seq_read, |
394 | .llseek = seq_lseek, | 394 | .llseek = seq_lseek, |
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index ca46002ec10e..42b0bad7a612 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c | |||
@@ -478,7 +478,7 @@ bail: | |||
478 | return -ENOMEM; | 478 | return -ENOMEM; |
479 | } | 479 | } |
480 | 480 | ||
481 | static struct file_operations debug_purgelist_fops = { | 481 | static const struct file_operations debug_purgelist_fops = { |
482 | .open = debug_purgelist_open, | 482 | .open = debug_purgelist_open, |
483 | .release = debug_buffer_release, | 483 | .release = debug_buffer_release, |
484 | .read = debug_buffer_read, | 484 | .read = debug_buffer_read, |
@@ -538,7 +538,7 @@ bail: | |||
538 | return -ENOMEM; | 538 | return -ENOMEM; |
539 | } | 539 | } |
540 | 540 | ||
541 | static struct file_operations debug_mle_fops = { | 541 | static const struct file_operations debug_mle_fops = { |
542 | .open = debug_mle_open, | 542 | .open = debug_mle_open, |
543 | .release = debug_buffer_release, | 543 | .release = debug_buffer_release, |
544 | .read = debug_buffer_read, | 544 | .read = debug_buffer_read, |
@@ -741,7 +741,7 @@ static int debug_lockres_release(struct inode *inode, struct file *file) | |||
741 | return seq_release_private(inode, file); | 741 | return seq_release_private(inode, file); |
742 | } | 742 | } |
743 | 743 | ||
744 | static struct file_operations debug_lockres_fops = { | 744 | static const struct file_operations debug_lockres_fops = { |
745 | .open = debug_lockres_open, | 745 | .open = debug_lockres_open, |
746 | .release = debug_lockres_release, | 746 | .release = debug_lockres_release, |
747 | .read = seq_read, | 747 | .read = seq_read, |
@@ -925,7 +925,7 @@ bail: | |||
925 | return -ENOMEM; | 925 | return -ENOMEM; |
926 | } | 926 | } |
927 | 927 | ||
928 | static struct file_operations debug_state_fops = { | 928 | static const struct file_operations debug_state_fops = { |
929 | .open = debug_state_open, | 929 | .open = debug_state_open, |
930 | .release = debug_buffer_release, | 930 | .release = debug_buffer_release, |
931 | .read = debug_buffer_read, | 931 | .read = debug_buffer_read, |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 4cc3c890a2cd..c0e48aeebb1c 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -373,7 +373,7 @@ static ssize_t ocfs2_debug_read(struct file *file, char __user *buf, | |||
373 | } | 373 | } |
374 | #endif /* CONFIG_DEBUG_FS */ | 374 | #endif /* CONFIG_DEBUG_FS */ |
375 | 375 | ||
376 | static struct file_operations ocfs2_osb_debug_fops = { | 376 | static const struct file_operations ocfs2_osb_debug_fops = { |
377 | .open = ocfs2_osb_debug_open, | 377 | .open = ocfs2_osb_debug_open, |
378 | .release = ocfs2_debug_release, | 378 | .release = ocfs2_debug_release, |
379 | .read = ocfs2_debug_read, | 379 | .read = ocfs2_debug_read, |
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index 3680bae335b5..b42d62419034 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c | |||
@@ -498,7 +498,7 @@ const struct inode_operations omfs_dir_inops = { | |||
498 | .rmdir = omfs_rmdir, | 498 | .rmdir = omfs_rmdir, |
499 | }; | 499 | }; |
500 | 500 | ||
501 | struct file_operations omfs_dir_operations = { | 501 | const struct file_operations omfs_dir_operations = { |
502 | .read = generic_read_dir, | 502 | .read = generic_read_dir, |
503 | .readdir = omfs_readdir, | 503 | .readdir = omfs_readdir, |
504 | .llseek = generic_file_llseek, | 504 | .llseek = generic_file_llseek, |
diff --git a/fs/omfs/file.c b/fs/omfs/file.c index 4845fbb18e6e..399487c09364 100644 --- a/fs/omfs/file.c +++ b/fs/omfs/file.c | |||
@@ -322,7 +322,7 @@ static sector_t omfs_bmap(struct address_space *mapping, sector_t block) | |||
322 | return generic_block_bmap(mapping, block, omfs_get_block); | 322 | return generic_block_bmap(mapping, block, omfs_get_block); |
323 | } | 323 | } |
324 | 324 | ||
325 | struct file_operations omfs_file_operations = { | 325 | const struct file_operations omfs_file_operations = { |
326 | .llseek = generic_file_llseek, | 326 | .llseek = generic_file_llseek, |
327 | .read = do_sync_read, | 327 | .read = do_sync_read, |
328 | .write = do_sync_write, | 328 | .write = do_sync_write, |
diff --git a/fs/omfs/omfs.h b/fs/omfs/omfs.h index df71039945ac..ebe2fdbe535e 100644 --- a/fs/omfs/omfs.h +++ b/fs/omfs/omfs.h | |||
@@ -44,14 +44,14 @@ extern int omfs_allocate_range(struct super_block *sb, int min_request, | |||
44 | extern int omfs_clear_range(struct super_block *sb, u64 block, int count); | 44 | extern int omfs_clear_range(struct super_block *sb, u64 block, int count); |
45 | 45 | ||
46 | /* dir.c */ | 46 | /* dir.c */ |
47 | extern struct file_operations omfs_dir_operations; | 47 | extern const struct file_operations omfs_dir_operations; |
48 | extern const struct inode_operations omfs_dir_inops; | 48 | extern const struct inode_operations omfs_dir_inops; |
49 | extern int omfs_make_empty(struct inode *inode, struct super_block *sb); | 49 | extern int omfs_make_empty(struct inode *inode, struct super_block *sb); |
50 | extern int omfs_is_bad(struct omfs_sb_info *sbi, struct omfs_header *header, | 50 | extern int omfs_is_bad(struct omfs_sb_info *sbi, struct omfs_header *header, |
51 | u64 fsblock); | 51 | u64 fsblock); |
52 | 52 | ||
53 | /* file.c */ | 53 | /* file.c */ |
54 | extern struct file_operations omfs_file_operations; | 54 | extern const struct file_operations omfs_file_operations; |
55 | extern const struct inode_operations omfs_file_inops; | 55 | extern const struct inode_operations omfs_file_inops; |
56 | extern const struct address_space_operations omfs_aops; | 56 | extern const struct address_space_operations omfs_aops; |
57 | extern void omfs_make_empty_table(struct buffer_head *bh, int offset); | 57 | extern void omfs_make_empty_table(struct buffer_head *bh, int offset); |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index b62bb9294d0c..0008dee66514 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -37,7 +37,7 @@ extern void cgroup_exit(struct task_struct *p, int run_callbacks); | |||
37 | extern int cgroupstats_build(struct cgroupstats *stats, | 37 | extern int cgroupstats_build(struct cgroupstats *stats, |
38 | struct dentry *dentry); | 38 | struct dentry *dentry); |
39 | 39 | ||
40 | extern struct file_operations proc_cgroup_operations; | 40 | extern const struct file_operations proc_cgroup_operations; |
41 | 41 | ||
42 | /* Define the enumeration of all cgroup subsystems */ | 42 | /* Define the enumeration of all cgroup subsystems */ |
43 | #define SUBSYS(_x) _x ## _subsys_id, | 43 | #define SUBSYS(_x) _x ## _subsys_id, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 2adaa2529f18..a1e6899d4b6c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2446,7 +2446,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \ | |||
2446 | __simple_attr_check_format(__fmt, 0ull); \ | 2446 | __simple_attr_check_format(__fmt, 0ull); \ |
2447 | return simple_attr_open(inode, file, __get, __set, __fmt); \ | 2447 | return simple_attr_open(inode, file, __get, __set, __fmt); \ |
2448 | } \ | 2448 | } \ |
2449 | static struct file_operations __fops = { \ | 2449 | static const struct file_operations __fops = { \ |
2450 | .owner = THIS_MODULE, \ | 2450 | .owner = THIS_MODULE, \ |
2451 | .open = __fops ## _open, \ | 2451 | .open = __fops ## _open, \ |
2452 | .release = simple_attr_release, \ | 2452 | .release = simple_attr_release, \ |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7ccba4bc5e3b..d2b88596efde 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -703,7 +703,7 @@ static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, int mode); | |||
703 | static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry); | 703 | static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry); |
704 | static int cgroup_populate_dir(struct cgroup *cgrp); | 704 | static int cgroup_populate_dir(struct cgroup *cgrp); |
705 | static const struct inode_operations cgroup_dir_inode_operations; | 705 | static const struct inode_operations cgroup_dir_inode_operations; |
706 | static struct file_operations proc_cgroupstats_operations; | 706 | static const struct file_operations proc_cgroupstats_operations; |
707 | 707 | ||
708 | static struct backing_dev_info cgroup_backing_dev_info = { | 708 | static struct backing_dev_info cgroup_backing_dev_info = { |
709 | .name = "cgroup", | 709 | .name = "cgroup", |
@@ -1863,7 +1863,7 @@ static int cgroup_seqfile_release(struct inode *inode, struct file *file) | |||
1863 | return single_release(inode, file); | 1863 | return single_release(inode, file); |
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | static struct file_operations cgroup_seqfile_operations = { | 1866 | static const struct file_operations cgroup_seqfile_operations = { |
1867 | .read = seq_read, | 1867 | .read = seq_read, |
1868 | .write = cgroup_file_write, | 1868 | .write = cgroup_file_write, |
1869 | .llseek = seq_lseek, | 1869 | .llseek = seq_lseek, |
@@ -1922,7 +1922,7 @@ static int cgroup_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1922 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry); | 1922 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry); |
1923 | } | 1923 | } |
1924 | 1924 | ||
1925 | static struct file_operations cgroup_file_operations = { | 1925 | static const struct file_operations cgroup_file_operations = { |
1926 | .read = cgroup_file_read, | 1926 | .read = cgroup_file_read, |
1927 | .write = cgroup_file_write, | 1927 | .write = cgroup_file_write, |
1928 | .llseek = generic_file_llseek, | 1928 | .llseek = generic_file_llseek, |
@@ -3369,7 +3369,7 @@ static int cgroup_open(struct inode *inode, struct file *file) | |||
3369 | return single_open(file, proc_cgroup_show, pid); | 3369 | return single_open(file, proc_cgroup_show, pid); |
3370 | } | 3370 | } |
3371 | 3371 | ||
3372 | struct file_operations proc_cgroup_operations = { | 3372 | const struct file_operations proc_cgroup_operations = { |
3373 | .open = cgroup_open, | 3373 | .open = cgroup_open, |
3374 | .read = seq_read, | 3374 | .read = seq_read, |
3375 | .llseek = seq_lseek, | 3375 | .llseek = seq_lseek, |
@@ -3398,7 +3398,7 @@ static int cgroupstats_open(struct inode *inode, struct file *file) | |||
3398 | return single_open(file, proc_cgroupstats_show, NULL); | 3398 | return single_open(file, proc_cgroupstats_show, NULL); |
3399 | } | 3399 | } |
3400 | 3400 | ||
3401 | static struct file_operations proc_cgroupstats_operations = { | 3401 | static const struct file_operations proc_cgroupstats_operations = { |
3402 | .open = cgroupstats_open, | 3402 | .open = cgroupstats_open, |
3403 | .read = seq_read, | 3403 | .read = seq_read, |
3404 | .llseek = seq_lseek, | 3404 | .llseek = seq_lseek, |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index cfadc1291d0b..5240d75f4c60 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -1333,7 +1333,7 @@ static int __kprobes kprobes_open(struct inode *inode, struct file *filp) | |||
1333 | return seq_open(filp, &kprobes_seq_ops); | 1333 | return seq_open(filp, &kprobes_seq_ops); |
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | static struct file_operations debugfs_kprobes_operations = { | 1336 | static const struct file_operations debugfs_kprobes_operations = { |
1337 | .open = kprobes_open, | 1337 | .open = kprobes_open, |
1338 | .read = seq_read, | 1338 | .read = seq_read, |
1339 | .llseek = seq_lseek, | 1339 | .llseek = seq_lseek, |
@@ -1515,7 +1515,7 @@ static ssize_t write_enabled_file_bool(struct file *file, | |||
1515 | return count; | 1515 | return count; |
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | static struct file_operations fops_kp = { | 1518 | static const struct file_operations fops_kp = { |
1519 | .read = read_enabled_file_bool, | 1519 | .read = read_enabled_file_bool, |
1520 | .write = write_enabled_file_bool, | 1520 | .write = write_enabled_file_bool, |
1521 | }; | 1521 | }; |
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index c89f5e9fd173..179e6ad80dc0 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -93,7 +93,7 @@ static int rcudata_open(struct inode *inode, struct file *file) | |||
93 | return single_open(file, show_rcudata, NULL); | 93 | return single_open(file, show_rcudata, NULL); |
94 | } | 94 | } |
95 | 95 | ||
96 | static struct file_operations rcudata_fops = { | 96 | static const struct file_operations rcudata_fops = { |
97 | .owner = THIS_MODULE, | 97 | .owner = THIS_MODULE, |
98 | .open = rcudata_open, | 98 | .open = rcudata_open, |
99 | .read = seq_read, | 99 | .read = seq_read, |
@@ -145,7 +145,7 @@ static int rcudata_csv_open(struct inode *inode, struct file *file) | |||
145 | return single_open(file, show_rcudata_csv, NULL); | 145 | return single_open(file, show_rcudata_csv, NULL); |
146 | } | 146 | } |
147 | 147 | ||
148 | static struct file_operations rcudata_csv_fops = { | 148 | static const struct file_operations rcudata_csv_fops = { |
149 | .owner = THIS_MODULE, | 149 | .owner = THIS_MODULE, |
150 | .open = rcudata_csv_open, | 150 | .open = rcudata_csv_open, |
151 | .read = seq_read, | 151 | .read = seq_read, |
@@ -196,7 +196,7 @@ static int rcuhier_open(struct inode *inode, struct file *file) | |||
196 | return single_open(file, show_rcuhier, NULL); | 196 | return single_open(file, show_rcuhier, NULL); |
197 | } | 197 | } |
198 | 198 | ||
199 | static struct file_operations rcuhier_fops = { | 199 | static const struct file_operations rcuhier_fops = { |
200 | .owner = THIS_MODULE, | 200 | .owner = THIS_MODULE, |
201 | .open = rcuhier_open, | 201 | .open = rcuhier_open, |
202 | .read = seq_read, | 202 | .read = seq_read, |
@@ -222,7 +222,7 @@ static int rcugp_open(struct inode *inode, struct file *file) | |||
222 | return single_open(file, show_rcugp, NULL); | 222 | return single_open(file, show_rcugp, NULL); |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct file_operations rcugp_fops = { | 225 | static const struct file_operations rcugp_fops = { |
226 | .owner = THIS_MODULE, | 226 | .owner = THIS_MODULE, |
227 | .open = rcugp_open, | 227 | .open = rcugp_open, |
228 | .read = seq_read, | 228 | .read = seq_read, |
@@ -276,7 +276,7 @@ static int rcu_pending_open(struct inode *inode, struct file *file) | |||
276 | return single_open(file, show_rcu_pending, NULL); | 276 | return single_open(file, show_rcu_pending, NULL); |
277 | } | 277 | } |
278 | 278 | ||
279 | static struct file_operations rcu_pending_fops = { | 279 | static const struct file_operations rcu_pending_fops = { |
280 | .owner = THIS_MODULE, | 280 | .owner = THIS_MODULE, |
281 | .open = rcu_pending_open, | 281 | .open = rcu_pending_open, |
282 | .read = seq_read, | 282 | .read = seq_read, |
diff --git a/kernel/sched.c b/kernel/sched.c index ee61f454a98b..1535f3884b88 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -780,7 +780,7 @@ static int sched_feat_open(struct inode *inode, struct file *filp) | |||
780 | return single_open(filp, sched_feat_show, NULL); | 780 | return single_open(filp, sched_feat_show, NULL); |
781 | } | 781 | } |
782 | 782 | ||
783 | static struct file_operations sched_feat_fops = { | 783 | static const struct file_operations sched_feat_fops = { |
784 | .open = sched_feat_open, | 784 | .open = sched_feat_open, |
785 | .write = sched_feat_write, | 785 | .write = sched_feat_write, |
786 | .read = seq_read, | 786 | .read = seq_read, |
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index fddd69d16e03..1b5b7aa2fdfd 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -275,7 +275,7 @@ static int timer_list_open(struct inode *inode, struct file *filp) | |||
275 | return single_open(filp, timer_list_show, NULL); | 275 | return single_open(filp, timer_list_show, NULL); |
276 | } | 276 | } |
277 | 277 | ||
278 | static struct file_operations timer_list_fops = { | 278 | static const struct file_operations timer_list_fops = { |
279 | .open = timer_list_open, | 279 | .open = timer_list_open, |
280 | .read = seq_read, | 280 | .read = seq_read, |
281 | .llseek = seq_lseek, | 281 | .llseek = seq_lseek, |
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c index 4cde8b9c716f..ee5681f8d7ec 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c | |||
@@ -395,7 +395,7 @@ static int tstats_open(struct inode *inode, struct file *filp) | |||
395 | return single_open(filp, tstats_show, NULL); | 395 | return single_open(filp, tstats_show, NULL); |
396 | } | 396 | } |
397 | 397 | ||
398 | static struct file_operations tstats_fops = { | 398 | static const struct file_operations tstats_fops = { |
399 | .open = tstats_open, | 399 | .open = tstats_open, |
400 | .read = seq_read, | 400 | .read = seq_read, |
401 | .write = tstats_write, | 401 | .write = tstats_write, |
diff --git a/samples/tracepoints/tracepoint-sample.c b/samples/tracepoints/tracepoint-sample.c index 9cf80a11e8b6..26fab33ffa8c 100644 --- a/samples/tracepoints/tracepoint-sample.c +++ b/samples/tracepoints/tracepoint-sample.c | |||
@@ -28,7 +28,7 @@ static int my_open(struct inode *inode, struct file *file) | |||
28 | return -EPERM; | 28 | return -EPERM; |
29 | } | 29 | } |
30 | 30 | ||
31 | static struct file_operations mark_ops = { | 31 | static const struct file_operations mark_ops = { |
32 | .open = my_open, | 32 | .open = my_open, |
33 | }; | 33 | }; |
34 | 34 | ||
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index 8e9777b76405..0c72c9c38956 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c | |||
@@ -43,7 +43,7 @@ static ssize_t ima_show_htable_violations(struct file *filp, | |||
43 | return ima_show_htable_value(buf, count, ppos, &ima_htable.violations); | 43 | return ima_show_htable_value(buf, count, ppos, &ima_htable.violations); |
44 | } | 44 | } |
45 | 45 | ||
46 | static struct file_operations ima_htable_violations_ops = { | 46 | static const struct file_operations ima_htable_violations_ops = { |
47 | .read = ima_show_htable_violations | 47 | .read = ima_show_htable_violations |
48 | }; | 48 | }; |
49 | 49 | ||
@@ -55,7 +55,7 @@ static ssize_t ima_show_measurements_count(struct file *filp, | |||
55 | 55 | ||
56 | } | 56 | } |
57 | 57 | ||
58 | static struct file_operations ima_measurements_count_ops = { | 58 | static const struct file_operations ima_measurements_count_ops = { |
59 | .read = ima_show_measurements_count | 59 | .read = ima_show_measurements_count |
60 | }; | 60 | }; |
61 | 61 | ||
@@ -158,7 +158,7 @@ static int ima_measurements_open(struct inode *inode, struct file *file) | |||
158 | return seq_open(file, &ima_measurments_seqops); | 158 | return seq_open(file, &ima_measurments_seqops); |
159 | } | 159 | } |
160 | 160 | ||
161 | static struct file_operations ima_measurements_ops = { | 161 | static const struct file_operations ima_measurements_ops = { |
162 | .open = ima_measurements_open, | 162 | .open = ima_measurements_open, |
163 | .read = seq_read, | 163 | .read = seq_read, |
164 | .llseek = seq_lseek, | 164 | .llseek = seq_lseek, |
@@ -233,7 +233,7 @@ static int ima_ascii_measurements_open(struct inode *inode, struct file *file) | |||
233 | return seq_open(file, &ima_ascii_measurements_seqops); | 233 | return seq_open(file, &ima_ascii_measurements_seqops); |
234 | } | 234 | } |
235 | 235 | ||
236 | static struct file_operations ima_ascii_measurements_ops = { | 236 | static const struct file_operations ima_ascii_measurements_ops = { |
237 | .open = ima_ascii_measurements_open, | 237 | .open = ima_ascii_measurements_open, |
238 | .read = seq_read, | 238 | .read = seq_read, |
239 | .llseek = seq_lseek, | 239 | .llseek = seq_lseek, |
@@ -313,7 +313,7 @@ static int ima_release_policy(struct inode *inode, struct file *file) | |||
313 | return 0; | 313 | return 0; |
314 | } | 314 | } |
315 | 315 | ||
316 | static struct file_operations ima_measure_policy_ops = { | 316 | static const struct file_operations ima_measure_policy_ops = { |
317 | .open = ima_open_policy, | 317 | .open = ima_open_policy, |
318 | .write = ima_write_policy, | 318 | .write = ima_write_policy, |
319 | .release = ima_release_policy | 319 | .release = ima_release_policy |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index b5e7e3f1183f..e79c54034bcd 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -2625,7 +2625,7 @@ static int vcpu_stat_get(void *_offset, u64 *val) | |||
2625 | 2625 | ||
2626 | DEFINE_SIMPLE_ATTRIBUTE(vcpu_stat_fops, vcpu_stat_get, NULL, "%llu\n"); | 2626 | DEFINE_SIMPLE_ATTRIBUTE(vcpu_stat_fops, vcpu_stat_get, NULL, "%llu\n"); |
2627 | 2627 | ||
2628 | static struct file_operations *stat_fops[] = { | 2628 | static const struct file_operations *stat_fops[] = { |
2629 | [KVM_STAT_VCPU] = &vcpu_stat_fops, | 2629 | [KVM_STAT_VCPU] = &vcpu_stat_fops, |
2630 | [KVM_STAT_VM] = &vm_stat_fops, | 2630 | [KVM_STAT_VM] = &vm_stat_fops, |
2631 | }; | 2631 | }; |