]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/compat_ioctl.c
[PATCH] end of methods switch: remove the old ones
[linux-2.6-omap-h63xx.git] / block / compat_ioctl.c
index c23177e4623f1ba73804479460742dd63339556a..fd537fdb25a3c6fddd5058629c0b30145dc18744 100644 (file)
@@ -708,17 +708,7 @@ 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->ioctl) {
-               lock_kernel();
-               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,
@@ -788,6 +778,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
                return compat_hdio_getgeo(disk, bdev, compat_ptr(arg));
        case BLKFLSBUF:
        case BLKROSET:
+       case BLKDISCARD:
        /*
         * the ones below are implemented in blkdev_locked_ioctl,
         * but we call blkdev_ioctl, which gets the lock for us
@@ -804,10 +795,9 @@ 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);
        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;