Commit 471bd0af authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

sd: use bdev_check_media_change

Switch to use bdev_check_media_change instead of check_disk_change and
call sd_revalidate_disk manually.  As sd also calls sd_revalidate_disk
manually during probe and open, 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 818077d6
...@@ -1381,8 +1381,10 @@ static int sd_open(struct block_device *bdev, fmode_t mode) ...@@ -1381,8 +1381,10 @@ static int sd_open(struct block_device *bdev, fmode_t mode)
if (!scsi_block_when_processing_errors(sdev)) if (!scsi_block_when_processing_errors(sdev))
goto error_out; goto error_out;
if (sdev->removable || sdkp->write_prot) if (sdev->removable || sdkp->write_prot) {
check_disk_change(bdev); if (bdev_check_media_change(bdev))
sd_revalidate_disk(bdev->bd_disk);
}
/* /*
* If the drive is empty, just let the open fail. * If the drive is empty, just let the open fail.
...@@ -1843,7 +1845,6 @@ static const struct block_device_operations sd_fops = { ...@@ -1843,7 +1845,6 @@ static const struct block_device_operations sd_fops = {
.compat_ioctl = sd_compat_ioctl, .compat_ioctl = sd_compat_ioctl,
#endif #endif
.check_events = sd_check_events, .check_events = sd_check_events,
.revalidate_disk = sd_revalidate_disk,
.unlock_native_capacity = sd_unlock_native_capacity, .unlock_native_capacity = sd_unlock_native_capacity,
.report_zones = sd_zbc_report_zones, .report_zones = sd_zbc_report_zones,
.pr_ops = &sd_pr_ops, .pr_ops = &sd_pr_ops,
......
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