mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -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
@@ -3210,13 +3210,13 @@ static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
|
||||
|
||||
#endif
|
||||
|
||||
static int invalidate_drive(struct block_device *bdev)
|
||||
static int invalidate_drive(struct gendisk *disk)
|
||||
{
|
||||
/* invalidate the buffer track to force a reread */
|
||||
set_bit((long)bdev->bd_disk->private_data, &fake_change);
|
||||
set_bit((long)disk->private_data, &fake_change);
|
||||
process_fd_request();
|
||||
if (bdev_check_media_change(bdev))
|
||||
floppy_revalidate(bdev->bd_disk);
|
||||
if (disk_check_media_change(disk))
|
||||
floppy_revalidate(disk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3287,7 +3287,7 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g,
|
||||
drive_state[current_drive].maxtrack ||
|
||||
((user_params[drive].sect ^ oldStretch) &
|
||||
(FD_SWAPSIDES | FD_SECTBASEMASK)))
|
||||
invalidate_drive(bdev);
|
||||
invalidate_drive(bdev->bd_disk);
|
||||
else
|
||||
process_fd_request();
|
||||
}
|
||||
@@ -3464,7 +3464,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
|
||||
current_type[drive] = NULL;
|
||||
floppy_sizes[drive] = MAX_DISK_SIZE << 1;
|
||||
drive_state[drive].keep_data = 0;
|
||||
return invalidate_drive(bdev);
|
||||
return invalidate_drive(bdev->bd_disk);
|
||||
case FDSETPRM:
|
||||
case FDDEFPRM:
|
||||
return set_geometry(cmd, &inparam.g, drive, type, bdev);
|
||||
@@ -3503,7 +3503,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
|
||||
case FDFLUSH:
|
||||
if (lock_fdc(drive))
|
||||
return -EINTR;
|
||||
return invalidate_drive(bdev);
|
||||
return invalidate_drive(bdev->bd_disk);
|
||||
case FDSETEMSGTRESH:
|
||||
drive_params[drive].max_errors.reporting = (unsigned short)(param & 0x0f);
|
||||
return 0;
|
||||
@@ -4054,7 +4054,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
|
||||
drive_state[drive].last_checked = 0;
|
||||
clear_bit(FD_OPEN_SHOULD_FAIL_BIT,
|
||||
&drive_state[drive].flags);
|
||||
if (bdev_check_media_change(bdev))
|
||||
if (disk_check_media_change(bdev->bd_disk))
|
||||
floppy_revalidate(bdev->bd_disk);
|
||||
if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags))
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user