Skip to content

Commit

Permalink
const: make block_device_operations const
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and torvalds committed Sep 22, 2009
1 parent 7b02196 commit 83d5cde
Show file tree
Hide file tree
Showing 56 changed files with 59 additions and 61 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/axonram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
2 changes: 1 addition & 1 deletion arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/DAC960.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/amiflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/aoe/aoeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/cpqarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode)
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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/mg_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/osdblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/block/paride/pcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/paride/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ps3disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ps3vram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/block/sunvdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/swim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/swim3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/sx8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions drivers/block/umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/viodasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/xd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/xsysace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions drivers/block/z2ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/gdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/viocd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ static int next_free_minor(int *minor)
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);

Expand Down Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 83d5cde

Please sign in to comment.