]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix HGFS, pvscsi, vmxnet3, vmci, and vmnet build problems on 3.3 kernel
authorVMware, Inc <>
Tue, 13 Mar 2012 20:11:30 +0000 (13:11 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 14 Mar 2012 16:43:26 +0000 (09:43 -0700)
hgfs: Mode argument is now umode_t, rather than int.

vmxnet3: Features are netdev_features_t, rather than uint32 (and
they are uint64 now).

vmci, pvscsi: Bool module option is bool, not int.

vmnet: Missing compat_module.h include.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/modules/linux/shared/compat_fs.h
open-vm-tools/modules/linux/shared/compat_netdevice.h
open-vm-tools/modules/linux/vmci/linux/driver.c
open-vm-tools/modules/linux/vmhgfs/inode.c

index 1d606c6f367991fa02278383fa6ad5ca1f47e885..7ec30bd8811612dbc63ebeec7f92216cc9909776 100644 (file)
 #define VMW_FSYNC_OLD
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+typedef umode_t compat_umode_t;
+#else
+typedef int compat_umode_t;
+#endif
+
 #endif /* __COMPAT_FS_H__ */
index b7abd5624318027dc2fc265459fe25b991a0b276..3aec25ba15564ecd5de8a71466fe8707842317d6 100644 (file)
@@ -331,4 +331,10 @@ compat_multiqueue_allowed(struct pci_dev *dev)
 #   define compat_vlan_get_protocol(skb) (skb->protocol)
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+typedef netdev_features_t compat_netdev_features_t;
+#else
+typedef u32 compat_netdev_features_t;
+#endif
+
 #endif /* __COMPAT_NETDEVICE_H__ */
index c27d0682f86f773679f319c5dda953b1435d58ef..b14b17129132a831a99494259bcc26438fcc0f18 100644 (file)
@@ -150,11 +150,22 @@ static void process_bitmap(unsigned long data);
 #  define VMCI_DISABLE_MSIX   1
 #endif
 
+/*
+ * Linux kernel < 2.6.31 takes 'int' for 'bool' module parameters.
+ * Linux kernel >= 3.3.0 takes 'bool' for 'bool' module parameters.
+ * Kernels between the two take either.  So flip switch at 3.0.0.
+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
+#  define compat_bool bool
+#else
+#  define compat_bool int
+#endif
+
 static vmci_device vmci_dev;
-static int vmci_disable_host = 0;
-static int vmci_disable_guest = 0;
-static int vmci_disable_msi;
-static int vmci_disable_msix = VMCI_DISABLE_MSIX;
+static compat_bool vmci_disable_host = 0;
+static compat_bool vmci_disable_guest = 0;
+static compat_bool vmci_disable_msi;
+static compat_bool vmci_disable_msix = VMCI_DISABLE_MSIX;
 
 DECLARE_TASKLET(vmci_dg_tasklet, dispatch_datagrams,
                 (unsigned long)&vmci_dev);
index 16b68b0becc014779d95f2d53b6da081f9af5b17..0f400d995e316fd2e27adf5c5d43b317dab139e0 100644 (file)
@@ -61,7 +61,7 @@ static int HgfsPackSetattrRequest(struct iattr *iattr,
                                   HgfsReq *req,
                                   Bool *changed);
 static int HgfsPackCreateDirRequest(struct dentry *dentry,
-                                    int mode,
+                                    compat_umode_t mode,
                                    HgfsOp opUsed,
                                     HgfsReq *req);
 static int HgfsTruncatePages(struct inode *inode,
@@ -74,14 +74,14 @@ static int HgfsPackSymlinkCreateRequest(struct dentry *dentry,
 /* HGFS inode operations. */
 static int HgfsCreate(struct inode *dir,
                       struct dentry *dentry,
-                      int mode,
+                      compat_umode_t mode,
                       struct nameidata *nd);
 static struct dentry *HgfsLookup(struct inode *dir,
                                  struct dentry *dentry,
                                  struct nameidata *nd);
 static int HgfsMkdir(struct inode *dir,
                      struct dentry *dentry,
-                     int mode);
+                     compat_umode_t mode);
 static int HgfsRmdir(struct inode *dir,
                      struct dentry *dentry);
 static int HgfsUnlink(struct inode *dir,
@@ -729,7 +729,7 @@ HgfsPackSetattrRequest(struct iattr *iattr,   // IN: Inode attrs to update from
 
 static int
 HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create
-                         int mode,              // IN: Mode to assign dir
+                         compat_umode_t mode,   // IN: Mode to assign dir
                          HgfsOp opUsed,         // IN: Op to be used.
                          HgfsReq *req)          // IN/OUT: Packet to write into
 {
@@ -951,7 +951,7 @@ HgfsTruncatePages(struct inode *inode, // IN: Inode whose page to truncate
 static int
 HgfsCreate(struct inode *dir,     // IN: Parent dir to create in
            struct dentry *dentry, // IN: Dentry containing name to create
-           int mode,              // IN: Mode of file to be created
+           compat_umode_t mode,   // IN: Mode of file to be created
           struct nameidata *nd)  // IN: Intent, vfsmount, ...
 {
    HgfsAttrInfo attr;
@@ -1107,7 +1107,7 @@ error:
 static int
 HgfsMkdir(struct inode *dir,     // IN: Inode of parent directory
           struct dentry *dentry, // IN: Dentry with name to be created
-          int mode)              // IN: Mode of dir to be created
+          compat_umode_t mode)   // IN: Mode of dir to be created
 {
    HgfsReq *req;
    HgfsStatus replyStatus;