Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

const: make block_device_operations const

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
83d5cde4 7b021967

+59 -61
+1 -1
arch/powerpc/sysdev/axonram.c
··· 165 165 return 0; 166 166 } 167 167 168 - static struct block_device_operations axon_ram_devops = { 168 + static const struct block_device_operations axon_ram_devops = { 169 169 .owner = THIS_MODULE, 170 170 .direct_access = axon_ram_direct_access 171 171 };
+1 -1
arch/um/drivers/ubd_kern.c
··· 106 106 107 107 #define MAX_DEV (16) 108 108 109 - static struct block_device_operations ubd_blops = { 109 + static const struct block_device_operations ubd_blops = { 110 110 .owner = THIS_MODULE, 111 111 .open = ubd_open, 112 112 .release = ubd_release,
+1 -1
drivers/block/DAC960.c
··· 152 152 return 0; 153 153 } 154 154 155 - static struct block_device_operations DAC960_BlockDeviceOperations = { 155 + static const struct block_device_operations DAC960_BlockDeviceOperations = { 156 156 .owner = THIS_MODULE, 157 157 .open = DAC960_open, 158 158 .getgeo = DAC960_getgeo,
+1 -1
drivers/block/amiflop.c
··· 1632 1632 return 0; 1633 1633 } 1634 1634 1635 - static struct block_device_operations floppy_fops = { 1635 + static const struct block_device_operations floppy_fops = { 1636 1636 .owner = THIS_MODULE, 1637 1637 .open = floppy_open, 1638 1638 .release = floppy_release,
+1 -1
drivers/block/aoe/aoeblk.c
··· 237 237 return 0; 238 238 } 239 239 240 - static struct block_device_operations aoe_bdops = { 240 + static const struct block_device_operations aoe_bdops = { 241 241 .open = aoeblk_open, 242 242 .release = aoeblk_release, 243 243 .getgeo = aoeblk_getgeo,
+1 -1
drivers/block/ataflop.c
··· 1856 1856 return 0; 1857 1857 } 1858 1858 1859 - static struct block_device_operations floppy_fops = { 1859 + static const struct block_device_operations floppy_fops = { 1860 1860 .owner = THIS_MODULE, 1861 1861 .open = floppy_open, 1862 1862 .release = floppy_release,
+1 -1
drivers/block/brd.c
··· 375 375 return error; 376 376 } 377 377 378 - static struct block_device_operations brd_fops = { 378 + static const struct block_device_operations brd_fops = { 379 379 .owner = THIS_MODULE, 380 380 .locked_ioctl = brd_ioctl, 381 381 #ifdef CONFIG_BLK_DEV_XIP
+1 -1
drivers/block/cciss.c
··· 205 205 unsigned, unsigned long); 206 206 #endif 207 207 208 - static struct block_device_operations cciss_fops = { 208 + static const struct block_device_operations cciss_fops = { 209 209 .owner = THIS_MODULE, 210 210 .open = cciss_open, 211 211 .release = cciss_release,
+1 -1
drivers/block/cpqarray.c
··· 193 193 } 194 194 195 195 196 - static struct block_device_operations ida_fops = { 196 + static const struct block_device_operations ida_fops = { 197 197 .owner = THIS_MODULE, 198 198 .open = ida_open, 199 199 .release = ida_release,
+1 -1
drivers/block/floppy.c
··· 3907 3907 return res; 3908 3908 } 3909 3909 3910 - static struct block_device_operations floppy_fops = { 3910 + static const struct block_device_operations floppy_fops = { 3911 3911 .owner = THIS_MODULE, 3912 3912 .open = floppy_open, 3913 3913 .release = floppy_release,
+1 -1
drivers/block/hd.c
··· 692 692 return IRQ_HANDLED; 693 693 } 694 694 695 - static struct block_device_operations hd_fops = { 695 + static const struct block_device_operations hd_fops = { 696 696 .getgeo = hd_getgeo, 697 697 }; 698 698
+1 -1
drivers/block/loop.c
··· 1438 1438 return 0; 1439 1439 } 1440 1440 1441 - static struct block_device_operations lo_fops = { 1441 + static const struct block_device_operations lo_fops = { 1442 1442 .owner = THIS_MODULE, 1443 1443 .open = lo_open, 1444 1444 .release = lo_release,
+1 -1
drivers/block/mg_disk.c
··· 775 775 return 0; 776 776 } 777 777 778 - static struct block_device_operations mg_disk_ops = { 778 + static const struct block_device_operations mg_disk_ops = { 779 779 .getgeo = mg_getgeo 780 780 }; 781 781
+1 -1
drivers/block/nbd.c
··· 722 722 return error; 723 723 } 724 724 725 - static struct block_device_operations nbd_fops = 725 + static const struct block_device_operations nbd_fops = 726 726 { 727 727 .owner = THIS_MODULE, 728 728 .locked_ioctl = nbd_ioctl,
+1 -1
drivers/block/osdblk.c
··· 125 125 static DEFINE_MUTEX(ctl_mutex); /* Serialize open/close/setup/teardown */ 126 126 static LIST_HEAD(osdblkdev_list); 127 127 128 - static struct block_device_operations osdblk_bd_ops = { 128 + static const struct block_device_operations osdblk_bd_ops = { 129 129 .owner = THIS_MODULE, 130 130 }; 131 131
+1 -1
drivers/block/paride/pcd.c
··· 247 247 return cdrom_media_changed(&cd->info); 248 248 } 249 249 250 - static struct block_device_operations pcd_bdops = { 250 + static const struct block_device_operations pcd_bdops = { 251 251 .owner = THIS_MODULE, 252 252 .open = pcd_block_open, 253 253 .release = pcd_block_release,
+1 -1
drivers/block/paride/pd.c
··· 807 807 return 0; 808 808 } 809 809 810 - static struct block_device_operations pd_fops = { 810 + static const struct block_device_operations pd_fops = { 811 811 .owner = THIS_MODULE, 812 812 .open = pd_open, 813 813 .release = pd_release,
+1 -1
drivers/block/paride/pf.c
··· 262 262 263 263 /* kernel glue structures */ 264 264 265 - static struct block_device_operations pf_fops = { 265 + static const struct block_device_operations pf_fops = { 266 266 .owner = THIS_MODULE, 267 267 .open = pf_open, 268 268 .release = pf_release,
+1 -1
drivers/block/pktcdvd.c
··· 2849 2849 return attached_disk->fops->media_changed(attached_disk); 2850 2850 } 2851 2851 2852 - static struct block_device_operations pktcdvd_ops = { 2852 + static const struct block_device_operations pktcdvd_ops = { 2853 2853 .owner = THIS_MODULE, 2854 2854 .open = pkt_open, 2855 2855 .release = pkt_close,
+1 -1
drivers/block/ps3disk.c
··· 82 82 static int ps3disk_major; 83 83 84 84 85 - static struct block_device_operations ps3disk_fops = { 85 + static const struct block_device_operations ps3disk_fops = { 86 86 .owner = THIS_MODULE, 87 87 }; 88 88
+1 -1
drivers/block/ps3vram.c
··· 88 88 static int ps3vram_major; 89 89 90 90 91 - static struct block_device_operations ps3vram_fops = { 91 + static const struct block_device_operations ps3vram_fops = { 92 92 .owner = THIS_MODULE, 93 93 }; 94 94
+1 -1
drivers/block/sunvdc.c
··· 103 103 return 0; 104 104 } 105 105 106 - static struct block_device_operations vdc_fops = { 106 + static const struct block_device_operations vdc_fops = { 107 107 .owner = THIS_MODULE, 108 108 .getgeo = vdc_getgeo, 109 109 };
+1 -1
drivers/block/swim.c
··· 748 748 return !fs->disk_in; 749 749 } 750 750 751 - static struct block_device_operations floppy_fops = { 751 + static const struct block_device_operations floppy_fops = { 752 752 .owner = THIS_MODULE, 753 753 .open = floppy_open, 754 754 .release = floppy_release,
+1 -1
drivers/block/swim3.c
··· 998 998 return ret; 999 999 } 1000 1000 1001 - static struct block_device_operations floppy_fops = { 1001 + static const struct block_device_operations floppy_fops = { 1002 1002 .open = floppy_open, 1003 1003 .release = floppy_release, 1004 1004 .locked_ioctl = floppy_ioctl,
+1 -1
drivers/block/sx8.c
··· 423 423 .remove = carm_remove_one, 424 424 }; 425 425 426 - static struct block_device_operations carm_bd_ops = { 426 + static const struct block_device_operations carm_bd_ops = { 427 427 .owner = THIS_MODULE, 428 428 .getgeo = carm_bdev_getgeo, 429 429 };
+1 -1
drivers/block/ub.c
··· 1789 1789 return lun->changed; 1790 1790 } 1791 1791 1792 - static struct block_device_operations ub_bd_fops = { 1792 + static const struct block_device_operations ub_bd_fops = { 1793 1793 .owner = THIS_MODULE, 1794 1794 .open = ub_bd_open, 1795 1795 .release = ub_bd_release,
+1 -2
drivers/block/umem.c
··· 140 140 }; 141 141 142 142 static struct cardinfo cards[MM_MAXCARDS]; 143 - static struct block_device_operations mm_fops; 144 143 static struct timer_list battery_timer; 145 144 146 145 static int num_cards; ··· 788 789 return 0; 789 790 } 790 791 791 - static struct block_device_operations mm_fops = { 792 + static const struct block_device_operations mm_fops = { 792 793 .owner = THIS_MODULE, 793 794 .getgeo = mm_getgeo, 794 795 .revalidate_disk = mm_revalidate,
+1 -1
drivers/block/viodasd.c
··· 219 219 /* 220 220 * Our file operations table 221 221 */ 222 - static struct block_device_operations viodasd_fops = { 222 + static const struct block_device_operations viodasd_fops = { 223 223 .owner = THIS_MODULE, 224 224 .open = viodasd_open, 225 225 .release = viodasd_release,
+1 -1
drivers/block/virtio_blk.c
··· 243 243 return 0; 244 244 } 245 245 246 - static struct block_device_operations virtblk_fops = { 246 + static const struct block_device_operations virtblk_fops = { 247 247 .locked_ioctl = virtblk_ioctl, 248 248 .owner = THIS_MODULE, 249 249 .getgeo = virtblk_getgeo,
+1 -1
drivers/block/xd.c
··· 130 130 131 131 static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo); 132 132 133 - static struct block_device_operations xd_fops = { 133 + static const struct block_device_operations xd_fops = { 134 134 .owner = THIS_MODULE, 135 135 .locked_ioctl = xd_ioctl, 136 136 .getgeo = xd_getgeo,
+2 -2
drivers/block/xen-blkfront.c
··· 65 65 unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 66 66 }; 67 67 68 - static struct block_device_operations xlvbd_block_fops; 68 + static const struct block_device_operations xlvbd_block_fops; 69 69 70 70 #define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE) 71 71 ··· 1039 1039 return 0; 1040 1040 } 1041 1041 1042 - static struct block_device_operations xlvbd_block_fops = 1042 + static const struct block_device_operations xlvbd_block_fops = 1043 1043 { 1044 1044 .owner = THIS_MODULE, 1045 1045 .open = blkif_open,
+1 -1
drivers/block/xsysace.c
··· 941 941 return 0; 942 942 } 943 943 944 - static struct block_device_operations ace_fops = { 944 + static const struct block_device_operations ace_fops = { 945 945 .owner = THIS_MODULE, 946 946 .open = ace_open, 947 947 .release = ace_release,
+1 -2
drivers/block/z2ram.c
··· 64 64 65 65 static DEFINE_SPINLOCK(z2ram_lock); 66 66 67 - static struct block_device_operations z2_fops; 68 67 static struct gendisk *z2ram_gendisk; 69 68 70 69 static void do_z2_request(struct request_queue *q) ··· 314 315 return 0; 315 316 } 316 317 317 - static struct block_device_operations z2_fops = 318 + static const struct block_device_operations z2_fops = 318 319 { 319 320 .owner = THIS_MODULE, 320 321 .open = z2_open,
+1 -1
drivers/cdrom/gdrom.c
··· 512 512 return cdrom_ioctl(gd.cd_info, bdev, mode, cmd, arg); 513 513 } 514 514 515 - static struct block_device_operations gdrom_bdops = { 515 + static const struct block_device_operations gdrom_bdops = { 516 516 .owner = THIS_MODULE, 517 517 .open = gdrom_bdops_open, 518 518 .release = gdrom_bdops_release,
+1 -1
drivers/cdrom/viocd.c
··· 177 177 return cdrom_media_changed(&di->viocd_info); 178 178 } 179 179 180 - struct block_device_operations viocd_fops = { 180 + static const struct block_device_operations viocd_fops = { 181 181 .owner = THIS_MODULE, 182 182 .open = viocd_blk_open, 183 183 .release = viocd_blk_release,
+1 -1
drivers/ide/ide-cd.c
··· 1686 1686 return 0; 1687 1687 } 1688 1688 1689 - static struct block_device_operations idecd_ops = { 1689 + static const struct block_device_operations idecd_ops = { 1690 1690 .owner = THIS_MODULE, 1691 1691 .open = idecd_open, 1692 1692 .release = idecd_release,
+1 -1
drivers/ide/ide-gd.c
··· 321 321 return drive->disk_ops->ioctl(drive, bdev, mode, cmd, arg); 322 322 } 323 323 324 - static struct block_device_operations ide_gd_ops = { 324 + static const struct block_device_operations ide_gd_ops = { 325 325 .owner = THIS_MODULE, 326 326 .open = ide_gd_open, 327 327 .release = ide_gd_release,
+1 -1
drivers/ide/ide-tape.c
··· 1913 1913 return err; 1914 1914 } 1915 1915 1916 - static struct block_device_operations idetape_block_ops = { 1916 + static const struct block_device_operations idetape_block_ops = { 1917 1917 .owner = THIS_MODULE, 1918 1918 .open = idetape_open, 1919 1919 .release = idetape_release,
+2 -2
drivers/md/dm.c
··· 1716 1716 return r; 1717 1717 } 1718 1718 1719 - static struct block_device_operations dm_blk_dops; 1719 + static const struct block_device_operations dm_blk_dops; 1720 1720 1721 1721 static void dm_wq_work(struct work_struct *work); 1722 1722 ··· 2663 2663 kfree(pools); 2664 2664 } 2665 2665 2666 - static struct block_device_operations dm_blk_dops = { 2666 + static const struct block_device_operations dm_blk_dops = { 2667 2667 .open = dm_blk_open, 2668 2668 .release = dm_blk_close, 2669 2669 .ioctl = dm_blk_ioctl,
+2 -2
drivers/md/md.c
··· 138 138 { .ctl_name = 0 } 139 139 }; 140 140 141 - static struct block_device_operations md_fops; 141 + static const struct block_device_operations md_fops; 142 142 143 143 static int start_readonly; 144 144 ··· 5556 5556 mddev->changed = 0; 5557 5557 return 0; 5558 5558 } 5559 - static struct block_device_operations md_fops = 5559 + static const struct block_device_operations md_fops = 5560 5560 { 5561 5561 .owner = THIS_MODULE, 5562 5562 .open = md_open,
+1 -1
drivers/memstick/core/mspro_block.c
··· 235 235 return 0; 236 236 } 237 237 238 - static struct block_device_operations ms_block_bdops = { 238 + static const struct block_device_operations ms_block_bdops = { 239 239 .open = mspro_block_bd_open, 240 240 .release = mspro_block_bd_release, 241 241 .getgeo = mspro_block_bd_getgeo,
+1 -1
drivers/message/i2o/i2o_block.c
··· 925 925 }; 926 926 927 927 /* I2O Block device operations definition */ 928 - static struct block_device_operations i2o_block_fops = { 928 + static const struct block_device_operations i2o_block_fops = { 929 929 .owner = THIS_MODULE, 930 930 .open = i2o_block_open, 931 931 .release = i2o_block_release,
+1 -1
drivers/mmc/card/block.c
··· 130 130 return 0; 131 131 } 132 132 133 - static struct block_device_operations mmc_bdops = { 133 + static const struct block_device_operations mmc_bdops = { 134 134 .open = mmc_blk_open, 135 135 .release = mmc_blk_release, 136 136 .getgeo = mmc_blk_getgeo,
+1 -1
drivers/mtd/mtd_blkdevs.c
··· 210 210 } 211 211 } 212 212 213 - static struct block_device_operations mtd_blktrans_ops = { 213 + static const struct block_device_operations mtd_blktrans_ops = { 214 214 .owner = THIS_MODULE, 215 215 .open = blktrans_open, 216 216 .release = blktrans_release,
+1 -1
drivers/s390/block/dasd.c
··· 2146 2146 return 0; 2147 2147 } 2148 2148 2149 - struct block_device_operations 2149 + const struct block_device_operations 2150 2150 dasd_device_operations = { 2151 2151 .owner = THIS_MODULE, 2152 2152 .open = dasd_open,
+1 -1
drivers/s390/block/dasd_int.h
··· 540 540 extern debug_info_t *dasd_debug_area; 541 541 extern struct dasd_profile_info_t dasd_global_profile; 542 542 extern unsigned int dasd_profile_level; 543 - extern struct block_device_operations dasd_device_operations; 543 + extern const struct block_device_operations dasd_device_operations; 544 544 545 545 extern struct kmem_cache *dasd_page_cache; 546 546
+1 -1
drivers/s390/block/dcssblk.c
··· 34 34 static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0"; 35 35 36 36 static int dcssblk_major; 37 - static struct block_device_operations dcssblk_devops = { 37 + static const struct block_device_operations dcssblk_devops = { 38 38 .owner = THIS_MODULE, 39 39 .open = dcssblk_open, 40 40 .release = dcssblk_release,
+1 -1
drivers/s390/block/xpram.c
··· 244 244 return 0; 245 245 } 246 246 247 - static struct block_device_operations xpram_devops = 247 + static const struct block_device_operations xpram_devops = 248 248 { 249 249 .owner = THIS_MODULE, 250 250 .getgeo = xpram_getgeo,
+1 -1
drivers/s390/char/tape_block.c
··· 50 50 static int tapeblock_medium_changed(struct gendisk *); 51 51 static int tapeblock_revalidate_disk(struct gendisk *); 52 52 53 - static struct block_device_operations tapeblock_fops = { 53 + static const struct block_device_operations tapeblock_fops = { 54 54 .owner = THIS_MODULE, 55 55 .open = tapeblock_open, 56 56 .release = tapeblock_release,
+1 -1
drivers/sbus/char/jsflash.c
··· 452 452 453 453 static struct miscdevice jsf_dev = { JSF_MINOR, "jsflash", &jsf_fops }; 454 454 455 - static struct block_device_operations jsfd_fops = { 455 + static const struct block_device_operations jsfd_fops = { 456 456 .owner = THIS_MODULE, 457 457 }; 458 458
+1 -1
drivers/scsi/sd.c
··· 956 956 } 957 957 #endif 958 958 959 - static struct block_device_operations sd_fops = { 959 + static const struct block_device_operations sd_fops = { 960 960 .owner = THIS_MODULE, 961 961 .open = sd_open, 962 962 .release = sd_release,
+1 -1
drivers/scsi/sr.c
··· 525 525 return cdrom_media_changed(&cd->cdi); 526 526 } 527 527 528 - static struct block_device_operations sr_bdops = 528 + static const struct block_device_operations sr_bdops = 529 529 { 530 530 .owner = THIS_MODULE, 531 531 .open = sr_block_open,
+1 -1
fs/block_dev.c
··· 1114 1114 int check_disk_change(struct block_device *bdev) 1115 1115 { 1116 1116 struct gendisk *disk = bdev->bd_disk; 1117 - struct block_device_operations * bdops = disk->fops; 1117 + const struct block_device_operations *bdops = disk->fops; 1118 1118 1119 1119 if (!bdops->media_changed) 1120 1120 return 0;
+1 -1
fs/ext2/xip.c
··· 20 20 void **kaddr, unsigned long *pfn) 21 21 { 22 22 struct block_device *bdev = inode->i_sb->s_bdev; 23 - struct block_device_operations *ops = bdev->bd_disk->fops; 23 + const struct block_device_operations *ops = bdev->bd_disk->fops; 24 24 sector_t sector; 25 25 26 26 sector = block * (PAGE_SIZE / 512); /* ext2 block to bdev sector */
+1 -1
fs/partitions/check.c
··· 581 581 } 582 582 583 583 if (from + size > get_capacity(disk)) { 584 - struct block_device_operations *bdops = disk->fops; 584 + const struct block_device_operations *bdops = disk->fops; 585 585 unsigned long long capacity; 586 586 587 587 printk(KERN_WARNING
+1 -1
include/linux/genhd.h
··· 151 151 struct disk_part_tbl *part_tbl; 152 152 struct hd_struct part0; 153 153 154 - struct block_device_operations *fops; 154 + const struct block_device_operations *fops; 155 155 struct request_queue *queue; 156 156 void *private_data; 157 157