1
0
Fork 0

vhost: add vsock compat ioctl

This will allow usage of vsock from 32-bit binaries on a 64-bit
kernel.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hifive-unleashed-5.1
Sonny Rao 2018-03-14 14:36:25 -07:00 committed by Michael S. Tsirkin
parent 26b3660452
commit dc32bb678e
1 changed files with 11 additions and 0 deletions

View File

@ -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 = {
.owner = THIS_MODULE,
.open = vhost_vsock_dev_open,
.release = vhost_vsock_dev_release,
.llseek = noop_llseek,
.unlocked_ioctl = vhost_vsock_dev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = vhost_vsock_dev_compat_ioctl,
#endif
};
static struct miscdevice vhost_vsock_misc = {