|
@@ -241,7 +241,7 @@ static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
|
|
|
|
|
|
+static int ide_floppy_format_ioctl(ide_drive_t *drive, fmode_t mode,
|
|
unsigned int cmd, void __user *argp)
|
|
unsigned int cmd, void __user *argp)
|
|
{
|
|
{
|
|
switch (cmd) {
|
|
switch (cmd) {
|
|
@@ -250,7 +250,7 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
|
|
case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY:
|
|
case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY:
|
|
return ide_floppy_get_format_capacities(drive, argp);
|
|
return ide_floppy_get_format_capacities(drive, argp);
|
|
case IDEFLOPPY_IOCTL_FORMAT_START:
|
|
case IDEFLOPPY_IOCTL_FORMAT_START:
|
|
- if (!(file->f_mode & FMODE_WRITE))
|
|
|
|
|
|
+ if (!(mode & FMODE_WRITE))
|
|
return -EPERM;
|
|
return -EPERM;
|
|
return ide_floppy_format_unit(drive, (int __user *)argp);
|
|
return ide_floppy_format_unit(drive, (int __user *)argp);
|
|
case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
|
|
case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
|
|
@@ -260,10 +260,9 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
|
|
|
|
- struct file *file, unsigned int cmd, unsigned long arg)
|
|
|
|
|
|
+int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
|
|
|
|
+ fmode_t mode, unsigned int cmd, unsigned long arg)
|
|
{
|
|
{
|
|
- struct block_device *bdev = inode->i_bdev;
|
|
|
|
struct ide_atapi_pc pc;
|
|
struct ide_atapi_pc pc;
|
|
void __user *argp = (void __user *)arg;
|
|
void __user *argp = (void __user *)arg;
|
|
int err;
|
|
int err;
|
|
@@ -271,7 +270,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
|
|
if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR)
|
|
if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR)
|
|
return ide_floppy_lockdoor(drive, &pc, arg, cmd);
|
|
return ide_floppy_lockdoor(drive, &pc, arg, cmd);
|
|
|
|
|
|
- err = ide_floppy_format_ioctl(drive, file, cmd, argp);
|
|
|
|
|
|
+ err = ide_floppy_format_ioctl(drive, mode, cmd, argp);
|
|
if (err != -ENOTTY)
|
|
if (err != -ENOTTY)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
@@ -281,7 +280,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
|
|
*/
|
|
*/
|
|
if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
|
|
if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
|
|
err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk,
|
|
err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk,
|
|
- file ? file->f_mode : 0, cmd, argp);
|
|
|
|
|
|
+ mode, cmd, argp);
|
|
|
|
|
|
if (err == -ENOTTY)
|
|
if (err == -ENOTTY)
|
|
err = generic_ide_ioctl(drive, bdev, cmd, arg);
|
|
err = generic_ide_ioctl(drive, bdev, cmd, arg);
|