diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-08 16:53:33 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-10 09:32:30 -0600 |
commit | 7fe76fc04bd1b551b8c712249c921facfd98a11b (patch) | |
tree | 9c3c8bac34255d0a3b9ee0fb17ef61e07bd625b3 | |
parent | 4a6f3d480edc3570a8059f3a0fb388641b6ec73f (diff) | |
download | linux-7fe76fc04bd1b551b8c712249c921facfd98a11b.tar.bz2 |
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/swim.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/swim.c b/drivers/block/swim.c index dd34504382e5..d4565c555b28 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -217,6 +217,8 @@ extern int swim_read_sector_header(struct swim __iomem *base, extern int swim_read_sector_data(struct swim __iomem *base, unsigned char *data); +static int floppy_revalidate(struct gendisk *disk); + static DEFINE_MUTEX(swim_mutex); 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) return 0; 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) { err = -EROFS; goto out; @@ -760,7 +763,6 @@ static const struct block_device_operations floppy_fops = { .ioctl = floppy_ioctl, .getgeo = floppy_getgeo, .check_events = floppy_check_events, - .revalidate_disk = floppy_revalidate, }; static struct kobject *floppy_find(dev_t dev, int *part, void *data) |