提交 dc32bb67 编写于 作者: S Sonny Rao 提交者: Michael S. Tsirkin

vhost: add vsock compat ioctl

This will allow usage of vsock from 32-bit binaries on a 64-bit
kernel.
Signed-off-by: NSonny Rao <sonnyrao@chromium.org>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 26b36604
...@@ -699,12 +699,23 @@ static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl, ...@@ -699,12 +699,23 @@ static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl,
} }
} }
#ifdef CONFIG_COMPAT
static long vhost_vsock_dev_compat_ioctl(struct file *f, unsigned int ioctl,
unsigned long arg)
{
return vhost_vsock_dev_ioctl(f, ioctl, (unsigned long)compat_ptr(arg));
}
#endif
static const struct file_operations vhost_vsock_fops = { static const struct file_operations vhost_vsock_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = vhost_vsock_dev_open, .open = vhost_vsock_dev_open,
.release = vhost_vsock_dev_release, .release = vhost_vsock_dev_release,
.llseek = noop_llseek, .llseek = noop_llseek,
.unlocked_ioctl = vhost_vsock_dev_ioctl, .unlocked_ioctl = vhost_vsock_dev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = vhost_vsock_dev_compat_ioctl,
#endif
}; };
static struct miscdevice vhost_vsock_misc = { static struct miscdevice vhost_vsock_misc = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册