open-vm-tools/0007-Fix-vmhgfs-module-on-kernels-3.16.patch
Dominique Leuenberger de200b6f0e - Sync up patches with ArchLinux:
+ Added 0001-Remove-unused-DEPRECATED-macro.patch
  + Added 0002-Conditionally-define-g_info-macro.patch
  + Added 0003-Add-kuid_t-kgid_t-compatibility-layer.patch
  + Added 0004-Use-new-link-helpers.patch
  + Added 0005-Update-hgfs-file-operations-for-newer-kernels.patch
  + Added 0006-Fix-vmxnet-module-on-kernels-3.16.patch
  + Added 0007-Fix-vmhgfs-module-on-kernels-3.16.patch
  + Added 0008-Fix-segfault-in-vmhgfs.patch
  + Droped g_info_redefine.patch (now named
    0002-Conditionally-define-g_info-macro.patch).
- Enable building of KMP packages.
- Fix bashisms in preun script.
- Do not generate timestamps in the doxygen docs.

OBS-URL: https://build.opensuse.org/package/show/Virtualization:VMware/open-vm-tools?expand=0&rev=267
2014-11-10 16:06:43 +00:00

76 lines
2.4 KiB
Diff

From 6497dbbabb9506df8e16b60bf2cd396a8c6bb26b Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Fri, 15 Aug 2014 10:42:30 -0400
Subject: [PATCH 11/11] Fix vmhgfs module on kernels >= 3.16
* Use read_iter/write_iter file operations on kernels >= 3.16.
* Do not set aio_read/aio_write on kernels >= 3.16.
---
open-vm-tools/modules/linux/vmhgfs/file.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/open-vm-tools/modules/linux/vmhgfs/file.c b/open-vm-tools/modules/linux/vmhgfs/file.c
index 825cebe..67606fd 100644
--- a/open-vm-tools/modules/linux/vmhgfs/file.c
+++ b/open-vm-tools/modules/linux/vmhgfs/file.c
@@ -76,6 +76,7 @@ static int HgfsGetOpenFlags(uint32 flags);
static int HgfsOpen(struct inode *inode,
struct file *file);
#if defined VMW_USE_AIO
+# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
static ssize_t HgfsAioRead(struct kiocb *iocb,
const struct iovec *iov,
unsigned long numSegs,
@@ -84,6 +85,7 @@ static ssize_t HgfsAioWrite(struct kiocb *iocb,
const struct iovec *iov,
unsigned long numSegs,
loff_t offset);
+# endif
#else
static ssize_t HgfsRead(struct file *file,
char __user *buf,
@@ -150,15 +152,20 @@ struct file_operations HgfsFileFileOperations = {
.open = HgfsOpen,
.llseek = HgfsSeek,
.flush = HgfsFlush,
-#if defined VMW_USE_AIO
+#ifdef VMW_USE_AIO
.read = do_sync_read,
.write = do_sync_write,
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+ .read_iter = generic_file_read_iter,
+ .write_iter = generic_file_write_iter,
+# else
.aio_read = HgfsAioRead,
.aio_write = HgfsAioWrite,
-#else
+# endif
+#else /* !VMW_USE_AIO */
.read = HgfsRead,
.write = HgfsWrite,
-#endif
+#endif /* !VMW_USE_AIO */
.fsync = HgfsFsync,
.mmap = HgfsMmap,
.release = HgfsRelease,
@@ -748,6 +755,7 @@ out:
#if defined VMW_USE_AIO
+# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
/*
*----------------------------------------------------------------------
*
@@ -883,7 +891,7 @@ out:
return result;
}
-
+# endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) */
#else
/*
*----------------------------------------------------------------------
--
2.0.4