forked from jengelh/virtualbox
64 lines
1.9 KiB
Diff
64 lines
1.9 KiB
Diff
|
Index: trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
|
||
|
===================================================================
|
||
|
--- trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
|
||
|
+++ trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
|
||
|
@@ -234,5 +234,9 @@
|
||
|
* c. filldir returns an error (see comment on that)
|
||
|
*/
|
||
|
-static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir)
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||
|
+static int sf_dir_iterate(struct file *dir, struct dir_context *ctx)
|
||
|
+#else
|
||
|
+static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir)
|
||
|
+#endif
|
||
|
{
|
||
|
TRACE();
|
||
|
@@ -258,4 +262,7 @@
|
||
|
LogFunc(("sf_getdent error %d\n", err));
|
||
|
dir->f_pos += 1;
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||
|
+ ctx->pos += 1;
|
||
|
+#endif
|
||
|
continue;
|
||
|
}
|
||
|
@@ -263,5 +270,9 @@
|
||
|
/* d_name now contains a valid entry name */
|
||
|
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||
|
+ sanity = ctx->pos + 0xbeef;
|
||
|
+#else
|
||
|
sanity = dir->f_pos + 0xbeef;
|
||
|
+#endif
|
||
|
fake_ino = sanity;
|
||
|
if (sanity - fake_ino)
|
||
|
@@ -271,6 +282,9 @@
|
||
|
}
|
||
|
|
||
|
- err = filldir(opaque, d_name, strlen(d_name),
|
||
|
- dir->f_pos, fake_ino, DT_UNKNOWN);
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||
|
+ err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN);
|
||
|
+#else
|
||
|
+ err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, DT_UNKNOWN);
|
||
|
+#endif
|
||
|
if (err)
|
||
|
{
|
||
|
@@ -282,4 +296,7 @@
|
||
|
|
||
|
dir->f_pos += 1;
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||
|
+ ctx->pos += 1;
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
@@ -290,5 +307,9 @@
|
||
|
{
|
||
|
.open = sf_dir_open,
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
|
||
|
+ .iterate = sf_dir_iterate,
|
||
|
+#else
|
||
|
.readdir = sf_dir_read,
|
||
|
+#endif
|
||
|
.release = sf_dir_release,
|
||
|
.read = generic_read_dir
|