X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fioctl.c;h=f855ea4fc88895a13b53b075b9a3fb0dbcb53d8b;hb=7e6b6465e6efbca3985258996be9c189da96c8bf;hp=2d140a713861badfb1c9b936c683805dab30853a;hpb=a70ce4b6064b64477ed12ef1878980f842819094;p=mv-sheeva.git diff --git a/fs/ioctl.c b/fs/ioctl.c index 2d140a71386..f855ea4fc88 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -29,7 +29,6 @@ * @arg: command-specific argument for ioctl * * Invokes filesystem specific ->unlocked_ioctl, if one exists; otherwise - * invokes filesystem specific ->ioctl method. If neither method exists, * returns -ENOTTY. * * Returns 0 on success, -errno on error. @@ -39,21 +38,12 @@ static long vfs_ioctl(struct file *filp, unsigned int cmd, { int error = -ENOTTY; - if (!filp->f_op) + if (!filp->f_op || !filp->f_op->unlocked_ioctl) goto out; - if (filp->f_op->unlocked_ioctl) { - error = filp->f_op->unlocked_ioctl(filp, cmd, arg); - if (error == -ENOIOCTLCMD) - error = -EINVAL; - goto out; - } else if (filp->f_op->ioctl) { - lock_kernel(); - error = filp->f_op->ioctl(filp->f_path.dentry->d_inode, - filp, cmd, arg); - unlock_kernel(); - } - + error = filp->f_op->unlocked_ioctl(filp, cmd, arg); + if (error == -ENOIOCTLCMD) + error = -EINVAL; out: return error; }