From: Sonny Rao Date: Wed, 14 Mar 2018 21:36:25 +0000 (-0700) Subject: vhost: add vsock compat ioctl X-Git-Tag: Ubuntu-5.2.0-15.16~4660^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=dc32bb678e103afbcfa4d814489af0566307f528;p=mirror_ubuntu-eoan-kernel.git 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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0d14e2ff19f1..ee0c385d9fe5 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -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 = {