Commit a22be69d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

ide-cd: use bdev_check_media_changed

Switch to use bdev_check_media_changed instead of check_disk_change and
call idecd_revalidate_disk manually.  Given that idecd_revalidate_disk
only re-reads the TOC, and we already do the same at probe time, the
extra call into ->revalidate_disk from bdev_disk_changed is not required
either, so stop wiring up the method.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent faf04138
...@@ -56,6 +56,7 @@ static DEFINE_MUTEX(ide_cd_mutex); ...@@ -56,6 +56,7 @@ static DEFINE_MUTEX(ide_cd_mutex);
static DEFINE_MUTEX(idecd_ref_mutex); static DEFINE_MUTEX(idecd_ref_mutex);
static void ide_cd_release(struct device *); static void ide_cd_release(struct device *);
static int idecd_revalidate_disk(struct gendisk *disk);
static struct cdrom_info *ide_cd_get(struct gendisk *disk) static struct cdrom_info *ide_cd_get(struct gendisk *disk)
{ {
...@@ -1611,7 +1612,8 @@ static int idecd_open(struct block_device *bdev, fmode_t mode) ...@@ -1611,7 +1612,8 @@ static int idecd_open(struct block_device *bdev, fmode_t mode)
struct cdrom_info *info; struct cdrom_info *info;
int rc = -ENXIO; int rc = -ENXIO;
check_disk_change(bdev); if (bdev_check_media_change(bdev))
idecd_revalidate_disk(bdev->bd_disk);
mutex_lock(&ide_cd_mutex); mutex_lock(&ide_cd_mutex);
info = ide_cd_get(bdev->bd_disk); info = ide_cd_get(bdev->bd_disk);
...@@ -1770,7 +1772,6 @@ static const struct block_device_operations idecd_ops = { ...@@ -1770,7 +1772,6 @@ static const struct block_device_operations idecd_ops = {
.compat_ioctl = IS_ENABLED(CONFIG_COMPAT) ? .compat_ioctl = IS_ENABLED(CONFIG_COMPAT) ?
idecd_compat_ioctl : NULL, idecd_compat_ioctl : NULL,
.check_events = idecd_check_events, .check_events = idecd_check_events,
.revalidate_disk = idecd_revalidate_disk
}; };
/* module options */ /* module options */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment