# 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);
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,
/* 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,
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
{
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;
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;