const: make block_device_operations const
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 22 Sep 2009 00:01:13 +0000 (17:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2009 14:17:25 +0000 (07:17 -0700)
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>
56 files changed:
arch/powerpc/sysdev/axonram.c
arch/um/drivers/ubd_kern.c
drivers/block/DAC960.c
drivers/block/amiflop.c
drivers/block/aoe/aoeblk.c
drivers/block/ataflop.c
drivers/block/brd.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/floppy.c
drivers/block/hd.c
drivers/block/loop.c
drivers/block/mg_disk.c
drivers/block/nbd.c
drivers/block/osdblk.c
drivers/block/paride/pcd.c
drivers/block/paride/pd.c
drivers/block/paride/pf.c
drivers/block/pktcdvd.c
drivers/block/ps3disk.c
drivers/block/ps3vram.c
drivers/block/sunvdc.c
drivers/block/swim.c
drivers/block/swim3.c
drivers/block/sx8.c
drivers/block/ub.c
drivers/block/umem.c
drivers/block/viodasd.c
drivers/block/virtio_blk.c
drivers/block/xd.c
drivers/block/xen-blkfront.c
drivers/block/xsysace.c
drivers/block/z2ram.c
drivers/cdrom/gdrom.c
drivers/cdrom/viocd.c
drivers/ide/ide-cd.c
drivers/ide/ide-gd.c
drivers/ide/ide-tape.c
drivers/md/dm.c
drivers/md/md.c
drivers/memstick/core/mspro_block.c
drivers/message/i2o/i2o_block.c
drivers/mmc/card/block.c
drivers/mtd/mtd_blkdevs.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_int.h
drivers/s390/block/dcssblk.c
drivers/s390/block/xpram.c
drivers/s390/char/tape_block.c
drivers/sbus/char/jsflash.c
drivers/scsi/sd.c
drivers/scsi/sr.c
fs/block_dev.c
fs/ext2/xip.c
fs/partitions/check.c
include/linux/genhd.h

index a4779912a5caa4d45eacedd3b584d33a2537fafd..88f4ae787832a270053673b4f0ceb7e5fe1b62cf 100644 (file)
@@ -165,7 +165,7 @@ axon_ram_direct_access(struct block_device *device, sector_t sector,
        return 0;
 }
 
-static struct block_device_operations axon_ram_devops = {
+static const struct block_device_operations axon_ram_devops = {
        .owner          = THIS_MODULE,
        .direct_access  = axon_ram_direct_access
 };
index 8f05d4d9da128788d0b5b7d5f39ac5fe2741bd61..635d16d90a80d4158df7769ec11df5ab6c64c38d 100644 (file)
@@ -106,7 +106,7 @@ static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
 
 #define MAX_DEV (16)
 
-static struct block_device_operations ubd_blops = {
+static const struct block_device_operations ubd_blops = {
         .owner         = THIS_MODULE,
         .open          = ubd_open,
         .release       = ubd_release,
index 1e6b7c14f697c58b7ad5f551e6f947d2fe7719a2..8b50af381a8e36aec14bb5d09db9dd46051f3146 100644 (file)
@@ -152,7 +152,7 @@ static int DAC960_revalidate_disk(struct gendisk *disk)
        return 0;
 }
 
-static struct block_device_operations DAC960_BlockDeviceOperations = {
+static const struct block_device_operations DAC960_BlockDeviceOperations = {
        .owner                  = THIS_MODULE,
        .open                   = DAC960_open,
        .getgeo                 = DAC960_getgeo,
index 2f07b7c99a95b5046b121572f956c1048dc29894..0552258390240ae8f71ebf89d09c4542eff749e9 100644 (file)
@@ -1632,7 +1632,7 @@ static int amiga_floppy_change(struct gendisk *disk)
        return 0;
 }
 
-static struct block_device_operations floppy_fops = {
+static const struct block_device_operations floppy_fops = {
        .owner          = THIS_MODULE,
        .open           = floppy_open,
        .release        = floppy_release,
index b6cd571adbf20630f1c8920043f32d4e68efa44a..3af97d4da2db7ac30dc808da80b036acbd848256 100644 (file)
@@ -237,7 +237,7 @@ aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations aoe_bdops = {
+static const struct block_device_operations aoe_bdops = {
        .open = aoeblk_open,
        .release = aoeblk_release,
        .getgeo = aoeblk_getgeo,
index 3ff02941b3dd40c57ca9a2cc56d7442c5cd538cb..847a9e57570ae4721b5130fcda9aaf8315219b35 100644 (file)
@@ -1856,7 +1856,7 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
        return 0;
 }
 
-static struct block_device_operations floppy_fops = {
+static const struct block_device_operations floppy_fops = {
        .owner          = THIS_MODULE,
        .open           = floppy_open,
        .release        = floppy_release,
index 4bf8705b3acede5f1558e1f44c168abe5be73d3f..4f688434daf1a220c95050f82bd4a5c9e1a5d277 100644 (file)
@@ -375,7 +375,7 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,
        return error;
 }
 
-static struct block_device_operations brd_fops = {
+static const struct block_device_operations brd_fops = {
        .owner =                THIS_MODULE,
        .locked_ioctl =         brd_ioctl,
 #ifdef CONFIG_BLK_DEV_XIP
index d8372b432826dd49457c1df19691bc06dea7eb3c..4f19105f755c76e5f9ea56342b5915a8ead5924b 100644 (file)
@@ -205,7 +205,7 @@ static int cciss_compat_ioctl(struct block_device *, fmode_t,
                              unsigned, unsigned long);
 #endif
 
-static struct block_device_operations cciss_fops = {
+static const struct block_device_operations cciss_fops = {
        .owner = THIS_MODULE,
        .open = cciss_open,
        .release = cciss_release,
index 44fa2018f6b027b8b5bb77504bef118a813168e3..b82d438e2607cc2c430e4b170470ac29e47c3fb2 100644 (file)
@@ -193,7 +193,7 @@ static inline ctlr_info_t *get_host(struct gendisk *disk)
 }
 
 
-static struct block_device_operations ida_fops  = {
+static const struct block_device_operations ida_fops  = {
        .owner          = THIS_MODULE,
        .open           = ida_open,
        .release        = ida_release,
index 2b387c2260d829e9f441ecc08a98b823de10ba52..5c01f747571b9fe34f54de72d5fa5f03641c17d7 100644 (file)
@@ -3907,7 +3907,7 @@ static int floppy_revalidate(struct gendisk *disk)
        return res;
 }
 
-static struct block_device_operations floppy_fops = {
+static const struct block_device_operations floppy_fops = {
        .owner                  = THIS_MODULE,
        .open                   = floppy_open,
        .release                = floppy_release,
index f9d01608cbe2740d2bbc6e98045f6f1f1b34db22..d5cdce08ffd2765aa1f5b3cc83b399093bbf09e7 100644 (file)
@@ -692,7 +692,7 @@ static irqreturn_t hd_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct block_device_operations hd_fops = {
+static const struct block_device_operations hd_fops = {
        .getgeo =       hd_getgeo,
 };
 
index bbb79441d8956a7d45b56bffd0df769c63639425..edda9ea7c626afeb6ba08b7700dfc8c46f531016 100644 (file)
@@ -1438,7 +1438,7 @@ out_unlocked:
        return 0;
 }
 
-static struct block_device_operations lo_fops = {
+static const struct block_device_operations lo_fops = {
        .owner =        THIS_MODULE,
        .open =         lo_open,
        .release =      lo_release,
index 6d7fbaa922486dc2731ccb50480a1c2184718ea6..e0339aaa18154303316c8405d72c08af4b036ffd 100644 (file)
@@ -775,7 +775,7 @@ static int mg_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations mg_disk_ops = {
+static const struct block_device_operations mg_disk_ops = {
        .getgeo = mg_getgeo
 };
 
index 5d23ffad7c77fc31d97ff1d5e3fed081dffe16c3..cc923a5b430c51d11f0cc4fd1b2c32405c72ca6a 100644 (file)
@@ -722,7 +722,7 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
        return error;
 }
 
-static struct block_device_operations nbd_fops =
+static const struct block_device_operations nbd_fops =
 {
        .owner =        THIS_MODULE,
        .locked_ioctl = nbd_ioctl,
index 13c1aee6aa3f47f2f1cc847452257ac88443a958..a808b1530b3bd344c290e0fed84e5d35e72d8338 100644 (file)
@@ -125,7 +125,7 @@ static struct class *class_osdblk;          /* /sys/class/osdblk */
 static DEFINE_MUTEX(ctl_mutex);        /* Serialize open/close/setup/teardown */
 static LIST_HEAD(osdblkdev_list);
 
-static struct block_device_operations osdblk_bd_ops = {
+static const struct block_device_operations osdblk_bd_ops = {
        .owner          = THIS_MODULE,
 };
 
index 9f3518c515a15c57168f9e5fd57b073812a997ba..8866ca369d5e5e1814c27eab1b3c53fb5ff0777b 100644 (file)
@@ -247,7 +247,7 @@ static int pcd_block_media_changed(struct gendisk *disk)
        return cdrom_media_changed(&cd->info);
 }
 
-static struct block_device_operations pcd_bdops = {
+static const struct block_device_operations pcd_bdops = {
        .owner          = THIS_MODULE,
        .open           = pcd_block_open,
        .release        = pcd_block_release,
index bf5955b3d873511d25e31c162d7ee4280a6cc14c..569e39e8f1143fd4c896344fa25e3e653f8e6a89 100644 (file)
@@ -807,7 +807,7 @@ static int pd_revalidate(struct gendisk *p)
        return 0;
 }
 
-static struct block_device_operations pd_fops = {
+static const struct block_device_operations pd_fops = {
        .owner          = THIS_MODULE,
        .open           = pd_open,
        .release        = pd_release,
index 68a90834e99388c366874be2fe4ea554e266831f..ea54ea393553831c6ba4a2066e9cb63859cd4e5b 100644 (file)
@@ -262,7 +262,7 @@ static char *pf_buf;                /* buffer for request in progress */
 
 /* kernel glue structures */
 
-static struct block_device_operations pf_fops = {
+static const struct block_device_operations pf_fops = {
        .owner          = THIS_MODULE,
        .open           = pf_open,
        .release        = pf_release,
index fd5bb8ad59a9fc5aaf35fdb93694562dd9d0b061..2ddf03ae034e1aa552d6740ee171c6739f9335bd 100644 (file)
@@ -2849,7 +2849,7 @@ static int pkt_media_changed(struct gendisk *disk)
        return attached_disk->fops->media_changed(attached_disk);
 }
 
-static struct block_device_operations pktcdvd_ops = {
+static const struct block_device_operations pktcdvd_ops = {
        .owner =                THIS_MODULE,
        .open =                 pkt_open,
        .release =              pkt_close,
index 34cbb7f3efa89e5504920d547b081c86fe9ca4e9..03a130dca8ab541ad81bbb7db2095da6a5a26551 100644 (file)
@@ -82,7 +82,7 @@ enum lv1_ata_in_out {
 static int ps3disk_major;
 
 
-static struct block_device_operations ps3disk_fops = {
+static const struct block_device_operations ps3disk_fops = {
        .owner          = THIS_MODULE,
 };
 
index c8753a9ed290766c84cf3f7cd9da4b096b789270..3bb7c47c869fa5c3749acc689cfc427920b7caf1 100644 (file)
@@ -88,7 +88,7 @@ struct ps3vram_priv {
 static int ps3vram_major;
 
 
-static struct block_device_operations ps3vram_fops = {
+static const struct block_device_operations ps3vram_fops = {
        .owner          = THIS_MODULE,
 };
 
index cbfd9c0aef034ffd2778aaac37eec3fd4d33a61e..411f064760b41db69a4ffae999b92f24b89fba3b 100644 (file)
@@ -103,7 +103,7 @@ static int vdc_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations vdc_fops = {
+static const struct block_device_operations vdc_fops = {
        .owner          = THIS_MODULE,
        .getgeo         = vdc_getgeo,
 };
index cf7877fb8a7d721b0ddbff0c0cced731e8c3e9fc..8f569e3df8903d3fc8103c824fa212f5ef058948 100644 (file)
@@ -748,7 +748,7 @@ static int floppy_revalidate(struct gendisk *disk)
        return !fs->disk_in;
 }
 
-static struct block_device_operations floppy_fops = {
+static const struct block_device_operations floppy_fops = {
        .owner           = THIS_MODULE,
        .open            = floppy_open,
        .release         = floppy_release,
index 80df93e3cdd05f0d9c219b6d18bbf8b7a6de517d..e39e3820fef9d921d75cc9e771b1ce5b7b157144 100644 (file)
@@ -998,7 +998,7 @@ static int floppy_revalidate(struct gendisk *disk)
        return ret;
 }
 
-static struct block_device_operations floppy_fops = {
+static const struct block_device_operations floppy_fops = {
        .open           = floppy_open,
        .release        = floppy_release,
        .locked_ioctl   = floppy_ioctl,
index f5cd2e83ebcc6757992cd59834d5f2e9ebb1d183..a7c4184f4a63355539976a010e0c50700d4c5318 100644 (file)
@@ -423,7 +423,7 @@ static struct pci_driver carm_driver = {
        .remove         = carm_remove_one,
 };
 
-static struct block_device_operations carm_bd_ops = {
+static const struct block_device_operations carm_bd_ops = {
        .owner          = THIS_MODULE,
        .getgeo         = carm_bdev_getgeo,
 };
index cc54473b8e77fa857d37eff69a053ff16b20c89c..c739b203fe91321b955905b72c3eab3e93f8d821 100644 (file)
@@ -1789,7 +1789,7 @@ static int ub_bd_media_changed(struct gendisk *disk)
        return lun->changed;
 }
 
-static struct block_device_operations ub_bd_fops = {
+static const struct block_device_operations ub_bd_fops = {
        .owner          = THIS_MODULE,
        .open           = ub_bd_open,
        .release        = ub_bd_release,
index 858c34dd032d27d31cadb2112e7bc36ec36fe8de..ad1ba393801ae4fe222d0117a1bd7d6a6fedc187 100644 (file)
@@ -140,7 +140,6 @@ struct cardinfo {
 };
 
 static struct cardinfo cards[MM_MAXCARDS];
-static struct block_device_operations mm_fops;
 static struct timer_list battery_timer;
 
 static int num_cards;
@@ -789,7 +788,7 @@ static int mm_check_change(struct gendisk *disk)
        return 0;
 }
 
-static struct block_device_operations mm_fops = {
+static const struct block_device_operations mm_fops = {
        .owner          = THIS_MODULE,
        .getgeo         = mm_getgeo,
        .revalidate_disk = mm_revalidate,
index b441ce3832e9ff7a403fed425d79ca354aace97b..a8c8b56b275e546e02819d7889801b5545dbafb7 100644 (file)
@@ -219,7 +219,7 @@ static int viodasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
 /*
  * Our file operations table
  */
-static struct block_device_operations viodasd_fops = {
+static const struct block_device_operations viodasd_fops = {
        .owner = THIS_MODULE,
        .open = viodasd_open,
        .release = viodasd_release,
index aa1a3d5a3e2bc3f202bb695da2624f4d8cfd03b5..aa89fe45237d516907cacffa238985e98fdb0fec 100644 (file)
@@ -243,7 +243,7 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations virtblk_fops = {
+static const struct block_device_operations virtblk_fops = {
        .locked_ioctl = virtblk_ioctl,
        .owner  = THIS_MODULE,
        .getgeo = virtblk_getgeo,
index ce2429219925597edddb597ed88c09ff37c48b75..0877d3628fdae251f48b87d87fffeb1e9d11df29 100644 (file)
@@ -130,7 +130,7 @@ static struct gendisk *xd_gendisk[2];
 
 static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
 
-static struct block_device_operations xd_fops = {
+static const struct block_device_operations xd_fops = {
        .owner  = THIS_MODULE,
        .locked_ioctl   = xd_ioctl,
        .getgeo = xd_getgeo,
index e53284767f7c9e59b89c6fe1611487526dee081c..b8578bb3f4c9c4393c83be80ddaa36eccc073264 100644 (file)
@@ -65,7 +65,7 @@ struct blk_shadow {
        unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST];
 };
 
-static struct block_device_operations xlvbd_block_fops;
+static const struct block_device_operations xlvbd_block_fops;
 
 #define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE)
 
@@ -1039,7 +1039,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
        return 0;
 }
 
-static struct block_device_operations xlvbd_block_fops =
+static const struct block_device_operations xlvbd_block_fops =
 {
        .owner = THIS_MODULE,
        .open = blkif_open,
index b20abe102a2b774d66cc4505508762bbed86b8d0..e5c5415eb45eb7a7e8f350427be29fcfe2fb3eec 100644 (file)
@@ -941,7 +941,7 @@ static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations ace_fops = {
+static const struct block_device_operations ace_fops = {
        .owner = THIS_MODULE,
        .open = ace_open,
        .release = ace_release,
index b2590409f25efb1911dc8e87a4d88c2dc0b3d719..64f941e0f14b07180ebe1089786f1842a22b7b94 100644 (file)
@@ -64,7 +64,6 @@ static int current_device   = -1;
 
 static DEFINE_SPINLOCK(z2ram_lock);
 
-static struct block_device_operations z2_fops;
 static struct gendisk *z2ram_gendisk;
 
 static void do_z2_request(struct request_queue *q)
@@ -315,7 +314,7 @@ z2_release(struct gendisk *disk, fmode_t mode)
     return 0;
 }
 
-static struct block_device_operations z2_fops =
+static const struct block_device_operations z2_fops =
 {
        .owner          = THIS_MODULE,
        .open           = z2_open,
index b5621f27c4be8052192a56b29f83bd95820594e9..a762283d2a219a967b0f5aeb18da61ab238da5e9 100644 (file)
@@ -512,7 +512,7 @@ static int gdrom_bdops_ioctl(struct block_device *bdev, fmode_t mode,
        return cdrom_ioctl(gd.cd_info, bdev, mode, cmd, arg);
 }
 
-static struct block_device_operations gdrom_bdops = {
+static const struct block_device_operations gdrom_bdops = {
        .owner                  = THIS_MODULE,
        .open                   = gdrom_bdops_open,
        .release                = gdrom_bdops_release,
index 0fff646cc2f0904bc5539d052628420e899a0957..57ca69e0ac553a086ec1751441188c6415f4fe56 100644 (file)
@@ -177,7 +177,7 @@ static int viocd_blk_media_changed(struct gendisk *disk)
        return cdrom_media_changed(&di->viocd_info);
 }
 
-struct block_device_operations viocd_fops = {
+static const struct block_device_operations viocd_fops = {
        .owner =                THIS_MODULE,
        .open =                 viocd_blk_open,
        .release =              viocd_blk_release,
index b79ca419d8d99f5ad65197adb41462c39ed44bcc..64207df8da82fe5627664777518617bd0facc990 100644 (file)
@@ -1686,7 +1686,7 @@ static int idecd_revalidate_disk(struct gendisk *disk)
        return  0;
 }
 
-static struct block_device_operations idecd_ops = {
+static const struct block_device_operations idecd_ops = {
        .owner                  = THIS_MODULE,
        .open                   = idecd_open,
        .release                = idecd_release,
index 214119026b3f4e55eec0c0eb1f60898ecc62e047..753241429c26b4e9b370c72e388a79990a780028 100644 (file)
@@ -321,7 +321,7 @@ static int ide_gd_ioctl(struct block_device *bdev, fmode_t mode,
        return drive->disk_ops->ioctl(drive, bdev, mode, cmd, arg);
 }
 
-static struct block_device_operations ide_gd_ops = {
+static const struct block_device_operations ide_gd_ops = {
        .owner                  = THIS_MODULE,
        .open                   = ide_gd_open,
        .release                = ide_gd_release,
index 9d6f62baac272c94953aec4aa171398cc159f291..58fc920d5c32094c4bddb1be206ebbdf5b2f30c5 100644 (file)
@@ -1913,7 +1913,7 @@ static int idetape_ioctl(struct block_device *bdev, fmode_t mode,
        return err;
 }
 
-static struct block_device_operations idetape_block_ops = {
+static const struct block_device_operations idetape_block_ops = {
        .owner          = THIS_MODULE,
        .open           = idetape_open,
        .release        = idetape_release,
index eee28fac210ce08769696377f892ec825bc45e52..376f1ab48a245fcdce521bd55a7ceb109f7f8c9e 100644 (file)
@@ -1716,7 +1716,7 @@ out:
        return r;
 }
 
-static struct block_device_operations dm_blk_dops;
+static const struct block_device_operations dm_blk_dops;
 
 static void dm_wq_work(struct work_struct *work);
 
@@ -2663,7 +2663,7 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)
        kfree(pools);
 }
 
-static struct block_device_operations dm_blk_dops = {
+static const struct block_device_operations dm_blk_dops = {
        .open = dm_blk_open,
        .release = dm_blk_close,
        .ioctl = dm_blk_ioctl,
index 9dd872000cec843db28fd393f2eb3023725c4bf4..6aa497e4baf85d30526ad12ab8a96dbc179d9538 100644 (file)
@@ -138,7 +138,7 @@ static ctl_table raid_root_table[] = {
        { .ctl_name = 0 }
 };
 
-static struct block_device_operations md_fops;
+static const struct block_device_operations md_fops;
 
 static int start_readonly;
 
@@ -5556,7 +5556,7 @@ static int md_revalidate(struct gendisk *disk)
        mddev->changed = 0;
        return 0;
 }
-static struct block_device_operations md_fops =
+static const struct block_device_operations md_fops =
 {
        .owner          = THIS_MODULE,
        .open           = md_open,
index 7847bbc1440d6edd912e918821c248c6e20d0ee7..bd83fa0a4970fb13a5ddef788d1c68a5a7b21300 100644 (file)
@@ -235,7 +235,7 @@ static int mspro_block_bd_getgeo(struct block_device *bdev,
        return 0;
 }
 
-static struct block_device_operations ms_block_bdops = {
+static const struct block_device_operations ms_block_bdops = {
        .open    = mspro_block_bd_open,
        .release = mspro_block_bd_release,
        .getgeo  = mspro_block_bd_getgeo,
index 335d4c78a775122ea0e6738aed84a31d7dd4d47b..d505b68cd3729df2820de01cc39cef81a58fce91 100644 (file)
@@ -925,7 +925,7 @@ static void i2o_block_request_fn(struct request_queue *q)
 };
 
 /* I2O Block device operations definition */
-static struct block_device_operations i2o_block_fops = {
+static const struct block_device_operations i2o_block_fops = {
        .owner = THIS_MODULE,
        .open = i2o_block_open,
        .release = i2o_block_release,
index adc205c49fbf1e2b6541aad793addc20fd40dab8..85f0e8cd875bac4f153788ff0012fc0b27e05dd5 100644 (file)
@@ -130,7 +130,7 @@ mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations mmc_bdops = {
+static const struct block_device_operations mmc_bdops = {
        .open                   = mmc_blk_open,
        .release                = mmc_blk_release,
        .getgeo                 = mmc_blk_getgeo,
index 7baba40c1ed225f38921e2143514822080bc67ae..0acbf4f5be50d31e31ccbce8d5e51db854e57f22 100644 (file)
@@ -210,7 +210,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
        }
 }
 
-static struct block_device_operations mtd_blktrans_ops = {
+static const struct block_device_operations mtd_blktrans_ops = {
        .owner          = THIS_MODULE,
        .open           = blktrans_open,
        .release        = blktrans_release,
index e109da4583a88cd4d71bad470cc20e3205096309..dad0449475b698fdeae045db1b06b1393a70a21d 100644 (file)
@@ -2146,7 +2146,7 @@ static int dasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-struct block_device_operations
+const struct block_device_operations
 dasd_device_operations = {
        .owner          = THIS_MODULE,
        .open           = dasd_open,
index 5e47a1ee52b9c21c64893b029b34a0755232e3db..8afd9fa0087592d555f1bbcbcac59806f0c24355 100644 (file)
@@ -540,7 +540,7 @@ dasd_check_blocksize(int bsize)
 extern debug_info_t *dasd_debug_area;
 extern struct dasd_profile_info_t dasd_global_profile;
 extern unsigned int dasd_profile_level;
-extern struct block_device_operations dasd_device_operations;
+extern const struct block_device_operations dasd_device_operations;
 
 extern struct kmem_cache *dasd_page_cache;
 
index d34617682a6295172a2c0d5d5fa47e258e4d2b23..f76f4bd82b9f9810e3bae0b4d914f1f8673803ab 100644 (file)
@@ -34,7 +34,7 @@ static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
 static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0";
 
 static int dcssblk_major;
-static struct block_device_operations dcssblk_devops = {
+static const struct block_device_operations dcssblk_devops = {
        .owner          = THIS_MODULE,
        .open           = dcssblk_open,
        .release        = dcssblk_release,
index ee604e92a5fa65580717c8207384c61615bb7c04..116d1b3eeb157093002ea32edbf7c45133dc695b 100644 (file)
@@ -244,7 +244,7 @@ static int xpram_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations xpram_devops =
+static const struct block_device_operations xpram_devops =
 {
        .owner  = THIS_MODULE,
        .getgeo = xpram_getgeo,
index 4cb9e70507abf442e924a923033f352ea69166c7..64f57ef2763c394e1f6e62584da3b002e3d7d24a 100644 (file)
@@ -50,7 +50,7 @@ static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int,
 static int tapeblock_medium_changed(struct gendisk *);
 static int tapeblock_revalidate_disk(struct gendisk *);
 
-static struct block_device_operations tapeblock_fops = {
+static const struct block_device_operations tapeblock_fops = {
        .owner           = THIS_MODULE,
        .open            = tapeblock_open,
        .release         = tapeblock_release,
index 6d46516846884515bd56b35a9f0d28b342df1b03..869a30b49edc93620b38848b369395dbae37bf13 100644 (file)
@@ -452,7 +452,7 @@ static const struct file_operations jsf_fops = {
 
 static struct miscdevice jsf_dev = { JSF_MINOR, "jsflash", &jsf_fops };
 
-static struct block_device_operations jsfd_fops = {
+static const struct block_device_operations jsfd_fops = {
        .owner =        THIS_MODULE,
 };
 
index a89c421dab51b0b6d29dd94273b934244adf0c52..8dd96dcd716ce66089c13204166170446193c75a 100644 (file)
@@ -956,7 +956,7 @@ static int sd_compat_ioctl(struct block_device *bdev, fmode_t mode,
 }
 #endif
 
-static struct block_device_operations sd_fops = {
+static const struct block_device_operations sd_fops = {
        .owner                  = THIS_MODULE,
        .open                   = sd_open,
        .release                = sd_release,
index cce0fe4c8a3b91fb86f535fa2ae6d6bf2f79f226..eb61f7a70e1d45f37da30e0ec773379f3c29017d 100644 (file)
@@ -525,7 +525,7 @@ static int sr_block_media_changed(struct gendisk *disk)
        return cdrom_media_changed(&cd->cdi);
 }
 
-static struct block_device_operations sr_bdops =
+static const struct block_device_operations sr_bdops =
 {
        .owner          = THIS_MODULE,
        .open           = sr_block_open,
index 71e7e03ac34313ed2fcb890d727bf1e47e006317..5d1ed50bd46c591c1ef63b312c4844d013f5239b 100644 (file)
@@ -1114,7 +1114,7 @@ EXPORT_SYMBOL(revalidate_disk);
 int check_disk_change(struct block_device *bdev)
 {
        struct gendisk *disk = bdev->bd_disk;
-       struct block_device_operations * bdops = disk->fops;
+       const struct block_device_operations *bdops = disk->fops;
 
        if (!bdops->media_changed)
                return 0;
index b72b85884223fc3761208f6bc891b39e3213d034..c18fbf3e4068c33429c6c8e3bf3ebcc1844fe505 100644 (file)
@@ -20,7 +20,7 @@ __inode_direct_access(struct inode *inode, sector_t block,
                      void **kaddr, unsigned long *pfn)
 {
        struct block_device *bdev = inode->i_sb->s_bdev;
-       struct block_device_operations *ops = bdev->bd_disk->fops;
+       const struct block_device_operations *ops = bdev->bd_disk->fops;
        sector_t sector;
 
        sector = block * (PAGE_SIZE / 512); /* ext2 block to bdev sector */
index fbeaddf595d3ce8c456c4a58a9b31698f51b6506..7b685e10cbad8cc9b052cec48737fbf7bf6f7afb 100644 (file)
@@ -581,7 +581,7 @@ try_scan:
                }
 
                if (from + size > get_capacity(disk)) {
-                       struct block_device_operations *bdops = disk->fops;
+                       const struct block_device_operations *bdops = disk->fops;
                        unsigned long long capacity;
 
                        printk(KERN_WARNING
index 109d179adb93c5eaeed6a2b2555361987ec17ea0..297df45ffd0ad27e8219aaf3715a00d030f5bf54 100644 (file)
@@ -151,7 +151,7 @@ struct gendisk {
        struct disk_part_tbl *part_tbl;
        struct hd_struct part0;
 
-       struct block_device_operations *fops;
+       const struct block_device_operations *fops;
        struct request_queue *queue;
        void *private_data;