From 60ad23400717f70b8f0ee623b50d343d45f7b135 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Mar 2008 09:23:54 -0500 Subject: [PATCH] switch ataflop Signed-off-by: Al Viro --- drivers/block/ataflop.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'drivers/block/ataflop.c') diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 30166774327d..69e1df7dfa14 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -361,13 +361,13 @@ static void finish_fdc( void ); static void finish_fdc_done( int dummy ); static void setup_req_params( int drive ); static void redo_fd_request( void); -static int fd_ioctl( struct inode *inode, struct file *filp, unsigned int +static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param); static void fd_probe( int drive ); static int fd_test_drive_present( int drive ); static void config_types( void ); -static int floppy_open( struct inode *inode, struct file *filp ); -static int floppy_release( struct inode * inode, struct file * filp ); +static int floppy_open(struct block_device *bdev, fmode_t mode); +static int floppy_release(struct gendisk *disk, fmode_t mode); /************************* End of Prototypes **************************/ @@ -1483,10 +1483,10 @@ void do_fd_request(struct request_queue * q) atari_enable_irq( IRQ_MFP_FDC ); } -static int fd_ioctl(struct inode *inode, struct file *filp, +static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param) { - struct gendisk *disk = inode->i_bdev->bd_disk; + struct gendisk *disk = bdev->bd_disk; struct atari_floppy_struct *floppy = disk->private_data; int drive = floppy - unit; int type = floppy->type; @@ -1661,7 +1661,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, /* invalidate the buffer track to force a reread */ BufferDrive = -1; set_bit(drive, &fake_change); - check_disk_change(inode->i_bdev); + check_disk_change(bdev); return 0; default: return -EINVAL; @@ -1804,37 +1804,36 @@ static void __init config_types( void ) * drive with different device numbers. */ -static int floppy_open( struct inode *inode, struct file *filp ) +static int floppy_open(struct block_device *bdev, fmode_t mode) { - struct atari_floppy_struct *p = inode->i_bdev->bd_disk->private_data; - int type = iminor(inode) >> 2; + struct atari_floppy_struct *p = bdev->bd_disk->private_data; + int type = MINOR(bdev->bd_dev) >> 2; DPRINT(("fd_open: type=%d\n",type)); if (p->ref && p->type != type) return -EBUSY; - if (p->ref == -1 || (p->ref && filp->f_mode & FMODE_EXCL)) + if (p->ref == -1 || (p->ref && mode & FMODE_EXCL)) return -EBUSY; - if (filp->f_mode & FMODE_EXCL) + if (mode & FMODE_EXCL) p->ref = -1; else p->ref++; p->type = type; - if (filp->f_mode & FMODE_NDELAY) + if (mode & FMODE_NDELAY) return 0; - if (filp->f_mode & (FMODE_READ|FMODE_WRITE)) { - check_disk_change(inode->i_bdev); - if (filp->f_mode & FMODE_WRITE) { + if (mode & (FMODE_READ|FMODE_WRITE)) { + check_disk_change(bdev); + if (mode & FMODE_WRITE) { if (p->wpstat) { if (p->ref < 0) p->ref = 0; else p->ref--; - floppy_release(inode, filp); return -EROFS; } } @@ -1843,9 +1842,9 @@ static int floppy_open( struct inode *inode, struct file *filp ) } -static int floppy_release( struct inode * inode, struct file * filp ) +static int floppy_release(struct gendisk *disk, fmode_t mode) { - struct atari_floppy_struct *p = inode->i_bdev->bd_disk->private_data; + struct atari_floppy_struct *p = disk->private_data; if (p->ref < 0) p->ref = 0; else if (!p->ref--) { @@ -1857,9 +1856,9 @@ static int floppy_release( struct inode * inode, struct file * filp ) static struct block_device_operations floppy_fops = { .owner = THIS_MODULE, - .__open = floppy_open, - .__release = floppy_release, - .__ioctl = fd_ioctl, + .open = floppy_open, + .release = floppy_release, + .locked_ioctl = fd_ioctl, .media_changed = check_floppy_change, .revalidate_disk= floppy_revalidate, }; -- cgit v1.2.3