aboutsummaryrefslogtreecommitdiff
path: root/block/compat_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/compat_ioctl.c')
-rw-r--r--block/compat_ioctl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 1e559fba7bd..576c4fd1546 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -708,17 +708,17 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file,
return -ENOIOCTLCMD;
}
- if (disk->fops->unlocked_ioctl)
- return disk->fops->unlocked_ioctl(file, cmd, arg);
+ if (disk->fops->__unlocked_ioctl)
+ return disk->fops->__unlocked_ioctl(file, cmd, arg);
- if (disk->fops->ioctl) {
+ if (disk->fops->__ioctl) {
lock_kernel();
- ret = disk->fops->ioctl(inode, file, cmd, arg);
+ ret = disk->fops->__ioctl(inode, file, cmd, arg);
unlock_kernel();
return ret;
}
- return -ENOTTY;
+ return __blkdev_driver_ioctl(inode->i_bdev, file->f_mode, cmd, arg);
}
static int compat_blkdev_locked_ioctl(struct inode *inode, struct file *file,
@@ -805,10 +805,11 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
lock_kernel();
ret = compat_blkdev_locked_ioctl(inode, file, bdev, cmd, arg);
- /* FIXME: why do we assume -> compat_ioctl needs the BKL? */
- if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl)
- ret = disk->fops->compat_ioctl(file, cmd, arg);
+ if (ret == -ENOIOCTLCMD && disk->fops->__compat_ioctl)
+ ret = disk->fops->__compat_ioctl(file, cmd, arg);
unlock_kernel();
+ if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl)
+ ret = disk->fops->compat_ioctl(bdev, file->f_mode, cmd, arg);
if (ret != -ENOIOCTLCMD)
return ret;