1
0
Fork 0

[PATCH] switch dasd

->compat_ioctl() actually had been useless here; generic
logics works fine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
hifive-unleashed-5.1
Al Viro 2008-03-02 10:36:08 -05:00
parent af0e2a0a87
commit 57a7c0bca0
3 changed files with 8 additions and 25 deletions

View File

@ -2011,10 +2011,9 @@ static void dasd_flush_request_queue(struct dasd_block *block)
spin_unlock_irq(&block->request_queue_lock);
}
static int dasd_open(struct inode *inp, struct file *filp)
static int dasd_open(struct block_device *bdev, fmode_t mode)
{
struct gendisk *disk = inp->i_bdev->bd_disk;
struct dasd_block *block = disk->private_data;
struct dasd_block *block = bdev->bd_disk->private_data;
struct dasd_device *base = block->base;
int rc;
@ -2052,9 +2051,8 @@ unlock:
return rc;
}
static int dasd_release(struct inode *inp, struct file *filp)
static int dasd_release(struct gendisk *disk, fmode_t mode)
{
struct gendisk *disk = inp->i_bdev->bd_disk;
struct dasd_block *block = disk->private_data;
atomic_dec(&block->open_count);
@ -2087,10 +2085,9 @@ static int dasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
struct block_device_operations
dasd_device_operations = {
.owner = THIS_MODULE,
.__open = dasd_open,
.__release = dasd_release,
.__ioctl = dasd_ioctl,
.__compat_ioctl = dasd_compat_ioctl,
.open = dasd_open,
.release = dasd_release,
.locked_ioctl = dasd_ioctl,
.getgeo = dasd_getgeo,
};

View File

@ -610,8 +610,7 @@ int dasd_scan_partitions(struct dasd_block *);
void dasd_destroy_partitions(struct dasd_block *);
/* externals in dasd_ioctl.c */
int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
long dasd_compat_ioctl(struct file *, unsigned int, unsigned long);
int dasd_ioctl(struct block_device *, fmode_t, unsigned int, unsigned long);
/* externals in dasd_proc.c */
int dasd_proc_init(void);

View File

@ -366,10 +366,9 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd,
}
int
dasd_ioctl(struct inode *inode, struct file *file,
dasd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
struct block_device *bdev = inode->i_bdev;
struct dasd_block *block = bdev->bd_disk->private_data;
void __user *argp = (void __user *)arg;
@ -421,15 +420,3 @@ dasd_ioctl(struct inode *inode, struct file *file,
return -EINVAL;
}
}
long
dasd_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
int rval;
lock_kernel();
rval = dasd_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg);
unlock_kernel();
return (rval == -EINVAL) ? -ENOIOCTLCMD : rval;
}