Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] switch swim3

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro b4d9a442 5e5e007c

+18 -18
+18 -18
drivers/block/swim3.c
··· 244 244 int interruptible); 245 245 static void release_drive(struct floppy_state *fs); 246 246 static 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, 248 248 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); 251 251 static int floppy_check_change(struct gendisk *disk); 252 252 static int floppy_revalidate(struct gendisk *disk); 253 253 ··· 839 839 static struct floppy_struct floppy_type = 840 840 { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }; /* 7 1.44MB 3.5" */ 841 841 842 - static int floppy_ioctl(struct inode *inode, struct file *filp, 842 + static int floppy_ioctl(struct block_device *bdev, fmode_t mode, 843 843 unsigned int cmd, unsigned long param) 844 844 { 845 - struct floppy_state *fs = inode->i_bdev->bd_disk->private_data; 845 + struct floppy_state *fs = bdev->bd_disk->private_data; 846 846 int err; 847 847 848 848 if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN)) ··· 868 868 return -ENOTTY; 869 869 } 870 870 871 - static int floppy_open(struct inode *inode, struct file *filp) 871 + static int floppy_open(struct block_device *bdev, fmode_t mode) 872 872 { 873 - struct floppy_state *fs = inode->i_bdev->bd_disk->private_data; 873 + struct floppy_state *fs = bdev->bd_disk->private_data; 874 874 struct swim3 __iomem *sw = fs->swim3; 875 875 int n, err = 0; 876 876 ··· 904 904 swim3_action(fs, SETMFM); 905 905 swim3_select(fs, RELAX); 906 906 907 - } else if (fs->ref_count == -1 || filp->f_mode & FMODE_EXCL) 907 + } else if (fs->ref_count == -1 || mode & FMODE_EXCL) 908 908 return -EBUSY; 909 909 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); 913 913 if (fs->ejected) 914 914 err = -ENXIO; 915 915 } 916 916 917 - if (err == 0 && (filp->f_mode & FMODE_WRITE)) { 917 + if (err == 0 && (mode & FMODE_WRITE)) { 918 918 if (fs->write_prot < 0) 919 919 fs->write_prot = swim3_readbit(fs, WRITE_PROT); 920 920 if (fs->write_prot) ··· 930 930 return err; 931 931 } 932 932 933 - if (filp->f_mode & FMODE_EXCL) 933 + if (mode & FMODE_EXCL) 934 934 fs->ref_count = -1; 935 935 else 936 936 ++fs->ref_count; ··· 938 938 return 0; 939 939 } 940 940 941 - static int floppy_release(struct inode *inode, struct file *filp) 941 + static int floppy_release(struct gendisk *disk, fmode_t mode) 942 942 { 943 - struct floppy_state *fs = inode->i_bdev->bd_disk->private_data; 943 + struct floppy_state *fs = disk->private_data; 944 944 struct swim3 __iomem *sw = fs->swim3; 945 945 if (fs->ref_count > 0 && --fs->ref_count == 0) { 946 946 swim3_action(fs, MOTOR_OFF); ··· 998 998 } 999 999 1000 1000 static 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, 1004 1004 .media_changed = floppy_check_change, 1005 1005 .revalidate_disk= floppy_revalidate, 1006 1006 };