@@ -241,7 +241,7 @@ static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc,
241241 return 0 ;
242242}
243243
244- static int ide_floppy_format_ioctl (ide_drive_t * drive , struct file * file ,
244+ static int ide_floppy_format_ioctl (ide_drive_t * drive , fmode_t mode ,
245245 unsigned int cmd , void __user * argp )
246246{
247247 switch (cmd ) {
@@ -250,7 +250,7 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
250250 case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY :
251251 return ide_floppy_get_format_capacities (drive , argp );
252252 case IDEFLOPPY_IOCTL_FORMAT_START :
253- if (!(file -> f_mode & FMODE_WRITE ))
253+ if (!(mode & FMODE_WRITE ))
254254 return - EPERM ;
255255 return ide_floppy_format_unit (drive , (int __user * )argp );
256256 case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS :
@@ -260,18 +260,17 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
260260 }
261261}
262262
263- int ide_floppy_ioctl (ide_drive_t * drive , struct inode * inode ,
264- struct file * file , unsigned int cmd , unsigned long arg )
263+ int ide_floppy_ioctl (ide_drive_t * drive , struct block_device * bdev ,
264+ fmode_t mode , unsigned int cmd , unsigned long arg )
265265{
266- struct block_device * bdev = inode -> i_bdev ;
267266 struct ide_atapi_pc pc ;
268267 void __user * argp = (void __user * )arg ;
269268 int err ;
270269
271270 if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR )
272271 return ide_floppy_lockdoor (drive , & pc , arg , cmd );
273272
274- err = ide_floppy_format_ioctl (drive , file , cmd , argp );
273+ err = ide_floppy_format_ioctl (drive , mode , cmd , argp );
275274 if (err != - ENOTTY )
276275 return err ;
277276
@@ -281,7 +280,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
281280 */
282281 if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND )
283282 err = scsi_cmd_ioctl (bdev -> bd_disk -> queue , bdev -> bd_disk ,
284- file ? file -> f_mode : 0 , cmd , argp );
283+ mode , cmd , argp );
285284
286285 if (err == - ENOTTY )
287286 err = generic_ide_ioctl (drive , bdev , cmd , arg );
0 commit comments