#ifndef __COMPAT_NAMEI_H__
# define __COMPAT_NAMEI_H__
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18)
#include <linux/namei.h>
-#endif
/*
* In 2.6.25-rc2, dentry and mount objects were removed from the nameidata
#define compat_path_release(nd) path_release(nd)
#endif
-/* path_lookup was exported in 2.4.25 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
-#define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd)
+/* path_lookup was removed in 2.6.39 merge window VFS merge */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#define compat_path_lookup(name, flags, nd) kern_path(name, flags, &((nd)->path))
#else
-#define compat_path_lookup(path, flags, nd) \
- ({ \
- int ret = 0; \
- if (path_init(path, flags, nd)) { \
- ret = path_walk(path, nd); \
- } \
- ret; \
- })
+#define compat_path_lookup(name, flags, nd) path_lookup(name, flags, nd)
#endif
#endif /* __COMPAT_NAMEI_H__ */
/* File system operations */
-#if defined(VMW_GETSB_2618)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+static struct dentry *FsOpMount(struct file_system_type *fsType, int flags,
+ const char *devName, void *rawData);
+#elif defined(VMW_GETSB_2618)
static int FsOpGetSb(struct file_system_type *fsType, int flags,
const char *devName, void *rawData, struct vfsmount *mnt);
#else
static struct file_system_type fsType = {
.owner = THIS_MODULE,
.name = VMBLOCK_FS_NAME,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+ .mount = FsOpMount,
+#else
.get_sb = FsOpGetSb,
+#endif
.kill_sb = kill_anon_super,
};
}
-#if defined(VMW_GETSB_2618)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * FsOpMount --
+ *
+ * Invokes generic kernel code to mount a deviceless filesystem.
+ *
+ * Results:
+ * Mount's root dentry tructure on success
+ * ERR_PTR()-encoded negative error code on failure
+ *
+ * Side effects:
+ * None
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+struct dentry *
+FsOpMount(struct file_system_type *fs_type, // IN: file system type of mount
+ int flags, // IN: mount flags
+ const char *dev_name, // IN: device mounting on
+ void *rawData) // IN: mount arguments
+{
+ return mount_nodev(fs_type, flags, rawData, FsOpReadSuper);
+}
+#elif defined(VMW_GETSB_2618)
/*
*-----------------------------------------------------------------------------
*