Commit 7fe76fc0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

swim: use bdev_check_media_change

Switch to use bdev_check_media_change instead of check_disk_change and
call floppy_revalidate manually.  Given that floppy_revalidate only
deals with media change events, 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 4a6f3d48
...@@ -217,6 +217,8 @@ extern int swim_read_sector_header(struct swim __iomem *base, ...@@ -217,6 +217,8 @@ extern int swim_read_sector_header(struct swim __iomem *base,
extern int swim_read_sector_data(struct swim __iomem *base, extern int swim_read_sector_data(struct swim __iomem *base,
unsigned char *data); unsigned char *data);
static int floppy_revalidate(struct gendisk *disk);
static DEFINE_MUTEX(swim_mutex); static DEFINE_MUTEX(swim_mutex);
static inline void set_swim_mode(struct swim __iomem *base, int enable) static inline void set_swim_mode(struct swim __iomem *base, int enable)
{ {
...@@ -638,7 +640,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) ...@@ -638,7 +640,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
return 0; return 0;
if (mode & (FMODE_READ|FMODE_WRITE)) { if (mode & (FMODE_READ|FMODE_WRITE)) {
check_disk_change(bdev); if (bdev_check_media_change(bdev))
floppy_revalidate(bdev->bd_disk);
if ((mode & FMODE_WRITE) && fs->write_protected) { if ((mode & FMODE_WRITE) && fs->write_protected) {
err = -EROFS; err = -EROFS;
goto out; goto out;
...@@ -760,7 +763,6 @@ static const struct block_device_operations floppy_fops = { ...@@ -760,7 +763,6 @@ static const struct block_device_operations floppy_fops = {
.ioctl = floppy_ioctl, .ioctl = floppy_ioctl,
.getgeo = floppy_getgeo, .getgeo = floppy_getgeo,
.check_events = floppy_check_events, .check_events = floppy_check_events,
.revalidate_disk = floppy_revalidate,
}; };
static struct kobject *floppy_find(dev_t dev, int *part, void *data) static struct kobject *floppy_find(dev_t dev, int *part, void *data)
......
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