mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
block: pass a gendisk on bdev_check_media_change
bdev_check_media_change should only ever be called for the whole device. Pass a gendisk to make that explicit and rename the function to disk_check_media_change. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Christian Brauner <brauner@kernel.org> Link: https://lore.kernel.org/r/20230608110258.189493-8-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
7ae24fcee9
commit
444aa2c58c
@@ -1760,8 +1760,8 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
/* invalidate the buffer track to force a reread */
|
||||
BufferDrive = -1;
|
||||
set_bit(drive, &fake_change);
|
||||
if (bdev_check_media_change(bdev))
|
||||
floppy_revalidate(bdev->bd_disk);
|
||||
if (disk_check_media_change(disk))
|
||||
floppy_revalidate(disk);
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
@@ -1938,7 +1938,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
|
||||
return 0;
|
||||
|
||||
if (mode & (FMODE_READ|FMODE_WRITE)) {
|
||||
if (bdev_check_media_change(bdev))
|
||||
if (disk_check_media_change(bdev->bd_disk))
|
||||
floppy_revalidate(bdev->bd_disk);
|
||||
if (mode & FMODE_WRITE) {
|
||||
if (p->wpstat) {
|
||||
|
||||
Reference in New Issue
Block a user