diff options
author | Sonny Rao <sonnyrao@chromium.org> | 2018-03-14 17:36:25 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-03-19 21:17:42 -0400 |
commit | dc32bb678e103afbcfa4d814489af0566307f528 (patch) | |
tree | bb181af92c1f7e40734dad404339bdef4c480b7c /drivers | |
parent | 26b36604523f4a681a86e6cbc970ea72a2e9fb8a (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/vhost/vsock.c | 11 |
1 files changed, 11 insertions, 0 deletions
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, | |||
699 | } | 699 | } |
700 | } | 700 | } |
701 | 701 | ||
702 | #ifdef CONFIG_COMPAT | ||
703 | static long vhost_vsock_dev_compat_ioctl(struct file *f, unsigned int ioctl, | ||
704 | unsigned long arg) | ||
705 | { | ||
706 | return vhost_vsock_dev_ioctl(f, ioctl, (unsigned long)compat_ptr(arg)); | ||
707 | } | ||
708 | #endif | ||
709 | |||
702 | static const struct file_operations vhost_vsock_fops = { | 710 | static const struct file_operations vhost_vsock_fops = { |
703 | .owner = THIS_MODULE, | 711 | .owner = THIS_MODULE, |
704 | .open = vhost_vsock_dev_open, | 712 | .open = vhost_vsock_dev_open, |
705 | .release = vhost_vsock_dev_release, | 713 | .release = vhost_vsock_dev_release, |
706 | .llseek = noop_llseek, | 714 | .llseek = noop_llseek, |
707 | .unlocked_ioctl = vhost_vsock_dev_ioctl, | 715 | .unlocked_ioctl = vhost_vsock_dev_ioctl, |
716 | #ifdef CONFIG_COMPAT | ||
717 | .compat_ioctl = vhost_vsock_dev_compat_ioctl, | ||
718 | #endif | ||
708 | }; | 719 | }; |
709 | 720 | ||
710 | static struct miscdevice vhost_vsock_misc = { | 721 | static struct miscdevice vhost_vsock_misc = { |