Last active
December 23, 2015 09:58
-
-
Save denji/6617876 to your computer and use it in GitHub Desktop.
Patch Parallels Tools for Linux-3.11 diff in Parallels Desktop 9.
https://github.com/CDeLorme/fedora_parallels_tools/issues/1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c 2013-09-19 06:32:40.000000000 +0300 | |
+++ b/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c 2013-09-19 06:34:02.000000000 +0300 | |
@@ -85,7 +85,11 @@ | |
DT_LNK, | |
}; | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+static int prlfs_fill_dir(struct file *filp, struct dir_context *ctx, | |
+#else | |
static int prlfs_fill_dir(struct file *filp, void *dirent, filldir_t filldir, | |
+#endif | |
loff_t *pos, void *buf, int buflen) | |
{ | |
struct super_block *sb; | |
@@ -138,7 +142,11 @@ | |
DPRINTK("filldir: name %s len %d, offset %lld, " | |
"de->type %d -> type %d\n", | |
de->name, name_len, (*pos), de->file_type, type); | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+ err = dir_emit(ctx, de->name, name_len, ino, type); | |
+#else | |
err = filldir(dirent, de->name, name_len, (*pos), ino, type); | |
+#endif | |
if (err < 0) | |
goto out; | |
@@ -150,7 +158,11 @@ | |
return ret; | |
} | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+static int prlfs_iterate(struct file *filp, struct dir_context *ctx) | |
+#else | |
static int prlfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |
+#endif | |
{ | |
struct prlfs_file_info pfi; | |
struct super_block *sb; | |
@@ -160,7 +172,11 @@ | |
DPRINTK("ENTER\n"); | |
ret = 0; | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+ init_pfi(&pfi, PFD(filp)->fd, PFD(filp)->sfid, ctx->pos, 0); | |
+#else | |
init_pfi(&pfi, PFD(filp)->fd, PFD(filp)->sfid, filp->f_pos, 0); | |
+#endif | |
assert(filp->f_dentry); | |
assert(filp->f_dentry->d_sb); | |
sb = filp->f_dentry->d_sb; | |
@@ -178,7 +194,11 @@ | |
break; | |
prev_offset = pfi.offset; | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+ ret = prlfs_fill_dir(filp, ctx, | |
+#else | |
ret = prlfs_fill_dir(filp, dirent, filldir, | |
+#endif | |
&pfi.offset, buf, len); | |
if (ret < 0) | |
break; | |
@@ -186,7 +206,11 @@ | |
break; | |
} | |
kfree(buf); | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+ ctx->pos = pfi.offset; | |
+#else | |
filp->f_pos = pfi.offset; | |
+#endif | |
out: | |
DPRINTK("EXIT returning %d\n", ret); | |
return ret; | |
@@ -397,13 +421,21 @@ | |
struct file_operations prlfs_dir_fops = { | |
.open = prlfs_open, | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+ .iterate = prlfs_iterate, | |
+#else | |
.readdir = prlfs_readdir, | |
+#endif | |
.release = prlfs_release, | |
.read = generic_read_dir, | |
}; | |
struct file_operations prlfs_root_fops = { | |
.open = prlfs_open, | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | |
+ .iterate = prlfs_iterate, | |
+#else | |
.readdir = prlfs_readdir, | |
+#endif | |
.read = generic_read_dir, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment