Skip to content

Commit

Permalink
[PATCH] switch dasd
Browse files Browse the repository at this point in the history
->compat_ioctl() actually had been useless here; generic
logics works fine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 21, 2008
1 parent af0e2a0 commit 57a7c0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
15 changes: 6 additions & 9 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -2052,9 +2051,8 @@ static int dasd_open(struct inode *inp, struct file *filp)
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);
Expand Down Expand Up @@ -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,
};

Expand Down
3 changes: 1 addition & 2 deletions drivers/s390/block/dasd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 1 addition & 14 deletions drivers/s390/block/dasd_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

0 comments on commit 57a7c0b

Please sign in to comment.