Commit 05bb8b5f authored by Andi Kleen's avatar Andi Kleen Committed by James Bottomley

[PATCH] Add compat_ioctl to SG

Add compat_ioctl to SG driver
Signed-off-by: default avatarAndi Kleen <ak@muc.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 037f81dc
......@@ -1037,6 +1037,29 @@ sg_ioctl(struct inode *inode, struct file *filp,
}
}
#ifdef CONFIG_COMPAT
static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
{
Sg_device *sdp;
Sg_fd *sfp;
struct scsi_device *sdev;
if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
sdev = sdp->device;
if (sdev->host->hostt->compat_ioctl) {
int ret;
ret = sdev->host->hostt->compat_ioctl(sdev, cmd_in, (void __user *)arg);
return ret;
}
return -ENOIOCTLCMD;
}
#endif
static unsigned int
sg_poll(struct file *filp, poll_table * wait)
{
......@@ -1346,6 +1369,9 @@ static struct file_operations sg_fops = {
.write = sg_write,
.poll = sg_poll,
.ioctl = sg_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = sg_compat_ioctl,
#endif
.open = sg_open,
.mmap = sg_mmap,
.release = sg_release,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment