@@ -244,10 +244,10 @@ static int grab_drive(struct floppy_state *fs, enum swim_state state,
244244 int interruptible );
245245static void release_drive (struct floppy_state * fs );
246246static int fd_eject (struct floppy_state * fs );
247- static int floppy_ioctl (struct inode * inode , struct file * filp ,
247+ static int floppy_ioctl (struct block_device * bdev , fmode_t mode ,
248248 unsigned int cmd , unsigned long param );
249- static int floppy_open (struct inode * inode , struct file * filp );
250- static int floppy_release (struct inode * inode , struct file * filp );
249+ static int floppy_open (struct block_device * bdev , fmode_t mode );
250+ static int floppy_release (struct gendisk * disk , fmode_t mode );
251251static int floppy_check_change (struct gendisk * disk );
252252static int floppy_revalidate (struct gendisk * disk );
253253
@@ -839,10 +839,10 @@ static int fd_eject(struct floppy_state *fs)
839839static struct floppy_struct floppy_type =
840840 { 2880 ,18 ,2 ,80 ,0 ,0x1B ,0x00 ,0xCF ,0x6C ,NULL }; /* 7 1.44MB 3.5" */
841841
842- static int floppy_ioctl (struct inode * inode , struct file * filp ,
842+ static int floppy_ioctl (struct block_device * bdev , fmode_t mode ,
843843 unsigned int cmd , unsigned long param )
844844{
845- struct floppy_state * fs = inode -> i_bdev -> bd_disk -> private_data ;
845+ struct floppy_state * fs = bdev -> bd_disk -> private_data ;
846846 int err ;
847847
848848 if ((cmd & 0x80 ) && !capable (CAP_SYS_ADMIN ))
@@ -868,9 +868,9 @@ static int floppy_ioctl(struct inode *inode, struct file *filp,
868868 return - ENOTTY ;
869869}
870870
871- static int floppy_open (struct inode * inode , struct file * filp )
871+ static int floppy_open (struct block_device * bdev , fmode_t mode )
872872{
873- struct floppy_state * fs = inode -> i_bdev -> bd_disk -> private_data ;
873+ struct floppy_state * fs = bdev -> bd_disk -> private_data ;
874874 struct swim3 __iomem * sw = fs -> swim3 ;
875875 int n , err = 0 ;
876876
@@ -904,17 +904,17 @@ static int floppy_open(struct inode *inode, struct file *filp)
904904 swim3_action (fs , SETMFM );
905905 swim3_select (fs , RELAX );
906906
907- } else if (fs -> ref_count == -1 || filp -> f_mode & FMODE_EXCL )
907+ } else if (fs -> ref_count == -1 || mode & FMODE_EXCL )
908908 return - EBUSY ;
909909
910- if (err == 0 && (filp -> f_mode & FMODE_NDELAY ) == 0
911- && (filp -> f_mode & (FMODE_READ |FMODE_WRITE ))) {
912- check_disk_change (inode -> i_bdev );
910+ if (err == 0 && (mode & FMODE_NDELAY ) == 0
911+ && (mode & (FMODE_READ |FMODE_WRITE ))) {
912+ check_disk_change (bdev );
913913 if (fs -> ejected )
914914 err = - ENXIO ;
915915 }
916916
917- if (err == 0 && (filp -> f_mode & FMODE_WRITE )) {
917+ if (err == 0 && (mode & FMODE_WRITE )) {
918918 if (fs -> write_prot < 0 )
919919 fs -> write_prot = swim3_readbit (fs , WRITE_PROT );
920920 if (fs -> write_prot )
@@ -930,17 +930,17 @@ static int floppy_open(struct inode *inode, struct file *filp)
930930 return err ;
931931 }
932932
933- if (filp -> f_mode & FMODE_EXCL )
933+ if (mode & FMODE_EXCL )
934934 fs -> ref_count = -1 ;
935935 else
936936 ++ fs -> ref_count ;
937937
938938 return 0 ;
939939}
940940
941- static int floppy_release (struct inode * inode , struct file * filp )
941+ static int floppy_release (struct gendisk * disk , fmode_t mode )
942942{
943- struct floppy_state * fs = inode -> i_bdev -> bd_disk -> private_data ;
943+ struct floppy_state * fs = disk -> private_data ;
944944 struct swim3 __iomem * sw = fs -> swim3 ;
945945 if (fs -> ref_count > 0 && -- fs -> ref_count == 0 ) {
946946 swim3_action (fs , MOTOR_OFF );
@@ -998,9 +998,9 @@ static int floppy_revalidate(struct gendisk *disk)
998998}
999999
10001000static struct block_device_operations floppy_fops = {
1001- .__open = floppy_open ,
1002- .__release = floppy_release ,
1003- .__ioctl = floppy_ioctl ,
1001+ .open = floppy_open ,
1002+ .release = floppy_release ,
1003+ .locked_ioctl = floppy_ioctl ,
10041004 .media_changed = floppy_check_change ,
10051005 .revalidate_disk = floppy_revalidate ,
10061006};
0 commit comments